From b038583c1018306d8e766e3af268cb9f77db159c Mon Sep 17 00:00:00 2001 From: Nuryagdy Mustapayev Date: Mon, 1 Jul 2024 14:40:03 +0200 Subject: [PATCH 1/6] vakifkatilim-pos - fix 3d secure payment displayAmount error --- .../RequestDataMapper/VakifKatilimPosRequestDataMapper.php | 1 + .../VakifKatilimPosRequestDataMapperTest.php | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/DataMapper/RequestDataMapper/VakifKatilimPosRequestDataMapper.php b/src/DataMapper/RequestDataMapper/VakifKatilimPosRequestDataMapper.php index 606025f5..8dd8ea97 100644 --- a/src/DataMapper/RequestDataMapper/VakifKatilimPosRequestDataMapper.php +++ b/src/DataMapper/RequestDataMapper/VakifKatilimPosRequestDataMapper.php @@ -114,6 +114,7 @@ public function create3DEnrollmentCheckRequestData(KuveytPosAccount $kuveytPosAc 'TransactionSecurity' => $this->secureTypeMappings[$paymentModel], 'InstallmentCount' => $this->mapInstallment($order['installment']), 'Amount' => $this->formatAmount($order['amount']), + 'DisplayAmount' => $this->formatAmount($order['amount']), 'FECCurrencyCode' => $this->mapCurrency($order['currency']), 'MerchantOrderId' => $order['id'], 'OkUrl' => $order['success_url'], diff --git a/tests/Unit/DataMapper/RequestDataMapper/VakifKatilimPosRequestDataMapperTest.php b/tests/Unit/DataMapper/RequestDataMapper/VakifKatilimPosRequestDataMapperTest.php index b1a63bdd..5711d1b8 100644 --- a/tests/Unit/DataMapper/RequestDataMapper/VakifKatilimPosRequestDataMapperTest.php +++ b/tests/Unit/DataMapper/RequestDataMapper/VakifKatilimPosRequestDataMapperTest.php @@ -189,7 +189,10 @@ public function testCreate3DEnrollmentCheckRequestData(array $order, string $txT $txType, $card ); - $this->assertEquals($expectedData, $actualData); + + ksort($actualData); + ksort($expectedData); + $this->assertSame($expectedData, $actualData); } /** @@ -431,6 +434,7 @@ public static function create3DEnrollmentCheckRequestDataDataProvider(): array 'TransactionSecurity' => '3', 'InstallmentCount' => '0', 'Amount' => 1001, + 'DisplayAmount' => 1001, 'FECCurrencyCode' => '0949', 'MerchantOrderId' => '2020110828BC', 'OkUrl' => 'http://localhost/finansbank-payfor/3d/success.php', From be5ac5b622d37d7e9bde9150eb3c5b8e56178715 Mon Sep 17 00:00:00 2001 From: Nuryagdy Mustapayev Date: Mon, 1 Jul 2024 15:10:50 +0200 Subject: [PATCH 2/6] vakifkatilim-pos - fix undefined index VPosMessageContract on 3d payment provision --- .../VakifKatilimPosResponseDataMapper.php | 5 +- .../VakifKatilimPosResponseDataMapperTest.php | 149 ++++++++++++------ tests/Unit/Gateways/VakifKatilimTest.php | 21 ++- 3 files changed, 118 insertions(+), 57 deletions(-) diff --git a/src/DataMapper/ResponseDataMapper/VakifKatilimPosResponseDataMapper.php b/src/DataMapper/ResponseDataMapper/VakifKatilimPosResponseDataMapper.php index 0a8c79ef..9d0c29b5 100644 --- a/src/DataMapper/ResponseDataMapper/VakifKatilimPosResponseDataMapper.php +++ b/src/DataMapper/ResponseDataMapper/VakifKatilimPosResponseDataMapper.php @@ -546,7 +546,7 @@ private function map3DPaymentPaymentResponse(array $rawPaymentResponseData, stri } /** @var array $vPosMessage */ - $vPosMessage = $rawPaymentResponseData['VPosMessageContract']; + $vPosMessage = $rawPaymentResponseData['VPosMessage']; // ProvisionNumber: Başarılı işlemlerde kart bankasının vermiş olduğu otorizasyon numarasıdır. $result['order_id'] = $rawPaymentResponseData['MerchantOrderId']; @@ -555,7 +555,8 @@ private function map3DPaymentPaymentResponse(array $rawPaymentResponseData, stri $result['ref_ret_num'] = $rawPaymentResponseData['RRN']; // Stan: Pos bankası tarafında verilen referans işlem referans numarasıdır. $result['transaction_id'] = $rawPaymentResponseData['Stan']; - $result['auth_code'] = $rawPaymentResponseData['ProvisionNumber'] ?? null; + $result['batch_num'] = $vPosMessage['BatchId']; + $result['auth_code'] = $rawPaymentResponseData['ProvisionNumber'] ?? null; $result['masked_number'] = $vPosMessage['CardNumber'] ?? null; $result['currency'] = isset($vPosMessage['CurrencyCode']) ? $this->mapCurrency($vPosMessage['CurrencyCode']) : $order['currency']; $result['amount'] = $this->formatAmount($vPosMessage['Amount']); diff --git a/tests/Unit/DataMapper/ResponseDataMapper/VakifKatilimPosResponseDataMapperTest.php b/tests/Unit/DataMapper/ResponseDataMapper/VakifKatilimPosResponseDataMapperTest.php index 7a8612bb..62e6838f 100644 --- a/tests/Unit/DataMapper/ResponseDataMapper/VakifKatilimPosResponseDataMapperTest.php +++ b/tests/Unit/DataMapper/ResponseDataMapper/VakifKatilimPosResponseDataMapperTest.php @@ -387,78 +387,127 @@ public static function threeDPaymentDataProvider(): array 'txType' => PosInterface::TX_TYPE_PAY_AUTH, 'threeDResponseData' => [ 'ResponseCode' => '00', - 'ResponseMessage' => '', + 'ResponseMessage' => 'Kart doğrulandı.', 'ProvisionNumber' => '', - 'MerchantOrderId' => '15161', - 'OrderId' => '0', - 'RRN' => '904115005554', - 'Stan' => '005554', - 'HashData' => 'mOw0JGvy1JVWqDDmFyaDTvKz9Fk=', - 'MD' => 'ktSVkYJHcHSYM1ibA/nM6nObr8WpWdcw34ziyRQRLv06g7UR2r5LrpLeNvwfBwPz', + 'MerchantOrderId' => '2024070152BF', + 'OrderId' => '6373034', + 'RRN' => '', + 'Stan' => '', + 'HashData' => 'tilHwVYboCx82++WZXg0I81LW6w=', + 'MD' => '/6auNEWM9TvyMZAuoM5Tjw==', ], 'paymentData' => [ - 'VPosMessageContract' => [ - 'OkUrl' => 'http://localhost/ThreeDModel/Approval', - 'FailUrl' => 'http://localhost/ThreeDModel/Fail', - 'HashData' => 'DvAUXMvYV4ex5m16mMezEl+kxrI=', + 'VPosMessage' => [ + 'HashData' => '7tVy86ZXrcFCXLXL61Ayk0NkuBU=', 'MerchantId' => '1', 'SubMerchantId' => '0', - 'CustomerId' => '936', - 'UserName' => 'APIUSER', - 'HashPassword' => 'kfkdsnskslkclswr9430ır', - 'MerchantOrderId' => '1554891870', + 'CustomerId' => '222222', + 'UserName' => 'apiuser', + 'ReferenceNumber' => '7lQGu240701124943371', + 'Rank' => '1', + 'OkUrl' => 'https://localhost/pos/examples/vakif-katilim/3d/response.php', + 'FailUrl' => 'https://localhost/pos/examples/vakif-katilim/3d/response.php', + 'CommonPaymentPageAllowed' => [ + '@xsi:nil' => 'true', + '#' => '', + ], + 'MerchantOrderIdUniqueControl' => [ + '@xsi:nil' => 'true', + '#' => '', + ], + 'BatchId' => '0', + 'ManuelBatch' => 'false', + 'MerchantOrderId' => '2024070152BF', 'InstallmentCount' => '0', - 'Amount' => '111', + 'Amount' => '1001', 'FECAmount' => '0', + 'TransactionSecurity' => '3', 'AdditionalData' => [ 'AdditionalDataList' => [ 'VPosAdditionalData' => [ 'Key' => 'MD', - 'Data' => 'vygnTBD4smBxAOlDsgbaOQ==', + 'Data' => '/6auNEWM9TvyMZAuoM5Tjw==', ], ], ], 'Products' => '', 'Addresses' => '', - 'PaymentType' => '1', + 'APIVersion' => '1.0.0', + 'InstallmentMaturityCommisionFlag' => '0', + 'StartDate' => [ + '@xsi:nil' => 'true', + '#' => '', + ], + 'EndDate' => [ + '@xsi:nil' => 'true', + '#' => '', + ], + 'UpperLimit' => [ + '@xsi:nil' => 'true', + '#' => '', + ], + 'LowerLimit' => [ + '@xsi:nil' => 'true', + '#' => '', + ], + 'RegisteredCardTransaction' => '0', + 'QueryId' => '0', 'DebtId' => '0', 'SurchargeAmount' => '0', 'SGKDebtAmount' => '0', - 'InstallmentMaturityCommisionFlag' => '0', - 'TransactionSecurity' => '3', + 'VPSEntryMode' => 'None', + 'OrderPOSTransactionId' => [ + '@xsi:nil' => 'true', + '#' => '', + ], + 'TranDate' => [ + '@xsi:nil' => 'true', + '#' => '', + ], + 'EntryGateMethod' => 'VPOS_ThreeDModelPayGate', + 'CardHolderCustomerId' => [ + '@xsi:nil' => 'true', + '#' => '', + ], + 'PaymentId' => [ + '@xsi:nil' => 'true', + '#' => '', + ], ], - 'IsEnrolled' => 'true', - 'IsVirtual' => 'false', - 'RRN' => '922709016599', - 'Stan' => '016599', - 'ResponseCode' => '00', - 'ResponseMessage' => 'Provizyon Alindi.', - 'OrderId' => '15161', - 'TransactionTime' => '00010101T00:00:00', - 'MerchantOrderId' => '1554891870', - 'HashData' => 'bcCqBe4hbElPOVYtfvsw7M44usQ=', - '@xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance', - '@xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema', + 'IsEnrolled' => 'true', + 'IsVirtual' => 'false', + 'ProvisionNumber' => '271425', + 'RRN' => '418312081069', + 'Stan' => '434824', + 'ResponseCode' => '00', + 'ResponseMessage' => 'İşlem onaylandı', + 'OrderId' => '6373034', + 'TransactionTime' => '2024-07-01T12:49:44.4281161', + 'MerchantOrderId' => '2024070152BF', + 'HashData' => 'eNscG4h7B+Fx4/k0Dmt89HDP6nU=', + 'BusinessKey' => '0', + '@xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance', + '@xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema', ], 'expectedData' => [ 'transaction_security' => null, 'md_status' => null, 'tx_status' => null, 'md_error_message' => null, - 'transaction_id' => '016599', + 'transaction_id' => '434824', 'transaction_type' => 'pay', - 'transaction_time' => new \DateTimeImmutable(), - 'auth_code' => null, - 'ref_ret_num' => '922709016599', - 'batch_num' => null, + 'transaction_time' => new \DateTimeImmutable('2024-07-01T12:49:44.4281161'), + 'auth_code' => '271425', + 'ref_ret_num' => '418312081069', + 'batch_num' => '0', 'error_code' => null, 'error_message' => null, - 'remote_order_id' => '15161', - 'order_id' => '1554891870', + 'remote_order_id' => '6373034', + 'order_id' => '2024070152BF', 'proc_return_code' => '00', 'status' => 'approved', 'status_detail' => 'approved', - 'amount' => 1.11, + 'amount' => 10.01, 'currency' => PosInterface::CURRENCY_TRY, 'masked_number' => null, 'payment_model' => '3d', @@ -471,34 +520,34 @@ public static function threeDPaymentDataProvider(): array ], 'txType' => PosInterface::TX_TYPE_PAY_AUTH, 'threeDResponseData' => [ - 'ResponseCode' => '05', - 'ResponseMessage' => '', + 'ResponseCode' => 'MPIAuthenticationStatusN', + 'ResponseMessage' => '(N)Isleminiz gerceklestirelemedi. Kullanicinin 3d islem yapmasi engellendi.', 'ProvisionNumber' => '', - 'MerchantOrderId' => '15161', + 'MerchantOrderId' => '20240701F2F6', 'OrderId' => '0', 'RRN' => '', 'Stan' => '', - 'HashData' => 'mOw0JGvy1JVWqDDmFyaDTvKz9Fk=', - 'MD' => 'ktSVkYJHcHSYM1ibA/nM6nObr8WpWdcw34ziyRQRLv06g7UR2r5LrpLeNvwfBwPz', + 'HashData' => 'SVdI+hHXxg8GO0wY0hAcfRWpHyo=', + 'MD' => 'DpOHKpBUNVvU5Ld/FaeM6Q==', ], 'paymentData' => [], 'expectedData' => [ 'transaction_security' => null, 'md_status' => null, 'tx_status' => null, - 'md_error_message' => null, + 'md_error_message' => '(N)Isleminiz gerceklestirelemedi. Kullanicinin 3d islem yapmasi engellendi.', 'transaction_id' => null, 'transaction_type' => 'pay', 'transaction_time' => null, 'auth_code' => null, 'ref_ret_num' => null, 'batch_num' => null, - 'error_code' => '05', + 'error_code' => 'MPIAuthenticationStatusN', 'error_message' => null, - 'order_id' => '15161', - 'proc_return_code' => '05', + 'order_id' => '20240701F2F6', + 'proc_return_code' => 'MPIAuthenticationStatusN', 'status' => 'declined', - 'status_detail' => '05', + 'status_detail' => 'MPIAuthenticationStatusN', 'amount' => null, 'currency' => null, 'payment_model' => '3d', diff --git a/tests/Unit/Gateways/VakifKatilimTest.php b/tests/Unit/Gateways/VakifKatilimTest.php index 46c0120b..df1b6494 100644 --- a/tests/Unit/Gateways/VakifKatilimTest.php +++ b/tests/Unit/Gateways/VakifKatilimTest.php @@ -303,10 +303,8 @@ public function testMake3DPayment( ->method('create3DPaymentRequestData'); $this->serializerMock->expects(self::never()) ->method('encode'); - $this->serializerMock->expects(self::once()) - ->method('decode') - ->with(urldecode($request->request->get('AuthenticationResponse')), $txType) - ->willReturn($request->request->all()); + $this->serializerMock->expects(self::never()) + ->method('decode'); $this->eventDispatcherMock->expects(self::never()) ->method('dispatch'); } @@ -592,7 +590,20 @@ public function testOrderHistoryRequest(array $order, string $apiUrl): void public static function make3DPaymentDataProvider(): array { return [ - 'auth_fail' => [ + '3d_auth_fail' => [ + 'order' => VakifKatilimPosResponseDataMapperTest::threeDPaymentDataProvider()['3d_auth_fail1']['order'], + 'txType' => VakifKatilimPosResponseDataMapperTest::threeDPaymentDataProvider()['3d_auth_fail1']['txType'], + 'request' => Request::create( + '', + 'POST', + VakifKatilimPosResponseDataMapperTest::threeDPaymentDataProvider()['3d_auth_fail1']['threeDResponseData'] + ), + 'paymentResponse' => VakifKatilimPosResponseDataMapperTest::threeDPaymentDataProvider()['3d_auth_fail1']['paymentData'], + 'expected' => VakifKatilimPosResponseDataMapperTest::threeDPaymentDataProvider()['3d_auth_fail1']['expectedData'], + 'is3DSuccess' => false, + 'isSuccess' => false, + ], + 'auth_success' => [ 'order' => VakifKatilimPosResponseDataMapperTest::threeDPaymentDataProvider()['success1']['order'], 'txType' => VakifKatilimPosResponseDataMapperTest::threeDPaymentDataProvider()['success1']['txType'], 'request' => Request::create( From 20bb7462bc4fed841d90ef98e4ced415fb771588 Mon Sep 17 00:00:00 2001 From: Nuryagdy Mustapayev Date: Mon, 1 Jul 2024 14:47:14 +0200 Subject: [PATCH 3/6] vakifkatilim-pos - fix undefined index FECCurrencyCode on cancel request --- .../VakifKatilimPosResponseDataMapper.php | 1 - .../VakifKatilimPosRequestDataMapperTest.php | 5 +- .../VakifKatilimPosResponseDataMapperTest.php | 310 +++++++++++++++--- 3 files changed, 276 insertions(+), 40 deletions(-) diff --git a/src/DataMapper/ResponseDataMapper/VakifKatilimPosResponseDataMapper.php b/src/DataMapper/ResponseDataMapper/VakifKatilimPosResponseDataMapper.php index 9d0c29b5..8d1fffb3 100644 --- a/src/DataMapper/ResponseDataMapper/VakifKatilimPosResponseDataMapper.php +++ b/src/DataMapper/ResponseDataMapper/VakifKatilimPosResponseDataMapper.php @@ -236,7 +236,6 @@ public function mapCancelResponse(array $rawResponseData): array $result['order_id'] = $vposMessage['MerchantOrderId']; $result['remote_order_id'] = (string) $rawResponseData['OrderId']; $result['status'] = $status; - $result['currency'] = $this->mapCurrency($vposMessage['FECCurrencyCode']); if (self::TX_APPROVED !== $status) { $result['error_code'] = $procReturnCode; diff --git a/tests/Unit/DataMapper/RequestDataMapper/VakifKatilimPosRequestDataMapperTest.php b/tests/Unit/DataMapper/RequestDataMapper/VakifKatilimPosRequestDataMapperTest.php index 5711d1b8..27fc4e9a 100644 --- a/tests/Unit/DataMapper/RequestDataMapper/VakifKatilimPosRequestDataMapperTest.php +++ b/tests/Unit/DataMapper/RequestDataMapper/VakifKatilimPosRequestDataMapperTest.php @@ -210,7 +210,10 @@ public function testCreateCancelRequestData(array $order, array $expected): void public function testCreateRefundRequestData(array $order, array $expected): void { $actual = $this->requestDataMapper->createRefundRequestData($this->account, $order); - $this->assertEquals($expected, $actual); + + \ksort($actual); + \ksort($expected); + $this->assertSame($expected, $actual); } /** diff --git a/tests/Unit/DataMapper/ResponseDataMapper/VakifKatilimPosResponseDataMapperTest.php b/tests/Unit/DataMapper/ResponseDataMapper/VakifKatilimPosResponseDataMapperTest.php index 62e6838f..5aab8361 100644 --- a/tests/Unit/DataMapper/ResponseDataMapper/VakifKatilimPosResponseDataMapperTest.php +++ b/tests/Unit/DataMapper/ResponseDataMapper/VakifKatilimPosResponseDataMapperTest.php @@ -674,60 +674,198 @@ public static function cancelTestDataProvider(): iterable yield 'success1' => [ 'responseData' => [ 'VPosMessage' => [ - 'HashData' => 'I7H/6nwfydM6VcwXsl82mqeC83o=', + 'HashData' => 'EnbSVvhgUybfVzyB6yFMXyQVN2k=', 'MerchantId' => '1', 'SubMerchantId' => '0', - 'CustomerId' => '11111', - 'UserName' => 'APIUSER', - 'CustomerIPAddress' => '', - 'BatchId' => '', - 'MerchantOrderId' => '2023070849CD', + 'CustomerId' => '222222', + 'UserName' => 'apiuser', + 'ReferenceNumber' => 'WlgDy240701135444698', + 'Rank' => '1', + 'HashPassword' => 'DoxoW84N1hKFdV09SF4/FruhHm8=', + 'CommonPaymentPageAllowed' => [ + '@xsi:nil' => 'true', + '#' => '', + ], + 'MerchantOrderIdUniqueControl' => [ + '@xsi:nil' => 'true', + '#' => '', + ], + 'OrderId' => '6373447', + 'BatchId' => '0', + 'ManuelBatch' => 'false', + 'MerchantOrderId' => '20240701BF8D', 'InstallmentCount' => '0', - 'Amount' => '100', - 'DisplayAmount' => '100', - 'FECAmount' => '', - 'FECCurrencyCode' => '0949', - 'Addresses' => [ - 'VPosAddressContract' => [ - 'Type' => '', - 'Name' => '', - 'PhoneNumber' => '', - 'OrderId' => '', - 'AddressId' => '', - 'Email' => '', - ], + 'Amount' => '1001', + 'FECAmount' => '0', + 'TransactionSecurity' => '0', + 'Products' => '', + 'Addresses' => '', + 'InstallmentMaturityCommisionFlag' => '0', + 'StartDate' => [ + '@xsi:nil' => 'true', + '#' => '', + ], + 'EndDate' => [ + '@xsi:nil' => 'true', + '#' => '', + ], + 'UpperLimit' => [ + '@xsi:nil' => 'true', + '#' => '', + ], + 'LowerLimit' => [ + '@xsi:nil' => 'true', + '#' => '', + ], + 'RegisteredCardTransaction' => '0', + 'PaymentType' => '1', + 'QueryId' => '0', + 'DebtId' => '0', + 'SurchargeAmount' => '0', + 'SGKDebtAmount' => '0', + 'VPSEntryMode' => 'None', + 'OrderPOSTransactionId' => [ + '@xsi:nil' => 'true', + '#' => '', + ], + 'TranDate' => [ + '@xsi:nil' => 'true', + '#' => '', + ], + 'EntryGateMethod' => 'VPOS_SaleReversal', + 'CardHolderCustomerId' => [ + '@xsi:nil' => 'true', + '#' => '', + ], + 'PaymentId' => [ + '@xsi:nil' => 'true', + '#' => '', ], - 'APIVersion' => '1.0.0', - 'PaymentType' => '', - 'SurchargeAmount' => '', - 'SGKDebtAmount' => '', - 'InstallmentMaturityCommisionFlag' => '', - 'TransactionSecurity' => '', ], - 'RRN' => '904115005554', - 'Stan' => '005554', - 'IsEnrolled' => 'false', + 'IsEnrolled' => 'true', 'IsVirtual' => 'false', + 'ProvisionNumber' => '593347', + 'RRN' => '418313115082', + 'Stan' => '435239', 'ResponseCode' => '00', - 'ResponseMessage' => 'OTORİZASYON VERİLDİ', - 'OrderId' => '114293600', - 'TransactionTime' => '2023-07-08T23:45:15.797', - 'BusinessKey' => '202208456498416947', + 'ResponseMessage' => 'İşlem onaylandı', + 'OrderId' => '6373447', + 'TransactionTime' => '2024-07-01T13:54:45.1721751', + 'MerchantOrderId' => '20240701BF8D', + 'BusinessKey' => '0', '@xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance', '@xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema', ], 'expectedData' => [ - 'order_id' => '2023070849CD', + 'order_id' => '20240701BF8D', 'auth_code' => null, 'proc_return_code' => '00', - 'transaction_id' => '005554', - 'currency' => PosInterface::CURRENCY_TRY, + 'transaction_id' => '435239', + 'currency' => null, 'error_message' => null, - 'ref_ret_num' => '904115005554', + 'ref_ret_num' => '418313115082', 'status' => 'approved', 'error_code' => null, 'status_detail' => null, - 'remote_order_id' => '114293600', + 'remote_order_id' => '6373447', + ], + ]; + + yield 'fail_order_not_found' => [ + 'responseData' => [ + 'VPosMessage' => [ + 'HashData' => 'w76+5POZzNsMGHVk93rvuhJW3JA=', + 'MerchantId' => '1', + 'SubMerchantId' => '0', + 'CustomerId' => '222222', + 'UserName' => 'apiuser', + 'ReferenceNumber' => 'MZGm2240701131546732', + 'Rank' => '1', + 'HashPassword' => 'DoxoW84N1hKFdV09SF4/FruhHm8=', + 'CommonPaymentPageAllowed' => [ + '@xsi:nil' => 'true', + '#' => '', + ], + 'MerchantOrderIdUniqueControl' => [ + '@xsi:nil' => 'true', + '#' => '', + ], + 'OrderId' => '1243', + 'BatchId' => '0', + 'ManuelBatch' => 'false', + 'MerchantOrderId' => '124', + 'InstallmentCount' => '0', + 'Amount' => '1000', + 'FECAmount' => '0', + 'TransactionSecurity' => '0', + 'Products' => '', + 'Addresses' => '', + 'InstallmentMaturityCommisionFlag' => '0', + 'StartDate' => [ + '@xsi:nil' => 'true', + '#' => '', + ], + 'EndDate' => [ + '@xsi:nil' => 'true', + '#' => '', + ], + 'UpperLimit' => [ + '@xsi:nil' => 'true', + '#' => '', + ], + 'LowerLimit' => [ + '@xsi:nil' => 'true', + '#' => '', + ], + 'RegisteredCardTransaction' => '0', + 'PaymentType' => '1', + 'QueryId' => '0', + 'DebtId' => '0', + 'SurchargeAmount' => '0', + 'SGKDebtAmount' => '0', + 'VPSEntryMode' => 'None', + 'OrderPOSTransactionId' => [ + '@xsi:nil' => 'true', + '#' => '', + ], + 'TranDate' => [ + '@xsi:nil' => 'true', + '#' => '', + ], + 'EntryGateMethod' => 'VPOS_SaleReversal', + 'CardHolderCustomerId' => [ + '@xsi:nil' => 'true', + '#' => '', + ], + 'PaymentId' => [ + '@xsi:nil' => 'true', + '#' => '', + ], + ], + 'IsEnrolled' => 'true', + 'IsVirtual' => 'false', + 'ResponseCode' => 'OrderDataNotFound', + 'ResponseMessage' => 'islem bilgisi bulunamadi.', + 'OrderId' => '0', + 'TransactionTime' => '2024-07-01T13:15:47.2754872+03:00', + 'MerchantOrderId' => '124', + 'HashData' => 'i8SYtpK1WT9uQ532aQwPxaEmaJE=', + 'BusinessKey' => '0', + '@xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance', + '@xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema', + ], + 'expectedData' => [ + 'order_id' => '124', + 'auth_code' => null, + 'proc_return_code' => 'OrderDataNotFound', + 'transaction_id' => null, + 'currency' => null, + 'error_message' => 'islem bilgisi bulunamadi.', + 'ref_ret_num' => null, + 'status' => 'declined', + 'error_code' => 'OrderDataNotFound', + 'status_detail' => null, + 'remote_order_id' => '0', ], ]; } @@ -787,7 +925,7 @@ public static function refundTestDataProvider(): iterable 'auth_code' => null, 'proc_return_code' => '00', 'transaction_id' => '005554', - 'currency' => PosInterface::CURRENCY_TRY, + 'currency' => null, 'error_message' => null, 'ref_ret_num' => '904115005554', 'status' => 'approved', @@ -796,6 +934,102 @@ public static function refundTestDataProvider(): iterable 'remote_order_id' => '114293600', ], ]; + + yield 'fail_order_not_found' => [ + 'responseData' => [ + 'VPosMessage' => [ + 'HashData' => 'cmW+Trusz5j7wCdExdDaFyPtzx0=', + 'MerchantId' => '1', + 'SubMerchantId' => '0', + 'CustomerId' => '222222', + 'UserName' => 'apiuser', + 'ReferenceNumber' => '74g81240701132558594', + 'Rank' => '1', + 'HashPassword' => 'DoxoW84N1hKFdV09SF4/FruhHm8=', + 'CommonPaymentPageAllowed' => [ + '@xsi:nil' => 'true', + '#' => '', + ], + 'MerchantOrderIdUniqueControl' => [ + '@xsi:nil' => 'true', + '#' => '', + ], + 'OrderId' => '1243', + 'BatchId' => '0', + 'ManuelBatch' => 'false', + 'MerchantOrderId' => '124', + 'InstallmentCount' => '0', + 'Amount' => '0', + 'FECAmount' => '0', + 'TransactionSecurity' => '0', + 'Products' => '', + 'Addresses' => '', + 'InstallmentMaturityCommisionFlag' => '0', + 'StartDate' => [ + '@xsi:nil' => 'true', + '#' => '', + ], + 'EndDate' => [ + '@xsi:nil' => 'true', + '#' => '', + ], + 'UpperLimit' => [ + '@xsi:nil' => 'true', + '#' => '', + ], + 'LowerLimit' => [ + '@xsi:nil' => 'true', + '#' => '', + ], + 'RegisteredCardTransaction' => '0', + 'QueryId' => '0', + 'DebtId' => '0', + 'SurchargeAmount' => '0', + 'SGKDebtAmount' => '0', + 'VPSEntryMode' => 'None', + 'OrderPOSTransactionId' => [ + '@xsi:nil' => 'true', + '#' => '', + ], + 'TranDate' => [ + '@xsi:nil' => 'true', + '#' => '', + ], + 'EntryGateMethod' => 'VPOS_Drawback', + 'CardHolderCustomerId' => [ + '@xsi:nil' => 'true', + '#' => '', + ], + 'PaymentId' => [ + '@xsi:nil' => 'true', + '#' => '', + ], + ], + 'IsEnrolled' => 'true', + 'IsVirtual' => 'false', + 'ResponseCode' => 'OrderDataNotFound', + 'ResponseMessage' => 'islem bilgisi bulunamadi.', + 'OrderId' => '0', + 'TransactionTime' => '2024-07-01T13:25:58.9066328+03:00', + 'MerchantOrderId' => '124', + 'BusinessKey' => '0', + '@xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance', + '@xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema', + ], + 'expectedData' => [ + 'order_id' => '124', + 'auth_code' => null, + 'proc_return_code' => 'OrderDataNotFound', + 'transaction_id' => null, + 'currency' => null, + 'error_message' => 'islem bilgisi bulunamadi.', + 'ref_ret_num' => null, + 'status' => 'declined', + 'error_code' => 'OrderDataNotFound', + 'status_detail' => null, + 'remote_order_id' => '0', + ], + ]; } public static function historyTestDataProvider(): array From 5309dfdaf4d1e62b45ffa453dc02623dad85bdb3 Mon Sep 17 00:00:00 2001 From: Nuryagdy Mustapayev Date: Mon, 1 Jul 2024 16:03:34 +0200 Subject: [PATCH 4/6] vakifkatilim-pos - fix history sorting and add more test data --- .../VakifKatilimPosResponseDataMapper.php | 19 +- .../VakifKatilimPosResponseDataMapperTest.php | 346 +++-- .../history/success_history.json | 1188 +++++++++++++++++ 3 files changed, 1460 insertions(+), 93 deletions(-) create mode 100644 tests/Unit/test_data/vakifkatilimpos/history/success_history.json diff --git a/src/DataMapper/ResponseDataMapper/VakifKatilimPosResponseDataMapper.php b/src/DataMapper/ResponseDataMapper/VakifKatilimPosResponseDataMapper.php index 8d1fffb3..3eedcea9 100644 --- a/src/DataMapper/ResponseDataMapper/VakifKatilimPosResponseDataMapper.php +++ b/src/DataMapper/ResponseDataMapper/VakifKatilimPosResponseDataMapper.php @@ -314,8 +314,6 @@ public function mapOrderHistoryResponse(array $rawResponseData): array } } - $mappedTransactions = \array_reverse($mappedTransactions); - $result = [ 'proc_return_code' => $procReturnCode, 'order_id' => $orderId, @@ -493,12 +491,21 @@ private function mapSingleOrderHistoryTransaction(array $rawTx): array $defaultResponse['installment_count'] = $this->mapInstallment($rawTx['InstallmentCount']); $defaultResponse['masked_number'] = $rawTx['CardNumber']; $defaultResponse['first_amount'] = (float) $rawTx['FirstAmount']; - $defaultResponse['capture_amount'] = isset($rawTx['TranAmount']) ? (float) $rawTx['TranAmount'] : 0; - $defaultResponse['capture'] = $defaultResponse['first_amount'] === $defaultResponse['capture_amount']; $defaultResponse['order_status'] = $rawTx['LastOrderStatusDescription']; - if ($defaultResponse['capture']) { - $defaultResponse['capture_time'] = $defaultResponse['transaction_time']; + /** + * OrderStatus + * 1 => Satis + * 6 => Iptal + */ + if ('1' === $rawTx['OrderStatus']) { + $defaultResponse['capture_amount'] = isset($rawTx['TranAmount']) ? (float) $rawTx['TranAmount'] : 0; + $defaultResponse['capture'] = $defaultResponse['first_amount'] === $defaultResponse['capture_amount']; + if ($defaultResponse['capture']) { + $defaultResponse['capture_time'] = $defaultResponse['transaction_time']; + } + } elseif ('6' === $rawTx['OrderStatus']) { + $defaultResponse['cancel_time'] = $defaultResponse['transaction_time']; } } diff --git a/tests/Unit/DataMapper/ResponseDataMapper/VakifKatilimPosResponseDataMapperTest.php b/tests/Unit/DataMapper/ResponseDataMapper/VakifKatilimPosResponseDataMapperTest.php index 5aab8361..d8a2a945 100644 --- a/tests/Unit/DataMapper/ResponseDataMapper/VakifKatilimPosResponseDataMapperTest.php +++ b/tests/Unit/DataMapper/ResponseDataMapper/VakifKatilimPosResponseDataMapperTest.php @@ -213,6 +213,26 @@ public function testMapHistoryResponse(array $responseData, array $expectedData) $this->assertSame($expectedData, $actualData); } + public function testMapHistoryResponseWithALotOfTxs(): void + { + $responseData = file_get_contents(__DIR__.'/../../test_data/vakifkatilimpos/history/success_history.json'); + + $actualData = $this->responseDataMapper->mapHistoryResponse(json_decode($responseData, true)); + + $this->assertCount(31, $actualData['transactions']); + + if (count($actualData['transactions']) > 1 + && null !== $actualData['transactions'][0]['transaction_time'] + && null !== $actualData['transactions'][1]['transaction_time'] + ) { + $this->assertGreaterThan( + $actualData['transactions'][0]['transaction_time'], + $actualData['transactions'][1]['transaction_time'], + ); + } + } + + /** * @dataProvider orderHistoryTestDataProvider */ @@ -235,6 +255,7 @@ public function testMapOrderHistoryResponse(array $responseData, array $expected foreach (array_keys($actualData['transactions']) as $key) { $this->assertEquals($expectedData['transactions'][$key]['transaction_time'], $actualData['transactions'][$key]['transaction_time'], 'tx: '.$key); $this->assertEquals($expectedData['transactions'][$key]['capture_time'], $actualData['transactions'][$key]['capture_time'], 'tx: '.$key); + unset($actualData['transactions'][$key]['cancel_time'], $expectedData['transactions'][$key]['cancel_time']); unset($actualData['transactions'][$key]['transaction_time'], $expectedData['transactions'][$key]['transaction_time']); unset($actualData['transactions'][$key]['capture_time'], $expectedData['transactions'][$key]['capture_time']); \ksort($actualData['transactions'][$key]); @@ -594,6 +615,41 @@ public static function statusTestDataProvider(): iterable ], ]; + yield 'fail_order_not_found' => [ + 'responseData' => [ + 'VPosOrderData' => '', + 'ResponseCode' => 'NonResult', + 'ResponseMessage' => 'Kriterlere uygun sonuc bulunmamaktadir.', + 'MerchantOrderId' => '124', + '@xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance', + '@xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema', + ], + 'expectedData' => [ + 'auth_code' => null, + 'capture' => null, + 'capture_amount' => null, + 'currency' => null, + 'error_code' => 'NonResult', + 'error_message' => 'Kriterlere uygun sonuc bulunmamaktadir.', + 'first_amount' => null, + 'installment_count' => null, + 'masked_number' => null, + 'order_id' => '124', + 'order_status' => null, + 'proc_return_code' => 'NonResult', + 'ref_ret_num' => null, + 'refund_amount' => null, + 'status' => 'declined', + 'status_detail' => null, + 'transaction_id' => null, + 'transaction_type' => null, + 'transaction_time' => null, + 'capture_time' => null, + 'refund_time' => null, + 'cancel_time' => null, + ], + ]; + yield 'success1' => [ 'responseData' => [ 'VPosOrderData' => [ @@ -667,6 +723,81 @@ public static function statusTestDataProvider(): iterable 'cancel_time' => null, ], ]; + yield 'success_canceled_order' => [ + 'responseData' => [ + 'VPosOrderData' => [ + 'OrderContract' => [ + 'OrderId' => '6373591', + 'MerchantOrderId' => '20240701CF44', + 'MerchantId' => '1', + 'PosTerminalId' => '111111', + 'OrderStatus' => '1', + 'OrderStatusDescription' => 'Satis', + 'OrderType' => '1', + 'OrderTypeDescription' => 'Pesin', + 'TransactionStatus' => '1', + 'TransactionStatusDescription' => 'Basarili', + 'LastOrderStatus' => '6', + 'LastOrderStatusDescription' => 'Iptal', + 'EndOfDayStatus' => '1', + 'EndOfDayStatusDescription' => 'Acik', + 'FEC' => '0949', + 'FecDescription' => 'TRY', + 'TransactionSecurity' => '3', + 'TransactionSecurityDescription' => '3d islem', + 'CardHolderName' => 'john doe', + 'CardType' => 'MasterCard', + 'CardNumber' => '5188********2666', + 'OrderDate' => '2024-07-01T15:03:06.963', + 'FirstAmount' => '10.01', + 'TranAmount' => '0', + 'FECAmount' => '0.00', + 'CancelAmount' => '10.01', + 'DrawbackAmount' => '0.00', + 'ClosedAmount' => '0.00', + 'InstallmentCount' => '0', + 'ResponseCode' => '00', + 'ResponseExplain' => 'İşlem onaylandı', + 'ProvNumber' => '668468', + 'RRN' => '418315149569', + 'Stan' => '435384', + 'MerchantUserName' => 'apiuser', + 'BatchId' => '1', + ], + ], + 'ResponseCode' => '00', + 'ResponseMessage' => '', + 'MerchantOrderId' => '20240701CF44', + '@xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance', + '@xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema', + ], + 'expectedData' => [ + 'auth_code' => '668468', + 'capture' => false, + 'capture_amount' => 0.0, + 'currency' => 'TRY', + 'error_code' => null, + 'error_message' => null, + 'first_amount' => 10.01, + 'installment_count' => 0, + 'masked_number' => '5188********2666', + 'order_id' => '20240701CF44', + 'order_status' => 'Iptal', + 'payment_model' => '3d', + 'proc_return_code' => '00', + 'ref_ret_num' => '418315149569', + 'refund_amount' => null, + 'remote_order_id' => '6373591', + 'status' => 'approved', + 'status_detail' => 'approved', + 'transaction_id' => '435384', + 'transaction_type' => null, + 'transaction_time' => new \DateTimeImmutable('2024-07-01T15:03:06.963'), + 'capture_time' => null, + 'refund_time' => null, + 'cancel_time' => null, + ], + ]; } public static function cancelTestDataProvider(): iterable @@ -1035,7 +1166,7 @@ public static function refundTestDataProvider(): iterable public static function historyTestDataProvider(): array { return [ - [ + 'test1' => [ 'input' => [ 'VPosOrderData' => [ 'OrderContract' => [ @@ -1177,13 +1308,31 @@ public static function historyTestDataProvider(): array ], ], ], + 'fail_order_not_found' => [ + 'input' => [ + 'VPosOrderData' => '', + 'ResponseCode' => 'NonResult', + 'ResponseMessage' => 'Kriterlere uygun sonuc bulunmamaktadir.', + '@xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance', + '@xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema', + ], + 'expected' => [ + 'proc_return_code' => 'NonResult', + 'error_code' => 'NonResult', + 'error_message' => 'Kriterlere uygun sonuc bulunmamaktadir.', + 'status' => 'declined', + 'status_detail' => 'NonResult', + 'trans_count' => 0, + 'transactions' => [], + ], + ], ]; } public static function orderHistoryTestDataProvider(): array { return [ - 'fail1' => [ + 'fail1' => [ 'input' => [ 'VPosOrderData' => '', 'ResponseCode' => 'MerchantNotDefined', @@ -1203,84 +1352,105 @@ public static function orderHistoryTestDataProvider(): array 'transactions' => [], ], ], - 'success1' => [ + 'order_not_found' => [ + 'input' => [ + 'VPosOrderData' => '', + 'ResponseCode' => 'NonResult', + 'ResponseMessage' => 'Kriterlere uygun sonuc bulunmamaktadir.', + '@xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance', + '@xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema', + ], + 'expected' => [ + 'proc_return_code' => 'NonResult', + 'order_id' => null, + 'remote_order_id' => null, + 'error_code' => 'NonResult', + 'error_message' => 'Kriterlere uygun sonuc bulunmamaktadir.', + 'status' => 'declined', + 'status_detail' => 'NonResult', + 'trans_count' => 0, + 'transactions' => [], + ], + ], + 'success_pay_then_cancel' => [ 'input' => [ 'VPosOrderData' => [ 'OrderContract' => [ [ - 'OrderId' => '12754', - 'MerchantOrderId' => '709834990', + 'OrderId' => '6373641', + 'MerchantOrderId' => '202407019FDB', 'MerchantId' => '1', 'PosTerminalId' => '111111', 'OrderStatus' => '1', 'OrderStatusDescription' => 'Satis', - 'OrderType' => '1', - 'OrderTypeDescription' => 'Pesin', - 'TransactionStatus' => '2', - 'TransactionStatusDescription' => 'Basarisiz', - 'LastOrderStatus' => '1', - 'LastOrderStatusDescription' => 'Satis', + 'OrderType' => '2', + 'OrderTypeDescription' => 'Taksitli', + 'TransactionStatus' => '1', + 'TransactionStatusDescription' => 'Basarili', + 'LastOrderStatus' => '6', + 'LastOrderStatusDescription' => 'Iptal', 'EndOfDayStatus' => '1', 'EndOfDayStatusDescription' => 'Acik', 'FEC' => '0949', 'FecDescription' => 'TRY', - 'TransactionSecurity' => '5', - 'TransactionSecurityDescription' => '', - 'CardHolderName' => 'Hasan Karacan', + 'TransactionSecurity' => '3', + 'TransactionSecurityDescription' => '3d islem', + 'CardHolderName' => 'john doe', 'CardType' => 'MasterCard', - 'CardNumber' => '5353********3233', - 'OrderDate' => '2020-12-25T12:13:35.74', - 'TranAmount' => '3.90', - 'FirstAmount' => '3.90', + 'CardNumber' => '5351********9885', + 'OrderDate' => '2024-07-01T15:21:28.123', + 'FirstAmount' => '10.01', + 'TranAmount' => '10.01', 'FECAmount' => '0.00', - 'CancelAmount' => '0.00', + 'CancelAmount' => '10.01', 'DrawbackAmount' => '0.00', 'ClosedAmount' => '0.00', - 'InstallmentCount' => '0', - 'ResponseCode' => '05', - 'ResponseExplain' => 'Hata Kodu5', - 'ProvNumber' => '', - 'RRN' => '03611114146', - 'Stan' => '012246', - 'MerchantUserName' => 'USERNAME', - 'BatchId' => '73', + 'InstallmentCount' => '2', + 'ResponseCode' => '00', + 'ResponseExplain' => 'İşlem onaylandı', + 'ProvNumber' => '520366', + 'RRN' => '418315158962', + 'Stan' => '435438', + 'MerchantUserName' => 'apiuser', + 'BatchId' => '1', ], [ - 'OrderId' => '12754', - 'MerchantOrderId' => '709834990', + 'OrderId' => '6373641', + 'MerchantOrderId' => '202407019FDB', 'MerchantId' => '1', 'PosTerminalId' => '111111', - 'OrderStatus' => '1', - 'OrderStatusDescription' => 'Satis', - 'OrderType' => '1', - 'OrderTypeDescription' => 'Pesin', + 'OrderStatus' => '6', + 'OrderStatusDescription' => 'Iptal', + 'OrderType' => '2', + 'OrderTypeDescription' => 'Taksitli', 'TransactionStatus' => '1', 'TransactionStatusDescription' => 'Basarili', - 'LastOrderStatus' => '1', - 'LastOrderStatusDescription' => 'Satis', - 'EndOfDayStatus' => '2', - 'EndOfDayStatusDescription' => 'Kapali', + 'LastOrderStatus' => '6', + 'LastOrderStatusDescription' => 'Iptal', + 'EndOfDayStatus' => '1', + 'EndOfDayStatusDescription' => 'Acik', 'FEC' => '0949', 'FecDescription' => 'TRY', - 'TransactionSecurity' => '5', - 'TransactionSecurityDescription' => '', - 'CardHolderName' => 'Hasan Karacan', + 'TransactionSecurity' => '3', + 'TransactionSecurityDescription' => '3d islem', + 'CardHolderName' => 'john doe', 'CardType' => 'MasterCard', - 'CardNumber' => '5353********8906', - 'OrderDate' => '2020-12-25T08:41:40.947', - 'FirstAmount' => '2.70', + 'CardNumber' => '5351********9885', + 'OrderDate' => '2024-07-01T15:22:24.463', + 'FirstAmount' => '10.01', + 'TranAmount' => '10.01', 'FECAmount' => '0.00', - 'CancelAmount' => '0.00', + 'CancelAmount' => '10.01', 'DrawbackAmount' => '0.00', 'ClosedAmount' => '0.00', - 'InstallmentCount' => '0', + 'InstallmentCount' => '2', 'ResponseCode' => '00', - 'ResponseExplain' => 'Provizyon alındı.', - 'ProvNumber' => '831168', - 'RRN' => '036008014143', - 'Stan' => '014143', - 'MerchantUserName' => 'USERNAME', - 'BatchId' => '72', + 'ResponseExplain' => 'İşlem onaylandı', + 'ProvNumber' => '520366', + 'RRN' => '418315158962', + 'Stan' => '435440', + 'MerchantUserName' => 'apiuser', + 'BatchId' => '1', ], ], ], @@ -1291,8 +1461,8 @@ public static function orderHistoryTestDataProvider(): array ], 'expected' => [ 'proc_return_code' => '00', - 'order_id' => '709834990', - 'remote_order_id' => '12754', + 'order_id' => '202407019FDB', + 'remote_order_id' => '6373641', 'error_code' => null, 'error_message' => null, 'status' => 'approved', @@ -1300,45 +1470,47 @@ public static function orderHistoryTestDataProvider(): array 'trans_count' => 2, 'transactions' => [ [ - 'auth_code' => '831168', - 'proc_return_code' => '00', - 'transaction_id' => '014143', - 'transaction_time' => new \DateTimeImmutable('2020-12-25T08:41:40.947'), - 'capture_time' => null, + 'auth_code' => '520366', + 'capture' => true, + 'capture_amount' => 10.01, + 'currency' => 'TRY', + 'error_code' => null, 'error_message' => null, - 'ref_ret_num' => '036008014143', - 'order_status' => 'Satis', - 'transaction_type' => null, - 'first_amount' => 2.7, - 'capture_amount' => 0, + 'first_amount' => 10.01, + 'installment_count' => 2, + 'masked_number' => '5351********9885', + 'order_status' => 'Iptal', + 'payment_model' => '3d', + 'proc_return_code' => '00', + 'ref_ret_num' => '418315158962', 'status' => 'approved', - 'error_code' => null, 'status_detail' => 'approved', - 'capture' => false, - 'currency' => 'TRY', - 'masked_number' => '5353********8906', - 'payment_model' => 'regular', - 'installment_count' => 0, + 'transaction_id' => '435438', + 'transaction_type' => null, + 'transaction_time' => new \DateTimeImmutable('2024-07-01T15:21:28.123'), + 'capture_time' => new \DateTimeImmutable('2024-07-01T15:21:28.123'), ], [ - 'auth_code' => null, - 'proc_return_code' => '05', - 'transaction_id' => '012246', - 'transaction_time' => new \DateTimeImmutable('2020-12-25T12:13:35.74'), - 'capture_time' => null, - 'error_message' => 'Hata Kodu5', - 'ref_ret_num' => '03611114146', - 'order_status' => null, - 'transaction_type' => null, - 'first_amount' => null, - 'capture_amount' => null, - 'status' => 'declined', - 'error_code' => '05', - 'status_detail' => '05', - 'capture' => null, - 'currency' => 'TRY', - 'masked_number' => null, - 'payment_model' => 'regular', + 'auth_code' => '520366', + 'capture' => null, + 'capture_amount' => null, + 'currency' => 'TRY', + 'error_code' => null, + 'error_message' => null, + 'first_amount' => 10.01, + 'installment_count' => 2, + 'masked_number' => '5351********9885', + 'order_status' => 'Iptal', + 'payment_model' => '3d', + 'proc_return_code' => '00', + 'ref_ret_num' => '418315158962', + 'status' => 'approved', + 'status_detail' => 'approved', + 'transaction_id' => '435440', + 'transaction_type' => null, + 'transaction_time' => new \DateTimeImmutable('2024-07-01T15:22:24.463'), + 'cancel_time' => new \DateTimeImmutable('2024-07-01T15:22:24.463'), + 'capture_time' => null, ], ], ], diff --git a/tests/Unit/test_data/vakifkatilimpos/history/success_history.json b/tests/Unit/test_data/vakifkatilimpos/history/success_history.json new file mode 100644 index 00000000..ec669f34 --- /dev/null +++ b/tests/Unit/test_data/vakifkatilimpos/history/success_history.json @@ -0,0 +1,1188 @@ +{ + "VPosOrderData": { + "OrderContract": [ + { + "OrderId": "6373641", + "MerchantOrderId": "202407019FDB", + "MerchantId": "1", + "PosTerminalId": "111111", + "OrderStatus": "1", + "OrderStatusDescription": "Satis", + "OrderType": "2", + "OrderTypeDescription": "Taksitli", + "TransactionStatus": "1", + "TransactionStatusDescription": "Basarili", + "LastOrderStatus": "6", + "LastOrderStatusDescription": "Iptal", + "EndOfDayStatus": "1", + "EndOfDayStatusDescription": "Acik", + "FEC": "0949", + "FecDescription": "TRY", + "TransactionSecurity": "3", + "TransactionSecurityDescription": "3d islem", + "CardHolderName": "john doe", + "CardType": "MasterCard", + "CardNumber": "5351********9885", + "OrderDate": "2024-07-01T15:21:28.123", + "FirstAmount": "10.01", + "TranAmount": "10.01", + "FECAmount": "0.00", + "CancelAmount": "10.01", + "DrawbackAmount": "0.00", + "ClosedAmount": "0.00", + "InstallmentCount": "2", + "ResponseCode": "00", + "ResponseExplain": "İşlem onaylandı", + "ProvNumber": "520366", + "RRN": "418315158962", + "Stan": "435438", + "MerchantUserName": "apiuser", + "BatchId": "1" + }, + { + "OrderId": "6373641", + "MerchantOrderId": "202407019FDB", + "MerchantId": "1", + "PosTerminalId": "111111", + "OrderStatus": "6", + "OrderStatusDescription": "Iptal", + "OrderType": "2", + "OrderTypeDescription": "Taksitli", + "TransactionStatus": "1", + "TransactionStatusDescription": "Basarili", + "LastOrderStatus": "6", + "LastOrderStatusDescription": "Iptal", + "EndOfDayStatus": "1", + "EndOfDayStatusDescription": "Acik", + "FEC": "0949", + "FecDescription": "TRY", + "TransactionSecurity": "3", + "TransactionSecurityDescription": "3d islem", + "CardHolderName": "john doe", + "CardType": "MasterCard", + "CardNumber": "5351********9885", + "OrderDate": "2024-07-01T15:22:24.463", + "FirstAmount": "10.01", + "TranAmount": "10.01", + "FECAmount": "0.00", + "CancelAmount": "10.01", + "DrawbackAmount": "0.00", + "ClosedAmount": "0.00", + "InstallmentCount": "2", + "ResponseCode": "00", + "ResponseExplain": "İşlem onaylandı", + "ProvNumber": "520366", + "RRN": "418315158962", + "Stan": "435440", + "MerchantUserName": "apiuser", + "BatchId": "1" + }, + { + "OrderId": "6373591", + "MerchantOrderId": "20240701CF44", + "MerchantId": "1", + "PosTerminalId": "111111", + "OrderStatus": "1", + "OrderStatusDescription": "Satis", + "OrderType": "1", + "OrderTypeDescription": "Pesin", + "TransactionStatus": "1", + "TransactionStatusDescription": "Basarili", + "LastOrderStatus": "6", + "LastOrderStatusDescription": "Iptal", + "EndOfDayStatus": "1", + "EndOfDayStatusDescription": "Acik", + "FEC": "0949", + "FecDescription": "TRY", + "TransactionSecurity": "3", + "TransactionSecurityDescription": "3d islem", + "CardHolderName": "john doe", + "CardType": "MasterCard", + "CardNumber": "5188********2666", + "OrderDate": "2024-07-01T15:03:32.4", + "FirstAmount": "10.01", + "TranAmount": "10.01", + "FECAmount": "0.00", + "CancelAmount": "10.01", + "DrawbackAmount": "0.00", + "ClosedAmount": "0.00", + "InstallmentCount": "0", + "ResponseCode": "00", + "ResponseExplain": "İşlem onaylandı", + "ProvNumber": "668468", + "RRN": "418315149569", + "Stan": "435384", + "MerchantUserName": "apiuser", + "BatchId": "1" + }, + { + "OrderId": "6373591", + "MerchantOrderId": "20240701CF44", + "MerchantId": "1", + "PosTerminalId": "111111", + "OrderStatus": "6", + "OrderStatusDescription": "Iptal", + "OrderType": "1", + "OrderTypeDescription": "Pesin", + "TransactionStatus": "1", + "TransactionStatusDescription": "Basarili", + "LastOrderStatus": "6", + "LastOrderStatusDescription": "Iptal", + "EndOfDayStatus": "1", + "EndOfDayStatusDescription": "Acik", + "FEC": "0949", + "FecDescription": "TRY", + "TransactionSecurity": "3", + "TransactionSecurityDescription": "3d islem", + "CardHolderName": "john doe", + "CardType": "MasterCard", + "CardNumber": "5188********2666", + "OrderDate": "2024-07-01T15:03:46.62", + "FirstAmount": "10.01", + "TranAmount": "10.01", + "FECAmount": "0.00", + "CancelAmount": "10.01", + "DrawbackAmount": "0.00", + "ClosedAmount": "0.00", + "InstallmentCount": "0", + "ResponseCode": "00", + "ResponseExplain": "İşlem onaylandı", + "ProvNumber": "668468", + "RRN": "418315149569", + "Stan": "435386", + "MerchantUserName": "apiuser", + "BatchId": "1" + }, + { + "OrderId": "6373591", + "MerchantOrderId": "20240701CF44", + "MerchantId": "1", + "PosTerminalId": "111111", + "OrderStatus": "6", + "OrderStatusDescription": "Iptal", + "OrderType": "1", + "OrderTypeDescription": "Pesin", + "TransactionStatus": "1", + "TransactionStatusDescription": "Basarili", + "LastOrderStatus": "6", + "LastOrderStatusDescription": "Iptal", + "EndOfDayStatus": "1", + "EndOfDayStatusDescription": "Acik", + "FEC": "0949", + "FecDescription": "TRY", + "TransactionSecurity": "3", + "TransactionSecurityDescription": "3d islem", + "CardHolderName": "john doe", + "CardType": "MasterCard", + "CardNumber": "5188********2666", + "OrderDate": "2024-07-01T15:03:58.357", + "FirstAmount": "10.01", + "TranAmount": "10.01", + "FECAmount": "0.00", + "CancelAmount": "10.01", + "DrawbackAmount": "0.00", + "ClosedAmount": "0.00", + "InstallmentCount": "0", + "ResponseCode": "00", + "ResponseExplain": "İşlem onaylandı", + "ProvNumber": "668468", + "RRN": "418315149569", + "Stan": "435388", + "MerchantUserName": "apiuser", + "BatchId": "1" + }, + { + "OrderId": "6373591", + "MerchantOrderId": "20240701CF44", + "MerchantId": "1", + "PosTerminalId": "111111", + "OrderStatus": "6", + "OrderStatusDescription": "Iptal", + "OrderType": "1", + "OrderTypeDescription": "Pesin", + "TransactionStatus": "1", + "TransactionStatusDescription": "Basarili", + "LastOrderStatus": "6", + "LastOrderStatusDescription": "Iptal", + "EndOfDayStatus": "1", + "EndOfDayStatusDescription": "Acik", + "FEC": "0949", + "FecDescription": "TRY", + "TransactionSecurity": "3", + "TransactionSecurityDescription": "3d islem", + "CardHolderName": "john doe", + "CardType": "MasterCard", + "CardNumber": "5188********2666", + "OrderDate": "2024-07-01T15:04:05.17", + "FirstAmount": "10.01", + "TranAmount": "10.01", + "FECAmount": "0.00", + "CancelAmount": "10.01", + "DrawbackAmount": "0.00", + "ClosedAmount": "0.00", + "InstallmentCount": "0", + "ResponseCode": "00", + "ResponseExplain": "İşlem onaylandı", + "ProvNumber": "668468", + "RRN": "418315149569", + "Stan": "435389", + "MerchantUserName": "apiuser", + "BatchId": "1" + }, + { + "OrderId": "6373591", + "MerchantOrderId": "20240701CF44", + "MerchantId": "1", + "PosTerminalId": "111111", + "OrderStatus": "6", + "OrderStatusDescription": "Iptal", + "OrderType": "1", + "OrderTypeDescription": "Pesin", + "TransactionStatus": "1", + "TransactionStatusDescription": "Basarili", + "LastOrderStatus": "6", + "LastOrderStatusDescription": "Iptal", + "EndOfDayStatus": "1", + "EndOfDayStatusDescription": "Acik", + "FEC": "0949", + "FecDescription": "TRY", + "TransactionSecurity": "3", + "TransactionSecurityDescription": "3d islem", + "CardHolderName": "john doe", + "CardType": "MasterCard", + "CardNumber": "5188********2666", + "OrderDate": "2024-07-01T15:04:23.253", + "FirstAmount": "10.01", + "TranAmount": "10.01", + "FECAmount": "0.00", + "CancelAmount": "10.01", + "DrawbackAmount": "0.00", + "ClosedAmount": "0.00", + "InstallmentCount": "0", + "ResponseCode": "00", + "ResponseExplain": "İşlem onaylandı", + "ProvNumber": "668468", + "RRN": "418315149569", + "Stan": "435390", + "MerchantUserName": "apiuser", + "BatchId": "1" + }, + { + "OrderId": "6373518", + "MerchantOrderId": "202407018F7D", + "MerchantId": "1", + "PosTerminalId": "111111", + "OrderStatus": "1", + "OrderStatusDescription": "Satis", + "OrderType": "1", + "OrderTypeDescription": "Pesin", + "TransactionStatus": "2", + "TransactionStatusDescription": "Basarisiz", + "LastOrderStatus": "1", + "LastOrderStatusDescription": "Satis", + "EndOfDayStatus": "1", + "EndOfDayStatusDescription": "Acik", + "FEC": "0949", + "FecDescription": "TRY", + "TransactionSecurity": "3", + "TransactionSecurityDescription": "3d islem", + "CardHolderName": "MUSA MADAEV", + "CardType": "MasterCard", + "CardNumber": "5573********4747", + "OrderDate": "2024-07-01T14:24:29.903", + "FirstAmount": "10.01", + "TranAmount": "10.01", + "FECAmount": "0.00", + "CancelAmount": "0.00", + "DrawbackAmount": "0.00", + "ClosedAmount": "0.00", + "InstallmentCount": "0", + "ResponseCode": "58", + "ResponseExplain": "Üye İşyerine izin verilmeyen işlem", + "ProvNumber": "", + "RRN": "418314129906", + "Stan": "435311", + "MerchantUserName": "apiuser", + "BatchId": "1" + }, + { + "OrderId": "6373501", + "MerchantOrderId": "20240701D3DE", + "MerchantId": "1", + "PosTerminalId": "111111", + "OrderStatus": "1", + "OrderStatusDescription": "Satis", + "OrderType": "1", + "OrderTypeDescription": "Pesin", + "TransactionStatus": "2", + "TransactionStatusDescription": "Basarisiz", + "LastOrderStatus": "1", + "LastOrderStatusDescription": "Satis", + "EndOfDayStatus": "1", + "EndOfDayStatusDescription": "Acik", + "FEC": "0949", + "FecDescription": "TRY", + "TransactionSecurity": "3", + "TransactionSecurityDescription": "3d islem", + "CardHolderName": "Kameta Tutaeva", + "CardType": "MasterCard", + "CardNumber": "5573********3107", + "OrderDate": "2024-07-01T14:18:28.897", + "FirstAmount": "10.01", + "TranAmount": "10.01", + "FECAmount": "0.00", + "CancelAmount": "0.00", + "DrawbackAmount": "0.00", + "ClosedAmount": "0.00", + "InstallmentCount": "0", + "ResponseCode": "58", + "ResponseExplain": "Üye İşyerine izin verilmeyen işlem", + "ProvNumber": "", + "RRN": "418314127105", + "Stan": "435294", + "MerchantUserName": "apiuser", + "BatchId": "1" + }, + { + "OrderId": "6373467", + "MerchantOrderId": "20240701B8DD", + "MerchantId": "1", + "PosTerminalId": "111111", + "OrderStatus": "1", + "OrderStatusDescription": "Satis", + "OrderType": "1", + "OrderTypeDescription": "Pesin", + "TransactionStatus": "1", + "TransactionStatusDescription": "Basarili", + "LastOrderStatus": "1", + "LastOrderStatusDescription": "Satis", + "EndOfDayStatus": "1", + "EndOfDayStatusDescription": "Acik", + "FEC": "0949", + "FecDescription": "TRY", + "TransactionSecurity": "3", + "TransactionSecurityDescription": "3d islem", + "CardHolderName": "john doe", + "CardType": "MasterCard", + "CardNumber": "5188********2666", + "OrderDate": "2024-07-01T14:03:37.87", + "FirstAmount": "10.01", + "TranAmount": "10.01", + "FECAmount": "0.00", + "CancelAmount": "0.00", + "DrawbackAmount": "0.00", + "ClosedAmount": "0.00", + "InstallmentCount": "0", + "ResponseCode": "00", + "ResponseExplain": "İşlem onaylandı", + "ProvNumber": "622275", + "RRN": "418314119600", + "Stan": "435260", + "MerchantUserName": "apiuser", + "BatchId": "1" + }, + { + "OrderId": "6373457", + "MerchantOrderId": "202407017191", + "MerchantId": "1", + "PosTerminalId": "111111", + "OrderStatus": "1", + "OrderStatusDescription": "Satis", + "OrderType": "1", + "OrderTypeDescription": "Pesin", + "TransactionStatus": "0", + "TransactionStatusDescription": "Sonuclanmamis Islem", + "LastOrderStatus": "1", + "LastOrderStatusDescription": "Satis", + "EndOfDayStatus": "1", + "EndOfDayStatusDescription": "Acik", + "FEC": "0949", + "FecDescription": "TRY", + "TransactionSecurity": "3", + "TransactionSecurityDescription": "3d islem", + "CardHolderName": "john doe", + "CardType": "MasterCard", + "CardNumber": "5351********9885", + "OrderDate": "2024-07-01T13:57:56.907", + "FirstAmount": "10.01", + "TranAmount": "10.01", + "FECAmount": "0.00", + "CancelAmount": "0.00", + "DrawbackAmount": "0.00", + "ClosedAmount": "0.00", + "InstallmentCount": "0", + "ResponseCode": "", + "ResponseExplain": "", + "ProvNumber": "", + "RRN": "", + "Stan": "", + "MerchantUserName": "apiuser", + "BatchId": "1" + }, + { + "OrderId": "6373455", + "MerchantOrderId": "20240701C7B9", + "MerchantId": "1", + "PosTerminalId": "111111", + "OrderStatus": "1", + "OrderStatusDescription": "Satis", + "OrderType": "1", + "OrderTypeDescription": "Pesin", + "TransactionStatus": "2", + "TransactionStatusDescription": "Basarisiz", + "LastOrderStatus": "1", + "LastOrderStatusDescription": "Satis", + "EndOfDayStatus": "1", + "EndOfDayStatusDescription": "Acik", + "FEC": "0949", + "FecDescription": "TRY", + "TransactionSecurity": "3", + "TransactionSecurityDescription": "3d islem", + "CardHolderName": "John Doe", + "CardType": "Visa", + "CardNumber": "4155********6111", + "OrderDate": "2024-07-01T13:57:31.843", + "FirstAmount": "10.01", + "TranAmount": "10.01", + "FECAmount": "0.00", + "CancelAmount": "0.00", + "DrawbackAmount": "0.00", + "ClosedAmount": "0.00", + "InstallmentCount": "0", + "ResponseCode": "58", + "ResponseExplain": "Üye İşyerine izin verilmeyen işlem", + "ProvNumber": "", + "RRN": "418313116549", + "Stan": "435248", + "MerchantUserName": "apiuser", + "BatchId": "1" + }, + { + "OrderId": "6373447", + "MerchantOrderId": "20240701BF8D", + "MerchantId": "1", + "PosTerminalId": "111111", + "OrderStatus": "1", + "OrderStatusDescription": "Satis", + "OrderType": "1", + "OrderTypeDescription": "Pesin", + "TransactionStatus": "1", + "TransactionStatusDescription": "Basarili", + "LastOrderStatus": "6", + "LastOrderStatusDescription": "Iptal", + "EndOfDayStatus": "1", + "EndOfDayStatusDescription": "Acik", + "FEC": "0949", + "FecDescription": "TRY", + "TransactionSecurity": "3", + "TransactionSecurityDescription": "3d islem", + "CardHolderName": "john doe", + "CardType": "MasterCard", + "CardNumber": "5351********9885", + "OrderDate": "2024-07-01T13:54:18.743", + "FirstAmount": "10.01", + "TranAmount": "10.01", + "FECAmount": "0.00", + "CancelAmount": "10.01", + "DrawbackAmount": "0.00", + "ClosedAmount": "0.00", + "InstallmentCount": "0", + "ResponseCode": "00", + "ResponseExplain": "İşlem onaylandı", + "ProvNumber": "593347", + "RRN": "418313115082", + "Stan": "435237", + "MerchantUserName": "apiuser", + "BatchId": "1" + }, + { + "OrderId": "6373447", + "MerchantOrderId": "20240701BF8D", + "MerchantId": "1", + "PosTerminalId": "111111", + "OrderStatus": "6", + "OrderStatusDescription": "Iptal", + "OrderType": "1", + "OrderTypeDescription": "Pesin", + "TransactionStatus": "1", + "TransactionStatusDescription": "Basarili", + "LastOrderStatus": "6", + "LastOrderStatusDescription": "Iptal", + "EndOfDayStatus": "1", + "EndOfDayStatusDescription": "Acik", + "FEC": "0949", + "FecDescription": "TRY", + "TransactionSecurity": "3", + "TransactionSecurityDescription": "3d islem", + "CardHolderName": "john doe", + "CardType": "MasterCard", + "CardNumber": "5351********9885", + "OrderDate": "2024-07-01T13:54:45.173", + "FirstAmount": "10.01", + "TranAmount": "10.01", + "FECAmount": "0.00", + "CancelAmount": "10.01", + "DrawbackAmount": "0.00", + "ClosedAmount": "0.00", + "InstallmentCount": "0", + "ResponseCode": "00", + "ResponseExplain": "İşlem onaylandı", + "ProvNumber": "593347", + "RRN": "418313115082", + "Stan": "435239", + "MerchantUserName": "apiuser", + "BatchId": "1" + }, + { + "OrderId": "6373447", + "MerchantOrderId": "20240701BF8D", + "MerchantId": "1", + "PosTerminalId": "111111", + "OrderStatus": "6", + "OrderStatusDescription": "Iptal", + "OrderType": "1", + "OrderTypeDescription": "Pesin", + "TransactionStatus": "1", + "TransactionStatusDescription": "Basarili", + "LastOrderStatus": "6", + "LastOrderStatusDescription": "Iptal", + "EndOfDayStatus": "1", + "EndOfDayStatusDescription": "Acik", + "FEC": "0949", + "FecDescription": "TRY", + "TransactionSecurity": "3", + "TransactionSecurityDescription": "3d islem", + "CardHolderName": "john doe", + "CardType": "MasterCard", + "CardNumber": "5351********9885", + "OrderDate": "2024-07-01T13:55:19.567", + "FirstAmount": "10.01", + "TranAmount": "10.01", + "FECAmount": "0.00", + "CancelAmount": "10.01", + "DrawbackAmount": "0.00", + "ClosedAmount": "0.00", + "InstallmentCount": "0", + "ResponseCode": "00", + "ResponseExplain": "İşlem onaylandı", + "ProvNumber": "593347", + "RRN": "418313115082", + "Stan": "435243", + "MerchantUserName": "apiuser", + "BatchId": "1" + }, + { + "OrderId": "6373447", + "MerchantOrderId": "20240701BF8D", + "MerchantId": "1", + "PosTerminalId": "111111", + "OrderStatus": "6", + "OrderStatusDescription": "Iptal", + "OrderType": "1", + "OrderTypeDescription": "Pesin", + "TransactionStatus": "1", + "TransactionStatusDescription": "Basarili", + "LastOrderStatus": "6", + "LastOrderStatusDescription": "Iptal", + "EndOfDayStatus": "1", + "EndOfDayStatusDescription": "Acik", + "FEC": "0949", + "FecDescription": "TRY", + "TransactionSecurity": "3", + "TransactionSecurityDescription": "3d islem", + "CardHolderName": "john doe", + "CardType": "MasterCard", + "CardNumber": "5351********9885", + "OrderDate": "2024-07-01T13:55:39.027", + "FirstAmount": "10.01", + "TranAmount": "10.01", + "FECAmount": "0.00", + "CancelAmount": "10.01", + "DrawbackAmount": "0.00", + "ClosedAmount": "0.00", + "InstallmentCount": "0", + "ResponseCode": "00", + "ResponseExplain": "İşlem onaylandı", + "ProvNumber": "593347", + "RRN": "418313115082", + "Stan": "435245", + "MerchantUserName": "apiuser", + "BatchId": "1" + }, + { + "OrderId": "6373034", + "MerchantOrderId": "2024070152BF", + "MerchantId": "1", + "PosTerminalId": "111111", + "OrderStatus": "1", + "OrderStatusDescription": "Satis", + "OrderType": "1", + "OrderTypeDescription": "Pesin", + "TransactionStatus": "1", + "TransactionStatusDescription": "Basarili", + "LastOrderStatus": "1", + "LastOrderStatusDescription": "Satis", + "EndOfDayStatus": "1", + "EndOfDayStatusDescription": "Acik", + "FEC": "0949", + "FecDescription": "TRY", + "TransactionSecurity": "3", + "TransactionSecurityDescription": "3d islem", + "CardHolderName": "john doe", + "CardType": "MasterCard", + "CardNumber": "5351********9885", + "OrderDate": "2024-07-01T12:49:44.427", + "FirstAmount": "10.01", + "TranAmount": "10.01", + "FECAmount": "0.00", + "CancelAmount": "0.00", + "DrawbackAmount": "0.00", + "ClosedAmount": "0.00", + "InstallmentCount": "0", + "ResponseCode": "00", + "ResponseExplain": "İşlem onaylandı", + "ProvNumber": "271425", + "RRN": "418312081069", + "Stan": "434824", + "MerchantUserName": "apiuser", + "BatchId": "1" + }, + { + "OrderId": "6373026", + "MerchantOrderId": "20240701BC7B", + "MerchantId": "1", + "PosTerminalId": "111111", + "OrderStatus": "1", + "OrderStatusDescription": "Satis", + "OrderType": "1", + "OrderTypeDescription": "Pesin", + "TransactionStatus": "0", + "TransactionStatusDescription": "Sonuclanmamis Islem", + "LastOrderStatus": "1", + "LastOrderStatusDescription": "Satis", + "EndOfDayStatus": "1", + "EndOfDayStatusDescription": "Acik", + "FEC": "0949", + "FecDescription": "TRY", + "TransactionSecurity": "3", + "TransactionSecurityDescription": "3d islem", + "CardHolderName": "john doe", + "CardType": "MasterCard", + "CardNumber": "5351********9885", + "OrderDate": "2024-07-01T12:46:24.28", + "FirstAmount": "10.01", + "TranAmount": "10.01", + "FECAmount": "0.00", + "CancelAmount": "0.00", + "DrawbackAmount": "0.00", + "ClosedAmount": "0.00", + "InstallmentCount": "0", + "ResponseCode": "", + "ResponseExplain": "", + "ProvNumber": "", + "RRN": "", + "Stan": "", + "MerchantUserName": "apiuser", + "BatchId": "1" + }, + { + "OrderId": "6373020", + "MerchantOrderId": "202407016C34", + "MerchantId": "1", + "PosTerminalId": "111111", + "OrderStatus": "1", + "OrderStatusDescription": "Satis", + "OrderType": "1", + "OrderTypeDescription": "Pesin", + "TransactionStatus": "2", + "TransactionStatusDescription": "Basarisiz", + "LastOrderStatus": "1", + "LastOrderStatusDescription": "Satis", + "EndOfDayStatus": "1", + "EndOfDayStatusDescription": "Acik", + "FEC": "0949", + "FecDescription": "TRY", + "TransactionSecurity": "3", + "TransactionSecurityDescription": "3d islem", + "CardHolderName": "John Doe", + "CardType": "Visa", + "CardNumber": "4155********6111", + "OrderDate": "2024-07-01T12:44:22.657", + "FirstAmount": "10.01", + "TranAmount": "10.01", + "FECAmount": "0.00", + "CancelAmount": "0.00", + "DrawbackAmount": "0.00", + "ClosedAmount": "0.00", + "InstallmentCount": "0", + "ResponseCode": "43", + "ResponseExplain": "Çalıntı Kart- Karta El Koy", + "ProvNumber": "", + "RRN": "418312078642", + "Stan": "434810", + "MerchantUserName": "apiuser", + "BatchId": "1" + }, + { + "OrderId": "6372927", + "MerchantOrderId": "202407018597", + "MerchantId": "1", + "PosTerminalId": "111111", + "OrderStatus": "1", + "OrderStatusDescription": "Satis", + "OrderType": "1", + "OrderTypeDescription": "Pesin", + "TransactionStatus": "0", + "TransactionStatusDescription": "Sonuclanmamis Islem", + "LastOrderStatus": "1", + "LastOrderStatusDescription": "Satis", + "EndOfDayStatus": "1", + "EndOfDayStatusDescription": "Acik", + "FEC": "0949", + "FecDescription": "TRY", + "TransactionSecurity": "3", + "TransactionSecurityDescription": "3d islem", + "CardHolderName": "nuryagdy mustapayev", + "CardType": "MasterCard", + "CardNumber": "5170********9151", + "OrderDate": "2024-07-01T12:15:54.557", + "FirstAmount": "10.01", + "TranAmount": "10.01", + "FECAmount": "0.00", + "CancelAmount": "0.00", + "DrawbackAmount": "0.00", + "ClosedAmount": "0.00", + "InstallmentCount": "0", + "ResponseCode": "", + "ResponseExplain": "", + "ProvNumber": "", + "RRN": "", + "Stan": "", + "MerchantUserName": "apiuser", + "BatchId": "1" + }, + { + "OrderId": "6372896", + "MerchantOrderId": "20240701A58F", + "MerchantId": "1", + "PosTerminalId": "111111", + "OrderStatus": "1", + "OrderStatusDescription": "Satis", + "OrderType": "1", + "OrderTypeDescription": "Pesin", + "TransactionStatus": "0", + "TransactionStatusDescription": "Sonuclanmamis Islem", + "LastOrderStatus": "1", + "LastOrderStatusDescription": "Satis", + "EndOfDayStatus": "1", + "EndOfDayStatusDescription": "Acik", + "FEC": "0949", + "FecDescription": "TRY", + "TransactionSecurity": "3", + "TransactionSecurityDescription": "3d islem", + "CardHolderName": "nuryagdy mustapayev", + "CardType": "MasterCard", + "CardNumber": "5170********9151", + "OrderDate": "2024-07-01T12:10:41.32", + "FirstAmount": "10.01", + "TranAmount": "10.01", + "FECAmount": "0.00", + "CancelAmount": "0.00", + "DrawbackAmount": "0.00", + "ClosedAmount": "0.00", + "InstallmentCount": "0", + "ResponseCode": "", + "ResponseExplain": "", + "ProvNumber": "", + "RRN": "", + "Stan": "", + "MerchantUserName": "apiuser", + "BatchId": "1" + }, + { + "OrderId": "6372885", + "MerchantOrderId": "202407010C7F", + "MerchantId": "1", + "PosTerminalId": "111111", + "OrderStatus": "1", + "OrderStatusDescription": "Satis", + "OrderType": "1", + "OrderTypeDescription": "Pesin", + "TransactionStatus": "0", + "TransactionStatusDescription": "Sonuclanmamis Islem", + "LastOrderStatus": "1", + "LastOrderStatusDescription": "Satis", + "EndOfDayStatus": "1", + "EndOfDayStatusDescription": "Acik", + "FEC": "0949", + "FecDescription": "TRY", + "TransactionSecurity": "3", + "TransactionSecurityDescription": "3d islem", + "CardHolderName": "nuryagdy mustapayev", + "CardType": "MasterCard", + "CardNumber": "5157********5467", + "OrderDate": "2024-07-01T12:08:28.91", + "FirstAmount": "10.01", + "TranAmount": "10.01", + "FECAmount": "0.00", + "CancelAmount": "0.00", + "DrawbackAmount": "0.00", + "ClosedAmount": "0.00", + "InstallmentCount": "0", + "ResponseCode": "", + "ResponseExplain": "", + "ProvNumber": "", + "RRN": "", + "Stan": "", + "MerchantUserName": "apiuser", + "BatchId": "1" + }, + { + "OrderId": "6372868", + "MerchantOrderId": "202407015ECB", + "MerchantId": "1", + "PosTerminalId": "111111", + "OrderStatus": "1", + "OrderStatusDescription": "Satis", + "OrderType": "1", + "OrderTypeDescription": "Pesin", + "TransactionStatus": "0", + "TransactionStatusDescription": "Sonuclanmamis Islem", + "LastOrderStatus": "1", + "LastOrderStatusDescription": "Satis", + "EndOfDayStatus": "1", + "EndOfDayStatusDescription": "Acik", + "FEC": "0949", + "FecDescription": "TRY", + "TransactionSecurity": "3", + "TransactionSecurityDescription": "3d islem", + "CardHolderName": "John Doe", + "CardType": "Visa", + "CardNumber": "4155********6111", + "OrderDate": "2024-07-01T12:01:50.443", + "FirstAmount": "10.01", + "TranAmount": "10.01", + "FECAmount": "0.00", + "CancelAmount": "0.00", + "DrawbackAmount": "0.00", + "ClosedAmount": "0.00", + "InstallmentCount": "0", + "ResponseCode": "", + "ResponseExplain": "", + "ProvNumber": "", + "RRN": "", + "Stan": "", + "MerchantUserName": "apiuser", + "BatchId": "1" + }, + { + "OrderId": "6372860", + "MerchantOrderId": "20240701A761", + "MerchantId": "1", + "PosTerminalId": "111111", + "OrderStatus": "1", + "OrderStatusDescription": "Satis", + "OrderType": "1", + "OrderTypeDescription": "Pesin", + "TransactionStatus": "0", + "TransactionStatusDescription": "Sonuclanmamis Islem", + "LastOrderStatus": "1", + "LastOrderStatusDescription": "Satis", + "EndOfDayStatus": "1", + "EndOfDayStatusDescription": "Acik", + "FEC": "0949", + "FecDescription": "TRY", + "TransactionSecurity": "3", + "TransactionSecurityDescription": "3d islem", + "CardHolderName": "John Doe", + "CardType": "Visa", + "CardNumber": "4155********6111", + "OrderDate": "2024-07-01T12:00:48.807", + "FirstAmount": "10.01", + "TranAmount": "10.01", + "FECAmount": "0.00", + "CancelAmount": "0.00", + "DrawbackAmount": "0.00", + "ClosedAmount": "0.00", + "InstallmentCount": "0", + "ResponseCode": "", + "ResponseExplain": "", + "ProvNumber": "", + "RRN": "", + "Stan": "", + "MerchantUserName": "apiuser", + "BatchId": "1" + }, + { + "OrderId": "6372852", + "MerchantOrderId": "20240701A19C", + "MerchantId": "1", + "PosTerminalId": "111111", + "OrderStatus": "1", + "OrderStatusDescription": "Satis", + "OrderType": "1", + "OrderTypeDescription": "Pesin", + "TransactionStatus": "0", + "TransactionStatusDescription": "Sonuclanmamis Islem", + "LastOrderStatus": "1", + "LastOrderStatusDescription": "Satis", + "EndOfDayStatus": "1", + "EndOfDayStatusDescription": "Acik", + "FEC": "0949", + "FecDescription": "TRY", + "TransactionSecurity": "3", + "TransactionSecurityDescription": "3d islem", + "CardHolderName": "John Doe", + "CardType": "Visa", + "CardNumber": "4155********6111", + "OrderDate": "2024-07-01T11:59:44.293", + "FirstAmount": "10.01", + "TranAmount": "10.01", + "FECAmount": "0.00", + "CancelAmount": "0.00", + "DrawbackAmount": "0.00", + "ClosedAmount": "0.00", + "InstallmentCount": "0", + "ResponseCode": "", + "ResponseExplain": "", + "ProvNumber": "", + "RRN": "", + "Stan": "", + "MerchantUserName": "apiuser", + "BatchId": "1" + }, + { + "OrderId": "6372691", + "MerchantOrderId": "20240701770E", + "MerchantId": "1", + "PosTerminalId": "111111", + "OrderStatus": "1", + "OrderStatusDescription": "Satis", + "OrderType": "1", + "OrderTypeDescription": "Pesin", + "TransactionStatus": "0", + "TransactionStatusDescription": "Sonuclanmamis Islem", + "LastOrderStatus": "1", + "LastOrderStatusDescription": "Satis", + "EndOfDayStatus": "1", + "EndOfDayStatusDescription": "Acik", + "FEC": "0949", + "FecDescription": "TRY", + "TransactionSecurity": "3", + "TransactionSecurityDescription": "3d islem", + "CardHolderName": "John Doe", + "CardType": "Visa", + "CardNumber": "4155********6111", + "OrderDate": "2024-07-01T10:58:22.383", + "FirstAmount": "10.01", + "TranAmount": "10.01", + "FECAmount": "0.00", + "CancelAmount": "0.00", + "DrawbackAmount": "0.00", + "ClosedAmount": "0.00", + "InstallmentCount": "0", + "ResponseCode": "", + "ResponseExplain": "", + "ProvNumber": "", + "RRN": "", + "Stan": "", + "MerchantUserName": "apiuser", + "BatchId": "1" + }, + { + "OrderId": "6371147", + "MerchantOrderId": "202407013375", + "MerchantId": "1", + "PosTerminalId": "111111", + "OrderStatus": "1", + "OrderStatusDescription": "Satis", + "OrderType": "1", + "OrderTypeDescription": "Pesin", + "TransactionStatus": "0", + "TransactionStatusDescription": "Sonuclanmamis Islem", + "LastOrderStatus": "1", + "LastOrderStatusDescription": "Satis", + "EndOfDayStatus": "1", + "EndOfDayStatusDescription": "Acik", + "FEC": "0949", + "FecDescription": "TRY", + "TransactionSecurity": "3", + "TransactionSecurityDescription": "3d islem", + "CardHolderName": "John Doe", + "CardType": "Visa", + "CardNumber": "4155********6111", + "OrderDate": "2024-07-01T02:54:38.64", + "FirstAmount": "10.01", + "TranAmount": "10.01", + "FECAmount": "0.00", + "CancelAmount": "0.00", + "DrawbackAmount": "0.00", + "ClosedAmount": "0.00", + "InstallmentCount": "0", + "ResponseCode": "", + "ResponseExplain": "", + "ProvNumber": "", + "RRN": "", + "Stan": "", + "MerchantUserName": "apiuser", + "BatchId": "1" + }, + { + "OrderId": "6371146", + "MerchantOrderId": "20240701DB3C", + "MerchantId": "1", + "PosTerminalId": "111111", + "OrderStatus": "1", + "OrderStatusDescription": "Satis", + "OrderType": "1", + "OrderTypeDescription": "Pesin", + "TransactionStatus": "0", + "TransactionStatusDescription": "Sonuclanmamis Islem", + "LastOrderStatus": "1", + "LastOrderStatusDescription": "Satis", + "EndOfDayStatus": "1", + "EndOfDayStatusDescription": "Acik", + "FEC": "0949", + "FecDescription": "TRY", + "TransactionSecurity": "3", + "TransactionSecurityDescription": "3d islem", + "CardHolderName": "John Doe", + "CardType": "Visa", + "CardNumber": "4155********6111", + "OrderDate": "2024-07-01T02:54:28.937", + "FirstAmount": "10.01", + "TranAmount": "10.01", + "FECAmount": "0.00", + "CancelAmount": "0.00", + "DrawbackAmount": "0.00", + "ClosedAmount": "0.00", + "InstallmentCount": "0", + "ResponseCode": "", + "ResponseExplain": "", + "ProvNumber": "", + "RRN": "", + "Stan": "", + "MerchantUserName": "apiuser", + "BatchId": "1" + }, + { + "OrderId": "6371145", + "MerchantOrderId": "202407016D51", + "MerchantId": "1", + "PosTerminalId": "111111", + "OrderStatus": "1", + "OrderStatusDescription": "Satis", + "OrderType": "1", + "OrderTypeDescription": "Pesin", + "TransactionStatus": "0", + "TransactionStatusDescription": "Sonuclanmamis Islem", + "LastOrderStatus": "1", + "LastOrderStatusDescription": "Satis", + "EndOfDayStatus": "1", + "EndOfDayStatusDescription": "Acik", + "FEC": "0949", + "FecDescription": "TRY", + "TransactionSecurity": "3", + "TransactionSecurityDescription": "3d islem", + "CardHolderName": "john doe", + "CardType": "MasterCard", + "CardNumber": "5351********9885", + "OrderDate": "2024-07-01T02:54:22.09", + "FirstAmount": "10.01", + "TranAmount": "10.01", + "FECAmount": "0.00", + "CancelAmount": "0.00", + "DrawbackAmount": "0.00", + "ClosedAmount": "0.00", + "InstallmentCount": "0", + "ResponseCode": "", + "ResponseExplain": "", + "ProvNumber": "", + "RRN": "", + "Stan": "", + "MerchantUserName": "apiuser", + "BatchId": "1" + }, + { + "OrderId": "6371142", + "MerchantOrderId": "202407018FEE", + "MerchantId": "1", + "PosTerminalId": "111111", + "OrderStatus": "1", + "OrderStatusDescription": "Satis", + "OrderType": "1", + "OrderTypeDescription": "Pesin", + "TransactionStatus": "0", + "TransactionStatusDescription": "Sonuclanmamis Islem", + "LastOrderStatus": "1", + "LastOrderStatusDescription": "Satis", + "EndOfDayStatus": "1", + "EndOfDayStatusDescription": "Acik", + "FEC": "0949", + "FecDescription": "TRY", + "TransactionSecurity": "3", + "TransactionSecurityDescription": "3d islem", + "CardHolderName": "John Doe", + "CardType": "Visa", + "CardNumber": "4155********6111", + "OrderDate": "2024-07-01T02:18:35.857", + "FirstAmount": "10.01", + "TranAmount": "10.01", + "FECAmount": "0.00", + "CancelAmount": "0.00", + "DrawbackAmount": "0.00", + "ClosedAmount": "0.00", + "InstallmentCount": "0", + "ResponseCode": "", + "ResponseExplain": "", + "ProvNumber": "", + "RRN": "", + "Stan": "", + "MerchantUserName": "apiuser", + "BatchId": "1" + }, + { + "OrderId": "6371141", + "MerchantOrderId": "20240701FC8C", + "MerchantId": "1", + "PosTerminalId": "111111", + "OrderStatus": "1", + "OrderStatusDescription": "Satis", + "OrderType": "1", + "OrderTypeDescription": "Pesin", + "TransactionStatus": "0", + "TransactionStatusDescription": "Sonuclanmamis Islem", + "LastOrderStatus": "1", + "LastOrderStatusDescription": "Satis", + "EndOfDayStatus": "1", + "EndOfDayStatusDescription": "Acik", + "FEC": "0949", + "FecDescription": "TRY", + "TransactionSecurity": "3", + "TransactionSecurityDescription": "3d islem", + "CardHolderName": "John Doe", + "CardType": "Visa", + "CardNumber": "4155********6111", + "OrderDate": "2024-07-01T02:18:00.617", + "FirstAmount": "10.01", + "TranAmount": "10.01", + "FECAmount": "0.00", + "CancelAmount": "0.00", + "DrawbackAmount": "0.00", + "ClosedAmount": "0.00", + "InstallmentCount": "0", + "ResponseCode": "", + "ResponseExplain": "", + "ProvNumber": "", + "RRN": "", + "Stan": "", + "MerchantUserName": "apiuser", + "BatchId": "1" + } + ] + }, + "ResponseCode": "00", + "ResponseMessage": "", + "@xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance", + "@xmlns:xsd": "http://www.w3.org/2001/XMLSchema" +} From e6cdf24267bbc464646cf2c89af2541f25ab6880 Mon Sep 17 00:00:00 2001 From: Nuryagdy Mustapayev Date: Tue, 2 Jul 2024 12:17:44 +0200 Subject: [PATCH 5/6] README.md - update vakifkatilim pos status --- README.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 23ad3e18..24630ee3 100644 --- a/README.md +++ b/README.md @@ -10,21 +10,21 @@ sistemlerinin kullanılabilmesidir. ### Deskteklenen Payment Gateway'ler / Bankalar: -| Gateway | Desktekleyen
bankalar | Desteklenen
Ödeme Tipleri | Desteklenen Sorgular | -|------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------|---------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------| -| Tosla (AKÖde) | ? | NonSecure
3DPay
3DHost | İptal
İade
Durum sorgulama
Sipariş Tarihçesini sorgulama | -| AkbankPos | Akbank | NonSecure
3DSecur
3DPay
3DHost
Tekrarlanan Ödeme | İptal
İade
Sipariş Tarihçesini sorgulama
Geçmiş İşlemleri sorgulama | -| EST POS
(Asseco/Payten)
_deprecated_
| Akbank
TEB
İşbank
Şekerbank
Halkbank
Finansbank
Ziraat | NonSecure
3DSecure
3DPay
3DHost
3DPayHost
Tekrarlanan Ödeme | İptal
İade
Durum sorgulama
Sipariş Tarihçesini sorgulama | -| EST V3 POS

