Skip to content

Commit

Permalink
Fix CS
Browse files Browse the repository at this point in the history
  • Loading branch information
pierredup committed May 3, 2021
1 parent c409611 commit 8331801
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
10 changes: 6 additions & 4 deletions src/Payum/Sofort/Action/Api/CreateTransactionAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ public function execute($request)
}

$fieldsRequired = ['amount', 'currency_code', 'reason', 'success_url'];
if ($this->api->getOption('disable_notification') == false) {
$fieldsRequired[] = 'notification_url';
}
$details->validateNotEmpty($fieldsRequired);

if ($this->api->getOption('disable_notification') == false) {
$fieldsRequired[] = 'notification_url';
}

$details->validateNotEmpty($fieldsRequired);

$details->replace($this->api->createTransaction((array) $details));

Expand Down
15 changes: 8 additions & 7 deletions src/Payum/Sofort/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,14 @@ public function refundTransaction(array $fields)

return $fields;
}

/**
* @param string $optionName
*
* @return mixed
*/
public function getOption(string $optionName){
return $this->options[$optionName];
* @param string $optionName
*
* @return mixed
*/
public function getOption(string $optionName)
{
return $this->options[$optionName] ?? null;
}
}

0 comments on commit 8331801

Please sign in to comment.