Skip to content

Commit

Permalink
Merge pull request #5 from aimeoscom/master
Browse files Browse the repository at this point in the history
Fixes for token based payments
  • Loading branch information
judgej authored May 12, 2020
2 parents b5859c7 + 9037e5b commit c9705e6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
20 changes: 10 additions & 10 deletions src/Messages/Backend/PurchaseRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,17 @@ public function getData()
if (! empty($items)) {
$item = array_shift($items);

$shoppingCartItem = [
'number' => $item['number'],
'productNr' => $item['productNr'],
'description' => $item['description'],
'quantity' => $item['quantity'],
'amount' => $item['amount'],
$shoppingCart = [
'item' => [
'number' => $item['number'],
'productNr' => $item['productNr'],
'description' => $item['description'],
'quantity' => $item['quantity'],
'amount' => $item['amount'],
]
];
} else {
$shoppingCartItem = [];
$shoppingCart = [];
}

return [
Expand All @@ -49,9 +51,7 @@ public function getData()
'customerName' => $this->getCustomerName(),
'order' => [
'description' => $this->getDescription(),
'shoppingCart' => [
'item' => $shoppingCartItem,
],
'shoppingCart' => $shoppingCart,
],
'confirmationUrl' => $this->getNotifyUrl(),
'language' => strtoupper($this->getLanguage()),
Expand Down
3 changes: 2 additions & 1 deletion src/Messages/NotificationValuesTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ public function getApprovalCode()
*/
public function isSuccessful()
{
return $this->getTransactionState() === static::TRANSACTION_STATE_BILLED;
return $this->getTransactionState() === static::TRANSACTION_STATE_BILLED
|| $this->getOperationStatus() === static::OPERATION_STATUS_OK;
}

/**
Expand Down

0 comments on commit c9705e6

Please sign in to comment.