Skip to content

Commit c9705e6

Browse files
authored
Merge pull request #5 from aimeoscom/master
Fixes for token based payments
2 parents b5859c7 + 9037e5b commit c9705e6

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

src/Messages/Backend/PurchaseRequest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,17 @@ public function getData()
2626
if (! empty($items)) {
2727
$item = array_shift($items);
2828

29-
$shoppingCartItem = [
30-
'number' => $item['number'],
31-
'productNr' => $item['productNr'],
32-
'description' => $item['description'],
33-
'quantity' => $item['quantity'],
34-
'amount' => $item['amount'],
29+
$shoppingCart = [
30+
'item' => [
31+
'number' => $item['number'],
32+
'productNr' => $item['productNr'],
33+
'description' => $item['description'],
34+
'quantity' => $item['quantity'],
35+
'amount' => $item['amount'],
36+
]
3537
];
3638
} else {
37-
$shoppingCartItem = [];
39+
$shoppingCart = [];
3840
}
3941

4042
return [
@@ -49,9 +51,7 @@ public function getData()
4951
'customerName' => $this->getCustomerName(),
5052
'order' => [
5153
'description' => $this->getDescription(),
52-
'shoppingCart' => [
53-
'item' => $shoppingCartItem,
54-
],
54+
'shoppingCart' => $shoppingCart,
5555
],
5656
'confirmationUrl' => $this->getNotifyUrl(),
5757
'language' => strtoupper($this->getLanguage()),

src/Messages/NotificationValuesTrait.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,8 @@ public function getApprovalCode()
168168
*/
169169
public function isSuccessful()
170170
{
171-
return $this->getTransactionState() === static::TRANSACTION_STATE_BILLED;
171+
return $this->getTransactionState() === static::TRANSACTION_STATE_BILLED
172+
|| $this->getOperationStatus() === static::OPERATION_STATUS_OK;
172173
}
173174

174175
/**

0 commit comments

Comments
 (0)