EstPos altyapının
daha güvenli
(sha512) hash
algoritmasıyla
uygulaması.
| -----"----- | -----"----- | -----"----- | -| PayFlex MPI VPOS V4 | Ziraat
Vakıfbank VPOS 7/24
İşbank | NonSecure
3DSecure
Tekrarlanan Ödeme | İptal
İade
Durum sorgulama | -| PayFlex
Common Payment V4
(Ortak Ödeme) | Ziraat
Vakıfbank
İşbank | NonSecure
3DPay
3DHost | İptal
İade | -| Garanti Virtual POS | Garanti | NonSecure
3DSecure
3DPay
3DHost
Tekrarlanan Ödeme | İptal
İade
Durum sorgulama
Sipariş Tarihçesini sorgulama | -| PosNet | YapıKredi | NonSecure
3DSecure
| İptal
İade
Durum sorgulama | -| PosNetV1
(JSON API) | Albaraka Türk | NonSecure
3DSecure | İptal
İade
Durum sorgulama | -| PayFor | Finansbank
Enpara | NonSecure
3DSecure
3DPay
3DHost | İptal
İade
Durum sorgulama
Sipariş Tarihçesini sorgulama
Geçmiş İşlemleri sorgulama | -| InterPOS | Deniz bank | NonSecure
3DSecure
3DPay
3DHost | İptal
İade
Durum sorgulama | -| Kuveyt POS TDV2.0.0 | Kuveyt Türk | NonSecure
3DSecure | İptal
İade
Durum sorgulama
(SOAP API) | -| VakifKatilimPos
(test edilmesi gerekiyor) | Vakıf Katılım | NonSecure
3DSecure
3DHost | İptal
İade
Durum sorgulama
Sipariş Tarihçesini sorgulama
Geçmiş İşlemleri sorgulama | +| Gateway | Desktekleyen
bankalar | Desteklenen
Ödeme Tipleri | Desteklenen Sorgular | +|------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------| +| Tosla (AKÖde) | ? | NonSecure
3DPay
3DHost | İptal
İade
Durum sorgulama
Sipariş Tarihçesini sorgulama | +| AkbankPos | Akbank | NonSecure
3DSecur
3DPay
3DHost
Tekrarlanan Ödeme | İptal
İade
Sipariş Tarihçesini sorgulama
Geçmiş İşlemleri sorgulama | +| EST POS
(Asseco/Payten)
_deprecated_
| Akbank
TEB
İşbank
Şekerbank
Halkbank
Finansbank
Ziraat | NonSecure
3DSecure
3DPay
3DHost
3DPayHost
Tekrarlanan Ödeme | İptal
İade
Durum sorgulama
Sipariş Tarihçesini sorgulama | +| EST V3 POS

