Skip to content

Commit

Permalink
[ECP-8807-v8] Handle POS payment resultCode (#2414)
Browse files Browse the repository at this point in the history
  • Loading branch information
candemiralp authored Dec 28, 2023
1 parent d39506c commit d085467
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Gateway/Response/PaymentPosCloudHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ public function handle(array $handlingSubject, array $paymentResponse)
// do not send order confirmation mail
$payment->getOrder()->setCanSendNewEmailFlag(false);

if (!empty($paymentResponse) && isset($paymentResponse['Response']['Result'])) {
$payment->setAdditionalInformation('resultCode', $paymentResponse['Response']['Result']);
}

if (!empty($paymentResponse['Response']['AdditionalResponse'])
) {
$pairs = \explode('&', $paymentResponse['Response']['AdditionalResponse']);
Expand Down
2 changes: 2 additions & 0 deletions Helper/PaymentResponseHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class PaymentResponseHandler
const CANCELLED = 'Cancelled';
const ADYEN_TOKENIZATION = 'Adyen Tokenization';
const VAULT = 'Magento Vault';
const POS_SUCCESS = 'Success';

/**
* @var AdyenLogger
Expand Down Expand Up @@ -118,6 +119,7 @@ public function formatPaymentResponse($resultCode, $action = null, $additionalDa
case self::AUTHORISED:
case self::REFUSED:
case self::ERROR:
case self::POS_SUCCESS:
return [
"isFinal" => true,
"resultCode" => $resultCode,
Expand Down

0 comments on commit d085467

Please sign in to comment.