Skip to content

Commit

Permalink
interpos - remove ref_ret_num mapping as it is always equal to "hostid"
Browse files Browse the repository at this point in the history
  • Loading branch information
mustapayev committed Oct 12, 2024
1 parent cc8d3f8 commit 42955c4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public function mapPaymentResponse(array $rawPaymentResponseData, string $txType
$result['order_id'] = $rawPaymentResponseData['OrderId'];
$result['transaction_id'] = $rawPaymentResponseData['TransId'];
$result['auth_code'] = $rawPaymentResponseData['AuthCode'];
$result['ref_ret_num'] = $rawPaymentResponseData['HostRefNum'];
$result['error_code'] = $rawPaymentResponseData['ErrorCode'];
$result['error_message'] = $rawPaymentResponseData['ErrorMessage'];
$result['currency'] = $order['currency'];
Expand Down Expand Up @@ -118,7 +117,7 @@ public function mapRefundResponse(array $rawResponseData): array
'order_id' => $rawResponseData['OrderId'],
'group_id' => null,
'auth_code' => null,
'ref_ret_num' => $rawResponseData['HostRefNum'],
'ref_ret_num' => null,
'proc_return_code' => $procReturnCode,
'transaction_id' => $rawResponseData['TransId'],
'error_code' => $rawResponseData['ErrorCode'],
Expand All @@ -145,7 +144,7 @@ public function mapCancelResponse($rawResponseData): array
'order_id' => $rawResponseData['OrderId'],
'group_id' => null,
'auth_code' => $rawResponseData['AuthCode'],
'ref_ret_num' => $rawResponseData['HostRefNum'],
'ref_ret_num' => null,
'proc_return_code' => $procReturnCode,
'transaction_id' => $rawResponseData['TransId'],
'error_code' => $rawResponseData['ErrorCode'],
Expand Down Expand Up @@ -180,7 +179,6 @@ public function mapStatusResponse(array $rawResponseData): array
$defaultResponse['refund_amount'] = $rawResponseData['RefundedAmount'] > 0 ? $this->formatAmount($rawResponseData['RefundedAmount']) : null;

// todo success cevap ornegi bulundugunda guncellenecek:
$defaultResponse['ref_ret_num'] = null;
$defaultResponse['order_status'] = null;
$defaultResponse['capture_amount'] = null;
$defaultResponse['capture'] = null;
Expand Down Expand Up @@ -309,7 +307,6 @@ private function map3DPaymentResponse(?array $rawPaymentResponseData, string $tx
$result['order_id'] = $rawPaymentResponseData['OrderId'];
$result['transaction_id'] = $rawPaymentResponseData['TransId'];
$result['auth_code'] = $rawPaymentResponseData['AuthCode'];
$result['ref_ret_num'] = $rawPaymentResponseData['HostRefNum'];
$result['error_code'] = $rawPaymentResponseData['ErrorCode'];
$result['error_message'] = $rawPaymentResponseData['ErrorMessage'];
$result['all'] = $rawPaymentResponseData;
Expand Down Expand Up @@ -353,7 +350,6 @@ private function map3DCommonResponseData(array $raw3DAuthResponseData, ?array $r
$threeDResponse = [
'order_id' => $paymentResponseData['order_id'] ?? $raw3DAuthResponseData['OrderId'],
'proc_return_code' => $paymentResponseData['proc_return_code'] ?? $procReturnCode,
'ref_ret_num' => $paymentResponseData['ref_ret_num'] ?? $raw3DAuthResponseData['HostRefNum'],
'transaction_security' => null === $mdStatus ? null : $this->mapResponseTransactionSecurity($mdStatus),
'payment_model' => $paymentModel,
'md_status' => $mdStatus,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public static function paymentTestDataProvider(): array
'responseData' => [
'OrderId' => '20221225662C',
'ProcReturnCode' => '81',
'HostRefNum' => 'hostid',
'HostRefNum' => null,
'AuthCode' => '',
'TxnResult' => 'Failed',
'ErrorMessage' => 'Terminal Aktif Degil',
Expand Down Expand Up @@ -266,7 +266,7 @@ public static function paymentTestDataProvider(): array
'amount' => 1.01,
'payment_model' => 'regular',
'auth_code' => null,
'ref_ret_num' => 'hostid',
'ref_ret_num' => null,
'batch_num' => null,
'proc_return_code' => '81',
'status' => 'declined',
Expand Down Expand Up @@ -340,7 +340,7 @@ public static function threeDPaymentDataProvider(): array
'FailUrl' => 'http:\/\/localhost\/interpos\/3d\/response.php',
'3DStatus' => '0',
'AuthCode' => null,
'HostRefNum' => 'hostid',
'HostRefNum' => null,
'TransId' => null,
'TRXDATE' => null,
'CardHolderName' => null,
Expand All @@ -359,7 +359,7 @@ public static function threeDPaymentDataProvider(): array
'order_id' => '20221225E1DF',
'transaction_id' => null,
'auth_code' => null,
'ref_ret_num' => 'hostid',
'ref_ret_num' => null,
'batch_num' => null,
'proc_return_code' => '81',
'status' => 'declined',
Expand Down Expand Up @@ -413,7 +413,7 @@ public static function threeDPaymentDataProvider(): array
'FailUrl' => 'gizlendi',
'3DStatus' => '1',
'AuthCode' => '',
'HostRefNum' => 'hostid',
'HostRefNum' => null,
'TransId' => '',
'TRXDATE' => '',
'CardHolderName' => '',
Expand All @@ -430,7 +430,7 @@ public static function threeDPaymentDataProvider(): array
'paymentData' => [
'OrderId' => '33554969',
'ProcReturnCode' => '00',
'HostRefNum' => 'hostid',
'HostRefNum' => null,
'AuthCode' => 'auth-code-123',
'TxnResult' => 'Success',
'ErrorMessage' => '',
Expand Down Expand Up @@ -471,7 +471,7 @@ public static function threeDPaymentDataProvider(): array
'order_id' => '33554969',
'transaction_id' => 'trans-id-123',
'auth_code' => 'auth-code-123',
'ref_ret_num' => 'hostid',
'ref_ret_num' => null,
'batch_num' => null,
'proc_return_code' => '00',
'status' => 'approved',
Expand Down Expand Up @@ -532,7 +532,7 @@ public static function threeDPayPaymentDataProvider(): array
'FailUrl' => 'http:\/\/localhost\/interpos\/3d-pay\/response.php',
'3DStatus' => '0',
'AuthCode' => '',
'HostRefNum' => 'hostid',
'HostRefNum' => null,
'TransId' => '',
'TRXDATE' => '',
'CardHolderName' => '',
Expand All @@ -550,7 +550,7 @@ public static function threeDPayPaymentDataProvider(): array
'order_id' => '20221225B83B',
'transaction_id' => null,
'auth_code' => null,
'ref_ret_num' => 'hostid',
'ref_ret_num' => null,
'batch_num' => null,
'proc_return_code' => '81',
'status' => 'declined',
Expand Down Expand Up @@ -611,7 +611,7 @@ public static function threeDHostPaymentDataProvider(): array
'FailUrl' => 'http:\/\/localhost\/interpos\/3d-host\/response.php',
'3DStatus' => '0',
'AuthCode' => '',
'HostRefNum' => 'hostid',
'HostRefNum' => null,
'TransId' => '',
'TRXDATE' => '',
'CardHolderName' => '',
Expand All @@ -631,7 +631,7 @@ public static function threeDHostPaymentDataProvider(): array
'order_id' => '202212256D26',
'transaction_id' => null,
'auth_code' => null,
'ref_ret_num' => 'hostid',
'ref_ret_num' => null,
'batch_num' => null,
'proc_return_code' => '81',
'status' => 'declined',
Expand Down Expand Up @@ -714,7 +714,7 @@ public static function cancelTestDataProvider(): array
'responseData' => [
'OrderId' => 'SYSOID121330755',
'ProcReturnCode' => '81',
'HostRefNum' => 'hostid',
'HostRefNum' => null,
'AuthCode' => '',
'TxnResult' => 'Failed',
'ErrorMessage' => 'Terminal Aktif Degil',
Expand Down Expand Up @@ -743,7 +743,7 @@ public static function cancelTestDataProvider(): array
'order_id' => 'SYSOID121330755',
'group_id' => null,
'auth_code' => null,
'ref_ret_num' => 'hostid',
'ref_ret_num' => null,
'proc_return_code' => '81',
'transaction_id' => null,
'error_code' => 'B810002',
Expand All @@ -762,7 +762,7 @@ public static function refundTestDataProvider(): array
'responseData' => [
'OrderId' => 'SYSOID121332551',
'ProcReturnCode' => '81',
'HostRefNum' => 'hostid',
'HostRefNum' => null,
'AuthCode' => '',
'TxnResult' => 'Failed',
'ErrorMessage' => 'Terminal Aktif Degil',
Expand Down Expand Up @@ -791,7 +791,7 @@ public static function refundTestDataProvider(): array
'order_id' => 'SYSOID121332551',
'group_id' => null,
'auth_code' => null,
'ref_ret_num' => 'hostid',
'ref_ret_num' => null,
'proc_return_code' => '81',
'transaction_id' => null,
'error_code' => 'B810002',
Expand Down

0 comments on commit 42955c4

Please sign in to comment.