Skip to content

Commit

Permalink
Merge pull request #256 from mewebstudio/254-kuveytpos-vakifkatilim-u…
Browse files Browse the repository at this point in the history
…ndefined-index

fix issue #254 kuveytpos vakifkatilim undefined index
  • Loading branch information
nuryagdym authored Dec 24, 2024
2 parents a885e33 + ec3b87c commit 672ba4b
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ protected function map3DCommonResponseData(array $raw3DAuthResponseData): array
$vPosMessage = $raw3DAuthResponseData['VPosMessage'];
$orderId = $vPosMessage['MerchantOrderId'];
} else {
$orderId = $raw3DAuthResponseData['MerchantOrderId'];
$orderId = $raw3DAuthResponseData['MerchantOrderId'] ?? null;
}

$default = [
Expand All @@ -445,6 +445,7 @@ protected function map3DCommonResponseData(array $raw3DAuthResponseData): array
'status_detail' => $this->getStatusDetail($procReturnCode),
'amount' => null,
'currency' => null,
'masked_number' => null,
'tx_status' => null,
'error_code' => self::TX_APPROVED !== $status ? $procReturnCode : null,
'md_error_message' => self::TX_APPROVED !== $status ? $raw3DAuthResponseData['ResponseMessage'] : null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ protected function map3DCommonResponseData(array $raw3DAuthResponseData): array
$status = self::TX_APPROVED;
}

$orderId = $raw3DAuthResponseData['MerchantOrderId'];
$orderId = $raw3DAuthResponseData['MerchantOrderId'] ?? null;

return [
'order_id' => $orderId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,50 @@ public static function paymentTestDataProvider(): iterable
public static function threeDPaymentDataProvider(): array
{
return [
'invalid_configuration' => [
'order' => [],
'txType' => PosInterface::TX_TYPE_PAY_AUTH,
'threeDResponseData' => [
'IsEnrolled' => false,
'IsVirtual' => false,
'ResponseCode' => 'InvalidTransactionSecurity',
'ResponseMessage' => 'İşlem türü geçersizdir.',
'OrderId' => 0,
'TransactionTime' => '0001-01-01T00:00:00',
'ReferenceId' => '2860e2d55e92435fa232a5dde55f68a9',
'MerchantId' => [
'@xsi:nil' => true,
'#' => '',
],
'BusinessKey' => 0,
'@xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
'@xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema',
],
'paymentData' => [],
'expectedData' => [
'transaction_id' => null,
'transaction_type' => 'pay',
'transaction_time' => null,
'transaction_security' => 'MPI fallback',
'md_status' => null,
'amount' => null,
'currency' => null,
'tx_status' => null,
'md_error_message' => 'İşlem türü geçersizdir.',
'masked_number' => null,
'auth_code' => null,
'ref_ret_num' => null,
'batch_num' => null,
'error_message' => null,
'order_id' => null,
'proc_return_code' => 'InvalidTransactionSecurity',
'status' => 'declined',
'status_detail' => 'InvalidTransactionSecurity',
'error_code' => 'InvalidTransactionSecurity',
'payment_model' => null,
'installment_count' => null,
],
],
'3d_auth_success_payment_fail_1' => [
'order' => [],
'txType' => PosInterface::TX_TYPE_PAY_AUTH,
Expand Down Expand Up @@ -548,6 +592,7 @@ public static function threeDPaymentDataProvider(): array
'amount' => null,
'currency' => null,
'tx_status' => null,
'masked_number' => null,
'md_error_message' => 'Şifrelenen veriler (Hashdata) uyuşmamaktadır.',
'payment_model' => null,
'installment_count' => null,
Expand Down

0 comments on commit 672ba4b

Please sign in to comment.