From e9cc8628647187dfb3366f4e578f63d87deac844 Mon Sep 17 00:00:00 2001 From: Nuryagdy Mustapayev Date: Sun, 21 Jan 2024 20:32:23 +0100 Subject: [PATCH] PayFor - added history mapping --- .../PayForPosResponseDataMapper.php | 92 +++- .../PayForPosResponseDataMapperTest.php | 240 +++++++++ .../fail_order_not_found_response.json | 127 +++++ .../success_pay_refund_fail_response.json | 334 ++++++++++++ .../payfor/history/success_pay_response.json | 168 ++++++ ...pre_pay_post_pay_then_cancel_response.json | 498 ++++++++++++++++++ .../history/success_pre_pay_response.json | 168 ++++++ 7 files changed, 1626 insertions(+), 1 deletion(-) create mode 100644 tests/Unit/test_data/payfor/history/fail_order_not_found_response.json create mode 100644 tests/Unit/test_data/payfor/history/success_pay_refund_fail_response.json create mode 100644 tests/Unit/test_data/payfor/history/success_pay_response.json create mode 100644 tests/Unit/test_data/payfor/history/success_pre_pay_post_pay_then_cancel_response.json create mode 100644 tests/Unit/test_data/payfor/history/success_pre_pay_response.json diff --git a/src/DataMapper/ResponseDataMapper/PayForPosResponseDataMapper.php b/src/DataMapper/ResponseDataMapper/PayForPosResponseDataMapper.php index 8a17c070..5553e67f 100644 --- a/src/DataMapper/ResponseDataMapper/PayForPosResponseDataMapper.php +++ b/src/DataMapper/ResponseDataMapper/PayForPosResponseDataMapper.php @@ -274,7 +274,47 @@ public function mapStatusResponse(array $rawResponseData): array */ public function mapHistoryResponse(array $rawResponseData): array { - return $this->emptyStringsToNull($rawResponseData); + $rawResponseData = $this->emptyStringsToNull($rawResponseData); + + $mappedTransactions = []; + $procReturnCode = null; + $status = null; + $orderId = null; + $paymentRequest = []; + if (isset($rawResponseData['PaymentRequestExtended']['PaymentRequest'])) { + $paymentRequest = $rawResponseData['PaymentRequestExtended']['PaymentRequest']; + $procReturnCode = $this->getProcReturnCode($paymentRequest); + $status = self::TX_DECLINED; + if (self::PROCEDURE_SUCCESS_CODE === $procReturnCode) { + $status = self::TX_APPROVED; + $mappedTransactions[] = $this->mapSingleHistoryTransaction($paymentRequest); + } + $orderId = $paymentRequest['OrderId']; + } else { + foreach ($rawResponseData['PaymentRequestExtended'] as $tx) { + $orderId = $tx['PaymentRequest']['OrderId']; + $mappedTransactions[] = $this->mapSingleHistoryTransaction($tx['PaymentRequest']); + } + } + + $result = [ + 'order_id' => $orderId, + 'proc_return_code' => $procReturnCode, + 'error_code' => null, + 'error_message' => null, + 'status' => $status, + 'status_detail' => null !== $procReturnCode ? $this->getStatusDetail($procReturnCode) : null, + 'trans_count' => \count($mappedTransactions), + 'transactions' => $mappedTransactions, + 'all' => $rawResponseData, + ]; + + if (null !== $procReturnCode && self::PROCEDURE_SUCCESS_CODE !== $procReturnCode) { + $result['error_code'] = $procReturnCode; + $result['error_message'] = $paymentRequest['ErrMsg']; + } + + return $result; } /** @@ -396,4 +436,54 @@ private function map3DCommonResponseData(array $raw3DAuthResponseData): array return $result; } + + /** + * @param array $rawTx + * + * @return array + * + * @throws \Exception + */ + private function mapSingleHistoryTransaction(array $rawTx): array + { + $procReturnCode = $this->getProcReturnCode($rawTx); + $status = self::TX_DECLINED; + if (self::PROCEDURE_SUCCESS_CODE === $procReturnCode) { + $status = self::TX_APPROVED; + } + + $defaultResponse = $this->getDefaultOrderHistoryTxResponse(); + + $defaultResponse['proc_return_code'] = $procReturnCode; + $defaultResponse['status'] = $status; + $defaultResponse['status_detail'] = $this->getStatusDetail($procReturnCode); + $defaultResponse['error_code'] = self::TX_APPROVED === $status ? null : $procReturnCode; + $defaultResponse['transaction_type'] = $this->mapTxType((string) $rawTx['TxnType']); + $defaultResponse['currency'] = null !== $rawTx['Currency'] ? $this->mapCurrency($rawTx['Currency']) : null; + + if (self::TX_APPROVED === $status) { + $orderStatus = null; + $defaultResponse['auth_code'] = $rawTx['AuthCode'] ?? null; + $defaultResponse['ref_ret_num'] = $rawTx['HostRefNum'] ?? null; + $defaultResponse['masked_number'] = $rawTx['CardMask']; + $defaultResponse['first_amount'] = null !== $rawTx['PurchAmount'] ? $this->formatAmount($rawTx['PurchAmount']) : null; + $defaultResponse['trans_time'] = null !== $rawTx['InsertDatetime'] ? new \DateTime($rawTx['InsertDatetime']) : null; + if (\in_array( + $defaultResponse['transaction_type'], + [PosInterface::TX_TYPE_PAY_AUTH, PosInterface::TX_TYPE_PAY_POST_AUTH], + true + )) { + $defaultResponse['capture'] = true; + $defaultResponse['capture_amount'] = $defaultResponse['first_amount']; + $defaultResponse['capture_time'] = $defaultResponse['trans_time']; + $orderStatus = PosInterface::PAYMENT_STATUS_PAYMENT_COMPLETED; + } elseif (PosInterface::TX_TYPE_PAY_PRE_AUTH === $defaultResponse['transaction_type']) { + $defaultResponse['capture'] = false; + $orderStatus = PosInterface::PAYMENT_STATUS_PRE_AUTH_COMPLETED; + } + $defaultResponse['order_status'] = $orderStatus; + } + + return $defaultResponse; + } } diff --git a/tests/Unit/DataMapper/ResponseDataMapper/PayForPosResponseDataMapperTest.php b/tests/Unit/DataMapper/ResponseDataMapper/PayForPosResponseDataMapperTest.php index 651aacc3..6f80eef2 100644 --- a/tests/Unit/DataMapper/ResponseDataMapper/PayForPosResponseDataMapperTest.php +++ b/tests/Unit/DataMapper/ResponseDataMapper/PayForPosResponseDataMapperTest.php @@ -102,6 +102,38 @@ public function testMapStatusResponse(array $responseData, array $expectedData) $this->assertSame($expectedData, $actualData); } + /** + * @dataProvider historyTestDataProvider + */ + public function testMapHistoryResponse(array $responseData, array $expectedData) + { + $actualData = $this->responseDataMapper->mapHistoryResponse($responseData); + + if (count($actualData['transactions']) > 1 + && null !== $actualData['transactions'][0]['trans_time'] + && null !== $actualData['transactions'][1]['trans_time'] + ) { + $this->assertGreaterThan( + $actualData['transactions'][0]['trans_time'], + $actualData['transactions'][1]['trans_time'], + ); + } + + $this->assertCount($actualData['trans_count'], $actualData['transactions']); + + foreach ($actualData['transactions'] as $key => $tx) { + $this->assertEquals($expectedData['transactions'][$key]['trans_time'], $actualData['transactions'][$key]['trans_time'], "tx: $key"); + $this->assertEquals($expectedData['transactions'][$key]['capture_time'], $actualData['transactions'][$key]['capture_time'], "tx: $key"); + unset($actualData['transactions'][$key]['trans_time'], $expectedData['transactions'][$key]['trans_time']); + unset($actualData['transactions'][$key]['capture_time'], $expectedData['transactions'][$key]['capture_time']); + \ksort($actualData['transactions'][$key]); + \ksort($expectedData['transactions'][$key]); + } + + unset($actualData['all']); + $this->assertSame($expectedData, $actualData); + } + /** * @dataProvider refundTestDataProvider */ @@ -2110,4 +2142,212 @@ public function refundTestDataProvider(): array ], ]; } + + public static function historyTestDataProvider(): array + { + return [ + 'success_pre_pay_post_pay_then_cancel' => [ + 'responseData' => \json_decode(\file_get_contents(__DIR__.'/../../test_data/payfor/history/success_pre_pay_post_pay_then_cancel_response.json'), true), + 'expectedData' => [ + 'order_id' => '2024012107B7', + 'proc_return_code' => null, + 'error_code' => null, + 'error_message' => null, + 'status' => null, + 'status_detail' => null, + 'trans_count' => 3, + 'transactions' => [ + [ + 'auth_code' => 'S65465', + 'proc_return_code' => '00', + 'trans_id' => null, + 'trans_time' => new \DateTime('2024-01-21T17:39:02'), + 'capture_time' => null, + 'error_message' => null, + 'ref_ret_num' => null, + 'order_status' => 'PRE_AUTH_COMPLETED', + 'transaction_type' => 'pre', + 'first_amount' => 2.01, + 'capture_amount' => null, + 'status' => 'approved', + 'error_code' => null, + 'status_detail' => 'approved', + 'capture' => false, + 'currency' => 'TRY', + 'masked_number' => '415565******6111', + ], + [ + 'auth_code' => 'S75952', + 'proc_return_code' => '00', + 'trans_id' => null, + 'trans_time' => new \DateTime('2024-01-21T17:39:06'), + 'capture_time' => new \DateTime('2024-01-21T17:39:06'), + 'error_message' => null, + 'ref_ret_num' => null, + 'order_status' => 'PAYMENT_COMPLETED', + 'transaction_type' => 'post', + 'first_amount' => 2.03, + 'capture_amount' => 2.03, + 'status' => 'approved', + 'error_code' => null, + 'status_detail' => 'approved', + 'capture' => true, + 'currency' => 'TRY', + 'masked_number' => '415565******6111', + ], + [ + 'auth_code' => 'S10420', + 'proc_return_code' => '00', + 'trans_id' => null, + 'trans_time' => new \DateTime('2024-01-21T17:39:16'), + 'capture_time' => null, + 'error_message' => null, + 'ref_ret_num' => null, + 'order_status' => null, + 'transaction_type' => 'cancel', + 'first_amount' => 2.03, + 'capture_amount' => null, + 'status' => 'approved', + 'error_code' => null, + 'status_detail' => 'approved', + 'capture' => null, + 'currency' => 'TRY', + 'masked_number' => '415565******6111', + ], + ], + ], + ], + 'success_pay' => [ + 'responseData' => \json_decode(\file_get_contents(__DIR__.'/../../test_data/payfor/history/success_pay_response.json'), true), + 'expectedData' => [ + 'order_id' => '202401212A22', + 'proc_return_code' => '00', + 'error_code' => null, + 'error_message' => null, + 'status' => 'approved', + 'status_detail' => 'approved', + 'trans_count' => 1, + 'transactions' => [ + [ + 'auth_code' => 'S90726', + 'proc_return_code' => '00', + 'trans_id' => null, + 'trans_time' => new \DateTime('2024-01-21T21:40:47'), + 'capture_time' => new \DateTime('2024-01-21T21:40:47'), + 'error_message' => null, + 'ref_ret_num' => null, + 'order_status' => 'PAYMENT_COMPLETED', + 'transaction_type' => 'pay', + 'first_amount' => 1.01, + 'capture_amount' => 1.01, + 'status' => 'approved', + 'error_code' => null, + 'status_detail' => 'approved', + 'capture' => true, + 'currency' => 'TRY', + 'masked_number' => '415565******6111', + ], + ], + ], + ], + 'success_pre_pay' => [ + 'responseData' => \json_decode(\file_get_contents(__DIR__.'/../../test_data/payfor/history/success_pre_pay_response.json'), true), + 'expectedData' => [ + 'order_id' => '2024012186F9', + 'proc_return_code' => '00', + 'error_code' => null, + 'error_message' => null, + 'status' => 'approved', + 'status_detail' => 'approved', + 'trans_count' => 1, + 'transactions' => [ + [ + 'auth_code' => 'S95711', + 'proc_return_code' => '00', + 'trans_id' => null, + 'trans_time' => new \DateTime('2024-01-21T21:59:31'), + 'capture_time' => null, + 'error_message' => null, + 'ref_ret_num' => null, + 'order_status' => 'PRE_AUTH_COMPLETED', + 'transaction_type' => 'pre', + 'first_amount' => 2.01, + 'capture_amount' => null, + 'status' => 'approved', + 'error_code' => null, + 'status_detail' => 'approved', + 'capture' => false, + 'currency' => 'TRY', + 'masked_number' => '415565******6111', + ], + ], + ], + ], + 'success_pay_refund_fail' => [ + 'responseData' => \json_decode(\file_get_contents(__DIR__.'/../../test_data/payfor/history/success_pay_refund_fail_response.json'), true), + 'expectedData' => [ + 'order_id' => '202401211C79', + 'proc_return_code' => null, + 'error_code' => null, + 'error_message' => null, + 'status' => null, + 'status_detail' => null, + 'trans_count' => 2, + 'transactions' => [ + [ + 'auth_code' => 'S83066', + 'proc_return_code' => '00', + 'trans_id' => null, + 'trans_time' => new \DateTime('2024-01-21T22:14:23'), + 'capture_time' => new \DateTime('2024-01-21T22:14:23'), + 'error_message' => null, + 'ref_ret_num' => null, + 'order_status' => 'PAYMENT_COMPLETED', + 'transaction_type' => 'pay', + 'first_amount' => 1.01, + 'capture_amount' => 1.01, + 'status' => 'approved', + 'error_code' => null, + 'status_detail' => 'approved', + 'capture' => true, + 'currency' => 'TRY', + 'masked_number' => '415565******6111', + ], + [ + 'auth_code' => null, + 'proc_return_code' => 'V014', + 'trans_id' => null, + 'trans_time' => null, + 'capture_time' => null, + 'error_message' => null, + 'ref_ret_num' => null, + 'order_status' => null, + 'transaction_type' => 'refund', + 'first_amount' => null, + 'capture_amount' => null, + 'status' => 'declined', + 'error_code' => 'V014', + 'status_detail' => 'request_rejected', + 'capture' => null, + 'currency' => 'TRY', + 'masked_number' => null, + ], + ], + ], + ], + 'fail_order_not_found' => [ + 'responseData' => \json_decode(\file_get_contents(__DIR__.'/../../test_data/payfor/history/fail_order_not_found_response.json'), true), + 'expectedData' => [ + 'order_id' => '202401010C2022', + 'proc_return_code' => 'V013', + 'error_code' => 'V013', + 'error_message' => 'Seçili İşlem Bulunamadı!', + 'status' => 'declined', + 'status_detail' => 'reject', + 'trans_count' => 0, + 'transactions' => [], + ], + ], + ]; + } } diff --git a/tests/Unit/test_data/payfor/history/fail_order_not_found_response.json b/tests/Unit/test_data/payfor/history/fail_order_not_found_response.json new file mode 100644 index 00000000..83dd1827 --- /dev/null +++ b/tests/Unit/test_data/payfor/history/fail_order_not_found_response.json @@ -0,0 +1,127 @@ +{ + "@xmlns:xsi": "http:\/\/www.w3.org\/2001\/XMLSchema-instance", + "@xsi:noNamespaceSchemaLocation": "TxnHistoryReport.xsd", + "PaymentRequestExtended": { + "PaymentRequest": { + "UseExistingDataWhenInserting": "false", + "RequestGuid": "0", + "status": "0", + "InsertDatetime": "0001-01-01T00:00:00", + "lastUpdated": "0", + "MbrId": "5", + "MerchantID": "085300000009704", + "OrderId": "202401010C2022", + "PaymentSeq": "99894854", + "RequestIp": "88.152.8.2", + "RequestStat": "1,10", + "RequestStartDatetime": "20240121180050691", + "MpiStartDatetime": "0", + "MpiEndDatetime": "0", + "PaymentStartDatetime": "0", + "PaymentEndDatetime": "0", + "RequestEndDatetime": "0", + "Pan": "", + "Expiry": "", + "SecureType": "Report", + "TxnAmount": "0", + "Exponent": "2", + "Currency": "949", + "UserCode": "QNB_API_KULLANICI_3DPAY", + "TerminalID": "VS010481", + "TxnType": "TxnHistory", + "TerminalTxnType": "0", + "OrgOrderId": "202401010C2022", + "CardType": "", + "Lang": "TR", + "BonusAmount": "", + "InstallmentCount": "0", + "AlphaCode": "TL", + "Ecommerce": "1", + "Accept": "*\/*", + "Agent": "Symfony HttpClient\/Curl", + "MrcCountryCode": "792", + "MrcName": "3D PAY TEST ISYERI", + "MerchantHomeUrl": "https:\/\/vpostest.qnbfinansbank.com\/", + "IrcDet": "Se\u00e7ili \u0130\u015flem Bulunamad\u0131!", + "IrcCode": "99961", + "TxnStatus": "P", + "ErrMsg": "Se\u00e7ili \u0130\u015flem Bulunamad\u0131!", + "TxnResult": "Failed", + "ProcReturnCode": "V013", + "BatchNo": "4065", + "ReqId": "99922638", + "UsedPoint": "0", + "SrcType": "VPO", + "RefundedAmount": "0", + "RefundedPoint": "0", + "ReqDate": "0", + "SysDate": "0", + "F11": "237991", + "Mti": "0", + "Pcode": "0", + "F12": "0", + "F22": "0", + "F25": "0", + "VposElapsedTime": "0", + "BankingElapsedTime": "0", + "SocketElapsedTime": "0", + "HsmElapsedTime": "0", + "MpiElapsedTime": "0", + "UserPass": "UcBN0", + "MerchantPass": "12345678", + "DecryptedCard": "", + "Cvv2": "", + "hasOrderId": "true", + "TemplateType": "0", + "HasAddressCount": "false", + "IsPaymentFacilitator": "false", + "F11_ORG": "0", + "F12_ORG": "0", + "F22_ORG": "0", + "F25_ORG": "0", + "MTI_ORG": "0", + "IntervalType": "0", + "IntervalDuration": "0", + "RepeatCount": "0", + "RequestClientIp": "88.152.8.2", + "BankSpecificRequest": "0", + "VoidTime": "0", + "PaymentLinkId": "0", + "ArtiTaksit": "0" + }, + "PaymentAddress": { + "UseExistingDataWhenInserting": "false", + "RequestGuid": "0", + "status": "0" + }, + "ExtraParameters": { + "ArrayOfString": [ + { + "string": [ + "INCOMING_DATA", + "085300000009704<\/MerchantId>QNB_API_KULLANICI_3DPAY<\/UserCode>*****<\/UserPass_masked>5<\/MbrId>Report<\/SecureType>TxnHistory<\/TxnType>tr<\/Lang>202401010C2022<\/OrderId><\/INCOMING_DATA>" + ] + }, + { + "string": [ + "PAYFORFROMXMLREQUEST", + "1" + ] + }, + { + "string": [ + "SESSION_MRC_CODE", + "085300000009704" + ] + }, + { + "string": [ + "SESSION_SYSTEM_USER", + "0" + ] + } + ] + }, + "IsOnUsCard": "false" + } +} diff --git a/tests/Unit/test_data/payfor/history/success_pay_refund_fail_response.json b/tests/Unit/test_data/payfor/history/success_pay_refund_fail_response.json new file mode 100644 index 00000000..a6eb94de --- /dev/null +++ b/tests/Unit/test_data/payfor/history/success_pay_refund_fail_response.json @@ -0,0 +1,334 @@ +{ + "@xmlns:xsi": "http:\/\/www.w3.org\/2001\/XMLSchema-instance", + "@xsi:noNamespaceSchemaLocation": "TxnHistoryReport.xsd", + "PaymentRequestExtended": [ + { + "PaymentRequest": { + "UseExistingDataWhenInserting": "false", + "RequestGuid": "1000000094940719", + "status": "1", + "InsertDatetime": "2024-01-21T22:14:23", + "lastUpdated": "2024012122142364", + "MbrId": "5", + "MerchantID": "085300000009704", + "OrderId": "202401211C79", + "PaymentSeq": "0", + "RequestIp": "88.152.8.2", + "RequestStat": "1,10", + "RequestStartDatetime": "20240121221423628", + "MpiStartDatetime": "0", + "MpiEndDatetime": "0", + "PaymentStartDatetime": "20240121221423628", + "PaymentEndDatetime": "20240121221423644", + "RequestEndDatetime": "20240121221423644", + "Pan": "9E3EAA293B389C4AD4B22F1B28E15ED0", + "Expiry": "2501", + "SecureType": "NonSecure", + "PurchAmount": "1.01", + "TxnAmount": "1.01", + "Exponent": "2", + "Currency": "949", + "UserCode": "QNB_API_KULLANICI_3DPAY", + "Description": "", + "OkUrl": "", + "FailUrl": "", + "PayerTxnId": "", + "PayerAuthenticationCode": "", + "Eci": "", + "MD": "", + "Hash": "", + "TerminalID": "VS010481", + "TxnType": "Auth", + "TerminalTxnType": "2", + "MOTO": "0", + "OrgOrderId": "", + "SubMerchantCode": "", + "recur_frequency": "", + "recur_expiry": "", + "CardType": "V", + "Lang": "TR", + "Expsign": "", + "BonusAmount": "", + "InstallmentCount": "0", + "Rnd": "", + "AlphaCode": "TL", + "Ecommerce": "1", + "Accept": "*\/*", + "Agent": "Symfony HttpClient\/Curl", + "MrcCountryCode": "792", + "MrcName": "3D PAY TEST ISYERI", + "MerchantHomeUrl": "https:\/\/vpostest.qnbfinansbank.com\/", + "CardHolderName": "John Doe", + "IrcDet": "", + "IrcCode": "", + "Version": "", + "TxnStatus": "Y", + "CavvAlg": "", + "ParesVerified": "", + "ParesSyntaxOk": "", + "ErrMsg": "Onayland\u0131", + "VendorDet": "", + "D3Stat": "", + "TxnResult": "Success", + "AuthCode": "S83066", + "HostRefNum": "", + "ProcReturnCode": "00", + "ReturnUrl": "", + "ErrorData": "", + "BatchNo": "4065", + "VoidDate": "", + "CardMask": "415565******6111", + "ReqId": "99942957", + "UsedPoint": "0", + "SrcType": "VPO", + "RefundedAmount": "0", + "RefundedPoint": "0", + "ReqDate": "20240121", + "SysDate": "20240121", + "F11": "258310", + "F37": "402122258310", + "F37_ORG": "", + "Mti": "0", + "Pcode": "0", + "F12": "221423", + "F13": "121", + "F22": "812", + "F25": "59", + "F32": "", + "IsRepeatTxn": "", + "CavvResult": "", + "VposElapsedTime": "16", + "BankingElapsedTime": "0", + "SocketElapsedTime": "0", + "HsmElapsedTime": "2", + "MpiElapsedTime": "0", + "hasOrderId": "false", + "TemplateType": "0", + "HasAddressCount": "false", + "IsPaymentFacilitator": "false", + "OrgTxnType": "", + "F11_ORG": "0", + "F12_ORG": "0", + "F13_ORG": "", + "F22_ORG": "0", + "F25_ORG": "0", + "MTI_ORG": "0", + "DsBrand": "", + "IntervalType": "0", + "IntervalDuration": "0", + "RepeatCount": "0", + "CustomerCode": "", + "RequestMerchantDomain": "", + "RequestClientIp": "88.152.8.2", + "ResponseRnd": "", + "ResponseHash": "", + "BankSpecificRequest": "0", + "BankInternalResponseCode": "", + "BankInternalResponseMessage": "", + "BankInternalResponseSubcode": "", + "BankInternalResponseSubmessage": "", + "BayiKodu": "", + "VoidTime": "0", + "VoidUserCode": "", + "PaymentLinkId": "0", + "ClientId": "", + "IsQR": "", + "IsFast": "", + "QRRefNo": "", + "FASTGonderenKatilimciKodu": "", + "FASTAlanKatilimciKodu": "", + "FASTReferansNo": "", + "FastGonderenIBAN": "", + "FASTGonderenAdi": "", + "MobileECI": "", + "HubConnId": "", + "WalletData": "", + "Tds2dsTransId": "", + "Is3DHost": "", + "ArtiTaksit": "0", + "AuthId": "" + }, + "ExtraParameters": { + "ArrayOfString": [ + { + "string": [ + "IsBatchClosed", + "True" + ] + }, + { + "string": [ + "SettlementDate", + "20221001152338" + ] + } + ] + }, + "IsOnUsCard": "false" + }, + { + "PaymentRequest": { + "UseExistingDataWhenInserting": "false", + "RequestGuid": "1000000094940720", + "status": "1", + "InsertDatetime": "2024-01-21T22:14:24", + "lastUpdated": "2024012122142435", + "MbrId": "5", + "MerchantID": "085300000009704", + "OrderId": "202401211C79", + "PaymentSeq": "99915157", + "RequestIp": "88.152.8.2", + "RequestStat": "1,10", + "RequestStartDatetime": "20240121221424326", + "MpiStartDatetime": "0", + "MpiEndDatetime": "0", + "PaymentStartDatetime": "20240121221424342", + "PaymentEndDatetime": "20240121221424357", + "RequestEndDatetime": "20240121221424357", + "Pan": "9E3EAA293B389C4AD4B22F1B28E15ED0", + "Expiry": "2501", + "SecureType": "NonSecure", + "PurchAmount": "1.01", + "TxnAmount": "1.01", + "Exponent": "2", + "Currency": "949", + "UserCode": "QNB_API_KULLANICI_3DPAY", + "Description": "", + "OkUrl": "", + "FailUrl": "", + "PayerTxnId": "", + "PayerAuthenticationCode": "", + "Eci": "", + "MD": "", + "Hash": "", + "TerminalID": "VS010481", + "TxnType": "Refund", + "TerminalTxnType": "2", + "MOTO": "", + "OrgOrderId": "202401211C79", + "SubMerchantCode": "", + "recur_frequency": "", + "recur_expiry": "", + "CardType": "V", + "Lang": "TR", + "Expsign": "", + "BonusAmount": "", + "InstallmentCount": "0", + "Rnd": "", + "AlphaCode": "TL", + "Ecommerce": "1", + "Accept": "*\/*", + "Agent": "Symfony HttpClient\/Curl", + "MrcCountryCode": "792", + "MrcName": "3D PAY TEST ISYERI", + "MerchantHomeUrl": "https:\/\/vpostest.qnbfinansbank.com\/", + "CardHolderName": "", + "IrcDet": "Bu i\u015flem geri al\u0131namaz, l\u00fcften as\u0131l i\u015flemi iptal edin.", + "IrcCode": "99962", + "Version": "", + "TxnStatus": "N", + "CavvAlg": "", + "ParesVerified": "", + "ParesSyntaxOk": "", + "ErrMsg": "Bu i\u015flem geri al\u0131namaz, l\u00fcften as\u0131l i\u015flemi iptal edin.", + "VendorDet": "", + "D3Stat": "", + "TxnResult": "Failed", + "AuthCode": "S83066", + "HostRefNum": "", + "ProcReturnCode": "V014", + "ReturnUrl": "", + "ErrorData": "", + "BatchNo": "4065", + "VoidDate": "", + "CardMask": "415565******6111", + "ReqId": "99942941", + "UsedPoint": "0", + "SrcType": "VPO", + "RefundedAmount": "1.01", + "RefundedPoint": "0", + "ReqDate": "20240121", + "SysDate": "20240121", + "F11": "258296", + "F37": "402122258296", + "F37_ORG": "402122258310", + "Mti": "0", + "Pcode": "0", + "F12": "221424", + "F13": "121", + "F22": "812", + "F25": "59", + "F32": "", + "IsRepeatTxn": "", + "CavvResult": "", + "VposElapsedTime": "31", + "BankingElapsedTime": "0", + "SocketElapsedTime": "0", + "HsmElapsedTime": "4", + "MpiElapsedTime": "0", + "hasOrderId": "false", + "TemplateType": "0", + "HasAddressCount": "false", + "IsPaymentFacilitator": "false", + "OrgTxnType": "Auth", + "F11_ORG": "258310", + "F12_ORG": "221423", + "F13_ORG": "121", + "F22_ORG": "812", + "F25_ORG": "59", + "MTI_ORG": "0", + "DsBrand": "", + "IntervalType": "0", + "IntervalDuration": "0", + "RepeatCount": "0", + "CustomerCode": "", + "RequestMerchantDomain": "", + "RequestClientIp": "88.152.8.2", + "ResponseRnd": "", + "ResponseHash": "", + "BankSpecificRequest": "0", + "BankInternalResponseCode": "", + "BankInternalResponseMessage": "", + "BankInternalResponseSubcode": "", + "BankInternalResponseSubmessage": "", + "BayiKodu": "", + "VoidTime": "0", + "VoidUserCode": "", + "PaymentLinkId": "0", + "ClientId": "", + "IsQR": "", + "IsFast": "", + "QRRefNo": "", + "FASTGonderenKatilimciKodu": "", + "FASTAlanKatilimciKodu": "", + "FASTReferansNo": "", + "FastGonderenIBAN": "", + "FASTGonderenAdi": "", + "MobileECI": "", + "HubConnId": "", + "WalletData": "", + "Tds2dsTransId": "", + "Is3DHost": "", + "ArtiTaksit": "0", + "AuthId": "" + }, + "ExtraParameters": { + "ArrayOfString": [ + { + "string": [ + "IsBatchClosed", + "True" + ] + }, + { + "string": [ + "SettlementDate", + "20221001152338" + ] + } + ] + }, + "IsOnUsCard": "false" + } + ] +} diff --git a/tests/Unit/test_data/payfor/history/success_pay_response.json b/tests/Unit/test_data/payfor/history/success_pay_response.json new file mode 100644 index 00000000..9c2c5a67 --- /dev/null +++ b/tests/Unit/test_data/payfor/history/success_pay_response.json @@ -0,0 +1,168 @@ +{ + "@xmlns:xsi": "http:\/\/www.w3.org\/2001\/XMLSchema-instance", + "@xsi:noNamespaceSchemaLocation": "TxnHistoryReport.xsd", + "PaymentRequestExtended": { + "PaymentRequest": { + "UseExistingDataWhenInserting": "false", + "RequestGuid": "1000000094940711", + "status": "1", + "InsertDatetime": "2024-01-21T21:40:47", + "lastUpdated": "2024012121404761", + "MbrId": "5", + "MerchantID": "085300000009704", + "OrderId": "202401212A22", + "PaymentSeq": "0", + "RequestIp": "88.152.8.2", + "RequestStat": "1,10", + "RequestStartDatetime": "20240121214047596", + "MpiStartDatetime": "0", + "MpiEndDatetime": "0", + "PaymentStartDatetime": "20240121214047612", + "PaymentEndDatetime": "20240121214047612", + "RequestEndDatetime": "20240121214047612", + "Pan": "9E3EAA293B389C4AD4B22F1B28E15ED0", + "Expiry": "2501", + "SecureType": "NonSecure", + "PurchAmount": "1.01", + "TxnAmount": "1.01", + "Exponent": "2", + "Currency": "949", + "UserCode": "QNB_API_KULLANICI_3DPAY", + "Description": "", + "OkUrl": "", + "FailUrl": "", + "PayerTxnId": "", + "PayerAuthenticationCode": "", + "Eci": "", + "MD": "", + "Hash": "", + "TerminalID": "VS010481", + "TxnType": "Auth", + "TerminalTxnType": "2", + "MOTO": "0", + "OrgOrderId": "", + "SubMerchantCode": "", + "recur_frequency": "", + "recur_expiry": "", + "CardType": "V", + "Lang": "TR", + "Expsign": "", + "BonusAmount": "", + "InstallmentCount": "0", + "Rnd": "", + "AlphaCode": "TL", + "Ecommerce": "1", + "Accept": "*\/*", + "Agent": "Symfony HttpClient\/Curl", + "MrcCountryCode": "792", + "MrcName": "3D PAY TEST ISYERI", + "MerchantHomeUrl": "https:\/\/vpostest.qnbfinansbank.com\/", + "CardHolderName": "John Doe", + "IrcDet": "", + "IrcCode": "", + "Version": "", + "TxnStatus": "Y", + "CavvAlg": "", + "ParesVerified": "", + "ParesSyntaxOk": "", + "ErrMsg": "Onayland\u0131", + "VendorDet": "", + "D3Stat": "", + "TxnResult": "Success", + "AuthCode": "S90726", + "HostRefNum": "", + "ProcReturnCode": "00", + "ReturnUrl": "", + "ErrorData": "", + "BatchNo": "4065", + "VoidDate": "", + "CardMask": "415565******6111", + "ReqId": "99940316", + "UsedPoint": "0", + "SrcType": "VPO", + "RefundedAmount": "0", + "RefundedPoint": "0", + "ReqDate": "20240121", + "SysDate": "20240121", + "F11": "255671", + "F37": "402121255671", + "F37_ORG": "", + "Mti": "0", + "Pcode": "0", + "F12": "214047", + "F13": "121", + "F22": "812", + "F25": "59", + "F32": "", + "IsRepeatTxn": "", + "CavvResult": "", + "VposElapsedTime": "16", + "BankingElapsedTime": "0", + "SocketElapsedTime": "0", + "HsmElapsedTime": "5", + "MpiElapsedTime": "0", + "hasOrderId": "false", + "TemplateType": "0", + "HasAddressCount": "false", + "IsPaymentFacilitator": "false", + "OrgTxnType": "", + "F11_ORG": "0", + "F12_ORG": "0", + "F13_ORG": "", + "F22_ORG": "0", + "F25_ORG": "0", + "MTI_ORG": "0", + "DsBrand": "", + "IntervalType": "0", + "IntervalDuration": "0", + "RepeatCount": "0", + "CustomerCode": "", + "RequestMerchantDomain": "", + "RequestClientIp": "88.152.8.2", + "ResponseRnd": "", + "ResponseHash": "", + "BankSpecificRequest": "0", + "BankInternalResponseCode": "", + "BankInternalResponseMessage": "", + "BankInternalResponseSubcode": "", + "BankInternalResponseSubmessage": "", + "BayiKodu": "", + "VoidTime": "0", + "VoidUserCode": "", + "PaymentLinkId": "0", + "ClientId": "", + "IsQR": "", + "IsFast": "", + "QRRefNo": "", + "FASTGonderenKatilimciKodu": "", + "FASTAlanKatilimciKodu": "", + "FASTReferansNo": "", + "FastGonderenIBAN": "", + "FASTGonderenAdi": "", + "MobileECI": "", + "HubConnId": "", + "WalletData": "", + "Tds2dsTransId": "", + "Is3DHost": "", + "ArtiTaksit": "0", + "AuthId": "" + }, + "ExtraParameters": { + "ArrayOfString": [ + { + "string": [ + "IsBatchClosed", + "True" + ] + }, + { + "string": [ + "SettlementDate", + "20221001152338" + ] + } + ] + }, + "IsOnUsCard": "false" + } +} diff --git a/tests/Unit/test_data/payfor/history/success_pre_pay_post_pay_then_cancel_response.json b/tests/Unit/test_data/payfor/history/success_pre_pay_post_pay_then_cancel_response.json new file mode 100644 index 00000000..43325932 --- /dev/null +++ b/tests/Unit/test_data/payfor/history/success_pre_pay_post_pay_then_cancel_response.json @@ -0,0 +1,498 @@ +{ + "@xmlns:xsi": "http:\/\/www.w3.org\/2001\/XMLSchema-instance", + "@xsi:noNamespaceSchemaLocation": "TxnHistoryReport.xsd", + "PaymentRequestExtended": [ + { + "PaymentRequest": { + "UseExistingDataWhenInserting": "false", + "RequestGuid": "1000000094940595", + "status": "1", + "InsertDatetime": "2024-01-21T17:39:02", + "lastUpdated": "2024012117390272", + "MbrId": "5", + "MerchantID": "085300000009704", + "OrderId": "2024012107B7", + "PaymentSeq": "0", + "RequestIp": "88.152.8.2", + "RequestStat": "1,10", + "RequestStartDatetime": "20240121173902705", + "MpiStartDatetime": "0", + "MpiEndDatetime": "0", + "PaymentStartDatetime": "20240121173902720", + "PaymentEndDatetime": "20240121173902720", + "RequestEndDatetime": "20240121173902720", + "Pan": "9E3EAA293B389C4AD4B22F1B28E15ED0", + "Expiry": "2501", + "SecureType": "NonSecure", + "PurchAmount": "2.01", + "TxnAmount": "2.01", + "Exponent": "2", + "Currency": "949", + "UserCode": "QNB_API_KULLANICI_3DPAY", + "Description": "", + "OkUrl": "", + "FailUrl": "", + "PayerTxnId": "", + "PayerAuthenticationCode": "", + "Eci": "", + "MD": "", + "Hash": "", + "TerminalID": "VS010481", + "TxnType": "PreAuth", + "TerminalTxnType": "2", + "MOTO": "0", + "OrgOrderId": "", + "SubMerchantCode": "", + "recur_frequency": "", + "recur_expiry": "", + "CardType": "V", + "Lang": "TR", + "Expsign": "", + "BonusAmount": "", + "InstallmentCount": "3", + "Rnd": "", + "AlphaCode": "TL", + "Ecommerce": "1", + "Accept": "*\/*", + "Agent": "Symfony HttpClient\/Curl", + "MrcCountryCode": "792", + "MrcName": "3D PAY TEST ISYERI", + "MerchantHomeUrl": "https:\/\/vpostest.qnbfinansbank.com\/", + "CardHolderName": "John Doe", + "IrcDet": "", + "IrcCode": "", + "Version": "", + "TxnStatus": "Y", + "CavvAlg": "", + "ParesVerified": "", + "ParesSyntaxOk": "", + "ErrMsg": "Onayland\u0131", + "VendorDet": "", + "D3Stat": "", + "TxnResult": "Success", + "AuthCode": "S65465", + "HostRefNum": "", + "ProcReturnCode": "00", + "ReturnUrl": "", + "ErrorData": "", + "BatchNo": "4065", + "VoidDate": "", + "CardMask": "415565******6111", + "ReqId": "99920922", + "UsedPoint": "0", + "SrcType": "VPO", + "RefundedAmount": "0", + "RefundedPoint": "0", + "ReqDate": "20240121", + "SysDate": "20240121", + "F11": "236277", + "F37": "402117236277", + "F37_ORG": "", + "Mti": "0", + "Pcode": "0", + "F12": "173902", + "F13": "121", + "F22": "812", + "F25": "59", + "F32": "", + "IsRepeatTxn": "", + "CavvResult": "", + "VposElapsedTime": "15", + "BankingElapsedTime": "0", + "SocketElapsedTime": "0", + "HsmElapsedTime": "5", + "MpiElapsedTime": "0", + "hasOrderId": "false", + "TemplateType": "0", + "HasAddressCount": "false", + "IsPaymentFacilitator": "false", + "OrgTxnType": "", + "F11_ORG": "0", + "F12_ORG": "0", + "F13_ORG": "", + "F22_ORG": "0", + "F25_ORG": "0", + "MTI_ORG": "0", + "DsBrand": "", + "IntervalType": "0", + "IntervalDuration": "0", + "RepeatCount": "0", + "CustomerCode": "", + "RequestMerchantDomain": "", + "RequestClientIp": "88.152.8.2", + "ResponseRnd": "", + "ResponseHash": "", + "BankSpecificRequest": "0", + "BankInternalResponseCode": "", + "BankInternalResponseMessage": "", + "BankInternalResponseSubcode": "", + "BankInternalResponseSubmessage": "", + "BayiKodu": "", + "VoidTime": "0", + "VoidUserCode": "", + "PaymentLinkId": "0", + "ClientId": "", + "IsQR": "", + "IsFast": "", + "QRRefNo": "", + "FASTGonderenKatilimciKodu": "", + "FASTAlanKatilimciKodu": "", + "FASTReferansNo": "", + "FastGonderenIBAN": "", + "FASTGonderenAdi": "", + "MobileECI": "", + "HubConnId": "", + "WalletData": "", + "Tds2dsTransId": "", + "Is3DHost": "", + "ArtiTaksit": "0", + "AuthId": "" + }, + "ExtraParameters": { + "ArrayOfString": [ + { + "string": [ + "IsBatchClosed", + "True" + ] + }, + { + "string": [ + "SettlementDate", + "20221001152338" + ] + } + ] + }, + "IsOnUsCard": "false" + }, + { + "PaymentRequest": { + "UseExistingDataWhenInserting": "false", + "RequestGuid": "1000000094940596", + "status": "1", + "InsertDatetime": "2024-01-21T17:39:06", + "lastUpdated": "2024012117391674", + "MbrId": "5", + "MerchantID": "085300000009704", + "OrderId": "2024012107B7", + "PaymentSeq": "0", + "RequestIp": "88.152.8.2", + "RequestStat": "1,10", + "RequestStartDatetime": "20240121173906065", + "MpiStartDatetime": "0", + "MpiEndDatetime": "0", + "PaymentStartDatetime": "20240121173906081", + "PaymentEndDatetime": "20240121173906096", + "RequestEndDatetime": "20240121173906096", + "Pan": "9E3EAA293B389C4AD4B22F1B28E15ED0", + "Expiry": "2501", + "SecureType": "NonSecure", + "PurchAmount": "2.03", + "TxnAmount": "2.03", + "Exponent": "2", + "Currency": "949", + "UserCode": "QNB_API_KULLANICI_3DPAY", + "Description": "", + "OkUrl": "", + "FailUrl": "", + "PayerTxnId": "", + "PayerAuthenticationCode": "", + "Eci": "", + "MD": "", + "Hash": "", + "TerminalID": "VS010481", + "TxnType": "PostAuth", + "TerminalTxnType": "2", + "MOTO": "", + "OrgOrderId": "2024012107B7", + "SubMerchantCode": "", + "recur_frequency": "", + "recur_expiry": "", + "CardType": "V", + "Lang": "TR", + "Expsign": "", + "BonusAmount": "", + "InstallmentCount": "3", + "Rnd": "", + "AlphaCode": "TL", + "Ecommerce": "1", + "Accept": "*\/*", + "Agent": "Symfony HttpClient\/Curl", + "MrcCountryCode": "792", + "MrcName": "3D PAY TEST ISYERI", + "MerchantHomeUrl": "https:\/\/vpostest.qnbfinansbank.com\/", + "CardHolderName": "", + "IrcDet": "", + "IrcCode": "", + "Version": "", + "TxnStatus": "V", + "CavvAlg": "", + "ParesVerified": "", + "ParesSyntaxOk": "", + "ErrMsg": "Onayland\u0131", + "VendorDet": "", + "D3Stat": "", + "TxnResult": "Success", + "AuthCode": "S75952", + "HostRefNum": "", + "ProcReturnCode": "00", + "ReturnUrl": "", + "ErrorData": "", + "BatchNo": "4065", + "VoidDate": "20240121", + "CardMask": "415565******6111", + "ReqId": "99920979", + "UsedPoint": "0", + "SrcType": "VPO", + "RefundedAmount": "0", + "RefundedPoint": "0", + "ReqDate": "20240121", + "SysDate": "20240121", + "F11": "236332", + "F37": "402117236332", + "F37_ORG": "402117236277", + "Mti": "0", + "Pcode": "0", + "F12": "173906", + "F13": "121", + "F22": "812", + "F25": "59", + "F32": "", + "IsRepeatTxn": "", + "CavvResult": "", + "VposElapsedTime": "31", + "BankingElapsedTime": "0", + "SocketElapsedTime": "0", + "HsmElapsedTime": "2", + "MpiElapsedTime": "0", + "hasOrderId": "false", + "TemplateType": "0", + "HasAddressCount": "false", + "IsPaymentFacilitator": "false", + "OrgTxnType": "", + "F11_ORG": "236277", + "F12_ORG": "0", + "F13_ORG": "", + "F22_ORG": "0", + "F25_ORG": "0", + "MTI_ORG": "0", + "DsBrand": "", + "IntervalType": "0", + "IntervalDuration": "0", + "RepeatCount": "0", + "CustomerCode": "", + "RequestMerchantDomain": "", + "RequestClientIp": "88.152.8.2", + "ResponseRnd": "", + "ResponseHash": "", + "BankSpecificRequest": "0", + "BankInternalResponseCode": "", + "BankInternalResponseMessage": "", + "BankInternalResponseSubcode": "", + "BankInternalResponseSubmessage": "", + "BayiKodu": "", + "VoidTime": "173916", + "VoidUserCode": "QNB_API_KULLANICI_3DPAY", + "PaymentLinkId": "0", + "ClientId": "", + "IsQR": "", + "IsFast": "", + "QRRefNo": "", + "FASTGonderenKatilimciKodu": "", + "FASTAlanKatilimciKodu": "", + "FASTReferansNo": "", + "FastGonderenIBAN": "", + "FASTGonderenAdi": "", + "MobileECI": "", + "HubConnId": "", + "WalletData": "", + "Tds2dsTransId": "", + "Is3DHost": "", + "ArtiTaksit": "0", + "AuthId": "" + }, + "ExtraParameters": { + "ArrayOfString": [ + { + "string": [ + "IsBatchClosed", + "True" + ] + }, + { + "string": [ + "SettlementDate", + "20221001152338" + ] + } + ] + }, + "IsOnUsCard": "false" + }, + { + "PaymentRequest": { + "UseExistingDataWhenInserting": "false", + "RequestGuid": "1000000094950437", + "status": "1", + "InsertDatetime": "2024-01-21T17:39:16", + "lastUpdated": "2024012117391676", + "MbrId": "5", + "MerchantID": "085300000009704", + "OrderId": "2024012107B7", + "PaymentSeq": "0", + "RequestIp": "88.152.8.2", + "RequestStat": "1,10", + "RequestStartDatetime": "20240121173916731", + "MpiStartDatetime": "0", + "MpiEndDatetime": "0", + "PaymentStartDatetime": "20240121173916731", + "PaymentEndDatetime": "20240121173916762", + "RequestEndDatetime": "20240121173916762", + "Pan": "9E3EAA293B389C4AD4B22F1B28E15ED0", + "Expiry": "2501", + "SecureType": "NonSecure", + "PurchAmount": "2.03", + "TxnAmount": "2.03", + "Exponent": "2", + "Currency": "949", + "UserCode": "QNB_API_KULLANICI_3DPAY", + "Description": "", + "OkUrl": "", + "FailUrl": "", + "PayerTxnId": "", + "PayerAuthenticationCode": "", + "Eci": "", + "MD": "", + "Hash": "", + "TerminalID": "VS010481", + "TxnType": "Void", + "TerminalTxnType": "2", + "MOTO": "", + "OrgOrderId": "2024012107B7", + "SubMerchantCode": "", + "recur_frequency": "", + "recur_expiry": "", + "CardType": "V", + "Lang": "TR", + "Expsign": "", + "BonusAmount": "", + "InstallmentCount": "3", + "Rnd": "", + "AlphaCode": "TL", + "Ecommerce": "1", + "Accept": "*\/*", + "Agent": "Symfony HttpClient\/Curl", + "MrcCountryCode": "792", + "MrcName": "3D PAY TEST ISYERI", + "MerchantHomeUrl": "https:\/\/vpostest.qnbfinansbank.com\/", + "CardHolderName": "", + "IrcDet": "", + "IrcCode": "", + "Version": "", + "TxnStatus": "Y", + "CavvAlg": "", + "ParesVerified": "", + "ParesSyntaxOk": "", + "ErrMsg": "Onayland\u0131", + "VendorDet": "", + "D3Stat": "", + "TxnResult": "Success", + "AuthCode": "S10420", + "HostRefNum": "", + "ProcReturnCode": "00", + "ReturnUrl": "", + "ErrorData": "", + "BatchNo": "4065", + "VoidDate": "", + "CardMask": "415565******6111", + "ReqId": "99920932", + "UsedPoint": "0", + "SrcType": "VPO", + "RefundedAmount": "0", + "RefundedPoint": "0", + "ReqDate": "20240121", + "SysDate": "20240121", + "F11": "236287", + "F37": "402117236287", + "F37_ORG": "402117236277", + "Mti": "0", + "Pcode": "0", + "F12": "173916", + "F13": "121", + "F22": "812", + "F25": "59", + "F32": "", + "IsRepeatTxn": "", + "CavvResult": "", + "VposElapsedTime": "31", + "BankingElapsedTime": "0", + "SocketElapsedTime": "0", + "HsmElapsedTime": "2", + "MpiElapsedTime": "0", + "hasOrderId": "false", + "TemplateType": "0", + "HasAddressCount": "false", + "IsPaymentFacilitator": "false", + "OrgTxnType": "PostAuth", + "F11_ORG": "236277", + "F12_ORG": "173906", + "F13_ORG": "121", + "F22_ORG": "812", + "F25_ORG": "59", + "MTI_ORG": "0", + "DsBrand": "", + "IntervalType": "0", + "IntervalDuration": "0", + "RepeatCount": "0", + "CustomerCode": "", + "RequestMerchantDomain": "", + "RequestClientIp": "88.152.8.2", + "ResponseRnd": "", + "ResponseHash": "", + "BankSpecificRequest": "0", + "BankInternalResponseCode": "", + "BankInternalResponseMessage": "", + "BankInternalResponseSubcode": "", + "BankInternalResponseSubmessage": "", + "BayiKodu": "", + "VoidTime": "0", + "VoidUserCode": "", + "PaymentLinkId": "0", + "ClientId": "", + "IsQR": "", + "IsFast": "", + "QRRefNo": "", + "FASTGonderenKatilimciKodu": "", + "FASTAlanKatilimciKodu": "", + "FASTReferansNo": "", + "FastGonderenIBAN": "", + "FASTGonderenAdi": "", + "MobileECI": "", + "HubConnId": "", + "WalletData": "", + "Tds2dsTransId": "", + "Is3DHost": "", + "ArtiTaksit": "0", + "AuthId": "" + }, + "ExtraParameters": { + "ArrayOfString": [ + { + "string": [ + "IsBatchClosed", + "True" + ] + }, + { + "string": [ + "SettlementDate", + "20221001152338" + ] + } + ] + }, + "IsOnUsCard": "false" + } + ] +} diff --git a/tests/Unit/test_data/payfor/history/success_pre_pay_response.json b/tests/Unit/test_data/payfor/history/success_pre_pay_response.json new file mode 100644 index 00000000..bfc85361 --- /dev/null +++ b/tests/Unit/test_data/payfor/history/success_pre_pay_response.json @@ -0,0 +1,168 @@ +{ + "@xmlns:xsi": "http:\/\/www.w3.org\/2001\/XMLSchema-instance", + "@xsi:noNamespaceSchemaLocation": "TxnHistoryReport.xsd", + "PaymentRequestExtended": { + "PaymentRequest": { + "UseExistingDataWhenInserting": "false", + "RequestGuid": "1000000094940715", + "status": "1", + "InsertDatetime": "2024-01-21T21:59:31", + "lastUpdated": "2024012121593178", + "MbrId": "5", + "MerchantID": "085300000009704", + "OrderId": "2024012186F9", + "PaymentSeq": "0", + "RequestIp": "88.152.8.2", + "RequestStat": "1,10", + "RequestStartDatetime": "20240121215931770", + "MpiStartDatetime": "0", + "MpiEndDatetime": "0", + "PaymentStartDatetime": "20240121215931770", + "PaymentEndDatetime": "20240121215931786", + "RequestEndDatetime": "20240121215931786", + "Pan": "9E3EAA293B389C4AD4B22F1B28E15ED0", + "Expiry": "2501", + "SecureType": "NonSecure", + "PurchAmount": "2.01", + "TxnAmount": "2.01", + "Exponent": "2", + "Currency": "949", + "UserCode": "QNB_API_KULLANICI_3DPAY", + "Description": "", + "OkUrl": "", + "FailUrl": "", + "PayerTxnId": "", + "PayerAuthenticationCode": "", + "Eci": "", + "MD": "", + "Hash": "", + "TerminalID": "VS010481", + "TxnType": "PreAuth", + "TerminalTxnType": "2", + "MOTO": "0", + "OrgOrderId": "", + "SubMerchantCode": "", + "recur_frequency": "", + "recur_expiry": "", + "CardType": "V", + "Lang": "TR", + "Expsign": "", + "BonusAmount": "", + "InstallmentCount": "3", + "Rnd": "", + "AlphaCode": "TL", + "Ecommerce": "1", + "Accept": "*\/*", + "Agent": "Symfony HttpClient\/Curl", + "MrcCountryCode": "792", + "MrcName": "3D PAY TEST ISYERI", + "MerchantHomeUrl": "https:\/\/vpostest.qnbfinansbank.com\/", + "CardHolderName": "John Doe", + "IrcDet": "", + "IrcCode": "", + "Version": "", + "TxnStatus": "Y", + "CavvAlg": "", + "ParesVerified": "", + "ParesSyntaxOk": "", + "ErrMsg": "Onayland\u0131", + "VendorDet": "", + "D3Stat": "", + "TxnResult": "Success", + "AuthCode": "S95711", + "HostRefNum": "", + "ProcReturnCode": "00", + "ReturnUrl": "", + "ErrorData": "", + "BatchNo": "4065", + "VoidDate": "", + "CardMask": "415565******6111", + "ReqId": "99941852", + "UsedPoint": "0", + "SrcType": "VPO", + "RefundedAmount": "0", + "RefundedPoint": "0", + "ReqDate": "20240121", + "SysDate": "20240121", + "F11": "257207", + "F37": "402121257207", + "F37_ORG": "", + "Mti": "0", + "Pcode": "0", + "F12": "215931", + "F13": "121", + "F22": "812", + "F25": "59", + "F32": "", + "IsRepeatTxn": "", + "CavvResult": "", + "VposElapsedTime": "16", + "BankingElapsedTime": "0", + "SocketElapsedTime": "0", + "HsmElapsedTime": "6", + "MpiElapsedTime": "0", + "hasOrderId": "false", + "TemplateType": "0", + "HasAddressCount": "false", + "IsPaymentFacilitator": "false", + "OrgTxnType": "", + "F11_ORG": "0", + "F12_ORG": "0", + "F13_ORG": "", + "F22_ORG": "0", + "F25_ORG": "0", + "MTI_ORG": "0", + "DsBrand": "", + "IntervalType": "0", + "IntervalDuration": "0", + "RepeatCount": "0", + "CustomerCode": "", + "RequestMerchantDomain": "", + "RequestClientIp": "88.152.8.2", + "ResponseRnd": "", + "ResponseHash": "", + "BankSpecificRequest": "0", + "BankInternalResponseCode": "", + "BankInternalResponseMessage": "", + "BankInternalResponseSubcode": "", + "BankInternalResponseSubmessage": "", + "BayiKodu": "", + "VoidTime": "0", + "VoidUserCode": "", + "PaymentLinkId": "0", + "ClientId": "", + "IsQR": "", + "IsFast": "", + "QRRefNo": "", + "FASTGonderenKatilimciKodu": "", + "FASTAlanKatilimciKodu": "", + "FASTReferansNo": "", + "FastGonderenIBAN": "", + "FASTGonderenAdi": "", + "MobileECI": "", + "HubConnId": "", + "WalletData": "", + "Tds2dsTransId": "", + "Is3DHost": "", + "ArtiTaksit": "0", + "AuthId": "" + }, + "ExtraParameters": { + "ArrayOfString": [ + { + "string": [ + "IsBatchClosed", + "True" + ] + }, + { + "string": [ + "SettlementDate", + "20221001152338" + ] + } + ] + }, + "IsOnUsCard": "false" + } +}