EstPos altyapının
daha güvenli
(sha512) hash
algoritmasıyla
uygulaması.
| -----"----- | -----"----- | -----"----- | +| PayFlex MPI VPOS V4 | Ziraat
Vakıfbank VPOS 7/24
İşbank | NonSecure
3DSecure
Tekrarlanan Ödeme | İptal
İade
Durum sorgulama | +| PayFlex
Common Payment V4
(Ortak Ödeme) | Ziraat
Vakıfbank
İşbank | NonSecure
3DPay
3DHost | İptal
İade | +| Garanti Virtual POS | Garanti | NonSecure
3DSecure
3DPay
3DHost
Tekrarlanan Ödeme | İptal
İade
Durum sorgulama
Sipariş Tarihçesini sorgulama | +| PosNet | YapıKredi | NonSecure
3DSecure
| İptal
İade
Durum sorgulama | +| PosNetV1
(JSON API) | Albaraka Türk | NonSecure
3DSecure | İptal
İade
Durum sorgulama | +| PayFor | Finansbank
Enpara | NonSecure
3DSecure
3DPay
3DHost | İptal
İade
Durum sorgulama
Sipariş Tarihçesini sorgulama
Geçmiş İşlemleri sorgulama | +| InterPOS | Deniz bank | NonSecure
3DSecure
3DPay
3DHost | İptal
İade
Durum sorgulama | +| Kuveyt POS TDV2.0.0 | Kuveyt Türk | NonSecure
3DSecure | İptal
İade
Durum sorgulama
(SOAP API) | +| VakifKatilimPos | Vakıf Katılım | NonSecure (test edilmesi gerekiyor)
3DSecure
3DHost (test edilmesi gerekiyor) | İptal
İade
Durum sorgulama
Sipariş Tarihçesini sorgulama
Geçmiş İşlemleri sorgulama | ### Ana başlıklar From f408f0bc06db8efc779a1e871e164abb79bc416a Mon Sep 17 00:00:00 2001 From: Nuryagdy Mustapayev Date: Tue, 2 Jul 2024 12:18:24 +0200 Subject: [PATCH 6/6] CHANGELOG.md added v1.4.0 release notes --- docs/CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index e06e9287..a8a52670 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,3 +1,14 @@ +# Changelog +## [1.4.0] - 2024-07-02 + +### New Features +- **GarantiPos** - geçmiş işlemleri sorgulama (PR #221). +- **VakifKatilimPos** - kısmi iade desteği. (issue #218) + +### Fixed +- **VakifKatilimPos** - 3D Secure ödeme çalışmıyor. +- **VakifKatilimPos** - iptal işlemi çalışmıyor. + # Changelog ## [1.3.0] - 2024-05-24