From 519690d8b45145a7effc9283d5e7cab001c9d0d4 Mon Sep 17 00:00:00 2001 From: Nuryagdy Mustapayev Date: Sun, 19 May 2024 18:08:39 +0200 Subject: [PATCH 01/10] AccountFactory add missing EstPos --- src/Gateway/AccountFactory.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Gateway/AccountFactory.php b/src/Gateway/AccountFactory.php index 6619697..258f4a5 100644 --- a/src/Gateway/AccountFactory.php +++ b/src/Gateway/AccountFactory.php @@ -7,6 +7,7 @@ use Mews\Pos\Exceptions\MissingAccountInfoException; use Mews\Pos\Factory\AccountFactory as MewsPosAccountFactory; use Mews\Pos\Gateways\AkbankPos; +use Mews\Pos\Gateways\EstPos; use Mews\Pos\Gateways\EstV3Pos; use Mews\Pos\Gateways\GarantiPos; use Mews\Pos\Gateways\InterPos; @@ -36,6 +37,7 @@ class AccountFactory public static function createAccount(string $gatewayClass, string $name, array $credentials, string $lang = PosInterface::LANG_TR): AbstractPosAccount { switch ($gatewayClass) { + case EstPos::class: case EstV3Pos::class: return MewsPosAccountFactory::createEstPosAccount( $name, From 20e2ba6014f501fe00f17f785ff5be4d8e51d5e4 Mon Sep 17 00:00:00 2001 From: Nuryagdy Mustapayev Date: Sun, 19 May 2024 18:30:07 +0200 Subject: [PATCH 02/10] added integration tests --- .gitattributes | 6 + composer.json | 10 +- phpunit.xml | 30 ++++ tests/Integration/GatewaysTest.php | 268 +++++++++++++++++++++++++++++ tests/Kernel/Kernel.php | 29 ++++ tests/bootstrap.php | 5 + tests/config/mews_pos.yaml | 148 ++++++++++++++++ tests/config/services.yaml | 39 +++++ 8 files changed, 534 insertions(+), 1 deletion(-) create mode 100644 .gitattributes create mode 100644 phpunit.xml create mode 100644 tests/Integration/GatewaysTest.php create mode 100644 tests/Kernel/Kernel.php create mode 100644 tests/bootstrap.php create mode 100644 tests/config/mews_pos.yaml create mode 100644 tests/config/services.yaml diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..3357cec --- /dev/null +++ b/.gitattributes @@ -0,0 +1,6 @@ +.gitattributes export-ignore +.gitignore export-ignore +.editorconfig export-ignore +phpunit.xml export-ignore +tests/ export-ignore +var/ diff --git a/composer.json b/composer.json index 14b8415..a247c9a 100644 --- a/composer.json +++ b/composer.json @@ -37,11 +37,19 @@ "require-dev": { "nyholm/psr7": "^1.8", "psr/http-client": "^1.0", - "symfony/http-client": "^7.0" + "symfony/framework-bundle": "^7.0", + "symfony/http-client": "^7.0", + "symfony/phpunit-bridge": "^7.0", + "symfony/yaml": "^7.0" }, "autoload": { "psr-4": { "Mews\\PosBundle\\": "src/" } + }, + "autoload-dev": { + "psr-4": { + "Mews\\PosBundle\\Tests\\": "tests/" + } } } diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 0000000..474c421 --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,30 @@ + + + + + tests + + + tests/Integration + + + + + + + + + + diff --git a/tests/Integration/GatewaysTest.php b/tests/Integration/GatewaysTest.php new file mode 100644 index 0000000..5648399 --- /dev/null +++ b/tests/Integration/GatewaysTest.php @@ -0,0 +1,268 @@ +kernel = new Kernel(); + $this->kernel->boot(); + $this->container = $this->kernel->getContainer(); + } + + public function testEstPos(): void + { + $pos = $this->container->get('test.mews_pos.gateway.estpos'); + $this->assertInstanceOf(\Mews\Pos\Gateways\EstV3Pos::class, $pos); + + $this->assertSame('estpos', $pos->getAccount()->getBank()); + $this->assertSame('700XXXXXXXX', $pos->getAccount()->getClientId()); + $this->assertSame('ISBYYYY', $pos->getAccount()->getUsername()); + $this->assertSame('ISZZZZZ', $pos->getAccount()->getPassword()); + $this->assertSame('TRPWWWWW', $pos->getAccount()->getStoreKey()); + $this->assertSame(PosInterface::LANG_EN, $pos->getAccount()->getLang()); + $this->assertSame('https://entegrasyon.asseco-see.com.tr/fim/api', $pos->getApiURL()); + $this->assertSame('https://entegrasyon.asseco-see.com.tr/fim/est3Dgate', $pos->get3DGatewayURL()); + $this->assertSame('https://sanalpos.sanalakpos.com.tr/fim/est3Dgate', $pos->get3DHostGatewayURL()); + $this->assertSame(false, $pos->isTestMode()); + } + + public function testPosNet(): void + { + $pos = $this->container->get('test.mews_pos.gateway.yapikredi'); + $this->assertInstanceOf(\Mews\Pos\Gateways\PosNet::class, $pos); + + $this->assertSame('yapikredi', $pos->getAccount()->getBank()); + $this->assertSame('670XXXXXX', $pos->getAccount()->getClientId()); + $this->assertSame('673YYYYYYY', $pos->getAccount()->getTerminalId()); + $this->assertSame('27212132321', $pos->getAccount()->getUsername()); + $this->assertSame('33,10,221,10,33,10,221,10', $pos->getAccount()->getStoreKey()); + $this->assertSame(PosInterface::LANG_TR, $pos->getAccount()->getLang()); + $this->assertSame('https://setmpos.ykb.com/PosnetWebService/XML', $pos->getApiURL()); + $this->assertSame('https://setmpos.ykb.com/3DSWebService/YKBPaymentService', $pos->get3DGatewayURL()); + $this->assertSame(true, $pos->isTestMode()); + } + + public function testPosNetV1(): void + { + $pos = $this->container->get('test.mews_pos.gateway.albaraka'); + $this->assertInstanceOf(\Mews\Pos\Gateways\PosNetV1Pos::class, $pos); + + $this->assertSame('albaraka', $pos->getAccount()->getBank()); + $this->assertSame('670XXXXXX', $pos->getAccount()->getClientId()); + $this->assertSame('67YYYYY', $pos->getAccount()->getTerminalId()); + $this->assertSame('1010353453534', $pos->getAccount()->getUsername()); + $this->assertSame('33,10,221,10,33,10,221,10', $pos->getAccount()->getStoreKey()); + $this->assertSame(PosInterface::LANG_TR, $pos->getAccount()->getLang()); + $this->assertSame('https://epostest.albarakaturk.com.tr/ALBMerchantService/MerchantJSONAPI.svc', $pos->getApiURL()); + $this->assertSame('https://setmpos.ykb.com/3DSWebService/YKBPaymentService', $pos->get3DGatewayURL()); + $this->assertSame(true, $pos->isTestMode()); + } + + public function testPayForPos(): void + { + $pos = $this->container->get('test.mews_pos.gateway.payfor_finansbank'); + $this->assertInstanceOf(\Mews\Pos\Gateways\PayForPos::class, $pos); + + $this->assertSame('payfor_finansbank', $pos->getAccount()->getBank()); + $this->assertSame('08530313141242', $pos->getAccount()->getClientId()); + $this->assertSame('QNB_API_USERNAME', $pos->getAccount()->getUsername()); + $this->assertSame('UXXXXX', $pos->getAccount()->getPassword()); + $this->assertSame('12345678', $pos->getAccount()->getStoreKey()); + $this->assertSame(PosInterface::LANG_TR, $pos->getAccount()->getLang()); + $this->assertSame('https://vpostest.qnbfinansbank.com/Gateway/XMLGate.aspx', $pos->getApiURL()); + $this->assertSame('https://vpostest.qnbfinansbank.com/Gateway/Default.aspx', $pos->get3DGatewayURL()); + $this->assertSame('https://vpostest.qnbfinansbank.com/Gateway/3DHost.aspx', $pos->get3DHostGatewayURL()); + $this->assertSame(true, $pos->isTestMode()); + } + + public function testGarantiPos(): void + { + $pos = $this->container->get('test.mews_pos.gateway.garanti'); + $this->assertInstanceOf(\Mews\Pos\Gateways\GarantiPos::class, $pos); + + $this->assertSame('garanti', $pos->getAccount()->getBank()); + $this->assertSame('7001212', $pos->getAccount()->getClientId()); + $this->assertSame('PROVAUT', $pos->getAccount()->getUsername()); + $this->assertSame('123PASSWORD', $pos->getAccount()->getPassword()); + $this->assertSame('30691298', $pos->getAccount()->getTerminalId()); + $this->assertSame('12345678', $pos->getAccount()->getStoreKey()); + $this->assertSame('PROVRFN', $pos->getAccount()->getRefundUsername()); + $this->assertSame('R123PASSWORD', $pos->getAccount()->getRefundPassword()); + $this->assertSame(PosInterface::LANG_TR, $pos->getAccount()->getLang()); + $this->assertSame('https://sanalposprovtest.garantibbva.com.tr/VPServlet', $pos->getApiURL()); + $this->assertSame('https://sanalposprovtest.garantibbva.com.tr/servlet/gt3dengine', $pos->get3DGatewayURL()); + $this->assertSame(false, $pos->isTestMode()); + } + + public function testInterPos(): void + { + $pos = $this->container->get('test.mews_pos.gateway.interpos_denizbank'); + $this->assertInstanceOf(\Mews\Pos\Gateways\InterPos::class, $pos); + + $this->assertSame('interpos_denizbank', $pos->getAccount()->getBank()); + $this->assertSame('InterTestApi', $pos->getAccount()->getClientId()); + $this->assertSame('3123', $pos->getAccount()->getUsername()); + $this->assertSame('3', $pos->getAccount()->getPassword()); + $this->assertSame('gDg1N', $pos->getAccount()->getStoreKey()); + $this->assertSame(PosInterface::LANG_TR, $pos->getAccount()->getLang()); + $this->assertSame('https://test.inter-vpos.com.tr/mpi/Default.aspx', $pos->getApiURL()); + $this->assertSame('https://test.inter-vpos.com.tr/mpi/Default.aspx', $pos->get3DGatewayURL()); + $this->assertSame('https://test.inter-vpos.com.tr/mpi/3DHost.aspx', $pos->get3DHostGatewayURL()); + $this->assertSame(false, $pos->isTestMode()); + } + + public function testKuveytPos(): void + { + $pos = $this->container->get('test.mews_pos.gateway.kuveytpos'); + $this->assertInstanceOf(\Mews\Pos\Gateways\KuveytPos::class, $pos); + + $this->assertSame('kuveytpos', $pos->getAccount()->getBank()); + $this->assertSame('496', $pos->getAccount()->getClientId()); + $this->assertSame('400235', $pos->getAccount()->getCustomerId()); + $this->assertSame('apiuser1', $pos->getAccount()->getUsername()); + $this->assertSame('Api1232', $pos->getAccount()->getStoreKey()); + $this->assertSame(PosInterface::LANG_TR, $pos->getAccount()->getLang()); + $this->assertSame('https://boatest.kuveytturk.com.tr/boa.virtualpos.services/Home', $pos->getApiURL()); + $this->assertSame('https://boatest.kuveytturk.com.tr/boa.virtualpos.services/Home/ThreeDModelPayGate', $pos->get3DGatewayURL()); + $this->assertSame('https://boatest.kuveytturk.com.tr/BOA.Integration.WCFService/BOA.Integration.VirtualPos/VirtualPosService.svc?wsdl', $pos->getQueryAPIUrl()); + $this->assertSame(false, $pos->isTestMode()); + } + + public function testVakifKatilimPos(): void + { + $pos = $this->container->get('test.mews_pos.gateway.vakifkatilim'); + $this->assertInstanceOf(\Mews\Pos\Gateways\VakifKatilimPos::class, $pos); + + $this->assertSame('vakifkatilim', $pos->getAccount()->getBank()); + $this->assertSame('1', $pos->getAccount()->getClientId()); + $this->assertSame('11111', $pos->getAccount()->getCustomerId()); + $this->assertSame('APIUSER', $pos->getAccount()->getUsername()); + $this->assertSame('kdsnsksl', $pos->getAccount()->getStoreKey()); + $this->assertSame(PosInterface::LANG_TR, $pos->getAccount()->getLang()); + $this->assertSame('https://boa.vakifkatilim.com.tr/VirtualPOS.Gateway/Home', $pos->getApiURL()); + $this->assertSame( + 'https://boa.vakifkatilim.com.tr/VirtualPOS.Gateway/Home/ThreeDModelPayGate', + $pos->get3DGatewayURL() + ); + $this->assertSame( + 'https://boa.vakifkatilim.com.tr/VirtualPOS.Gateway/CommonPaymentPage/CommonPaymentPage', + $pos->get3DHostGatewayURL() + ); + $this->assertSame(false, $pos->isTestMode()); + } + + public function testPayFlexV4Pos(): void + { + $pos = $this->container->get('test.mews_pos.gateway.payflexv4_ziraat'); + $this->assertInstanceOf(\Mews\Pos\Gateways\PayFlexV4Pos::class, $pos); + + $this->assertSame('payflexv4_ziraat', $pos->getAccount()->getBank()); + $this->assertSame('000000000111111', $pos->getAccount()->getClientId()); + $this->assertSame('VP000095', $pos->getAccount()->getTerminalId()); + $this->assertSame('3XTgER89as', $pos->getAccount()->getPassword()); + $this->assertSame(PosInterface::LANG_TR, $pos->getAccount()->getLang()); + $this->assertSame('https://preprod.payflex.com.tr/Ziraatbank/VposWeb/v3/Vposreq.aspx', $pos->getApiURL()); + $this->assertSame( + 'https://preprod.payflex.com.tr/ZiraatBank/MpiWeb/MPI_Enrollment.aspx', + $pos->get3DGatewayURL() + ); + $this->assertSame( + 'https://sanalpos.ziraatbank.com.tr/v4/UIWebService/Search.aspx', + $pos->getQueryAPIUrl() + ); + $this->assertSame(false, $pos->isTestMode()); + } + + public function testPayFlexCPV4Pos(): void + { + $pos = $this->container->get('test.mews_pos.gateway.payflexcpv4_vakifbank'); + $this->assertInstanceOf(\Mews\Pos\Gateways\PayFlexCPV4Pos::class, $pos); + + $this->assertSame('payflexcpv4_vakifbank', $pos->getAccount()->getBank()); + $this->assertSame('000100000013506', $pos->getAccount()->getClientId()); + $this->assertSame('VP000579', $pos->getAccount()->getTerminalId()); + $this->assertSame('123456', $pos->getAccount()->getPassword()); + $this->assertSame(PosInterface::LANG_TR, $pos->getAccount()->getLang()); + $this->assertSame( + 'https://cptest.vakifbank.com.tr/CommonPayment/api/RegisterTransaction', + $pos->getApiURL() + ); + $this->assertSame( + 'https://cptest.vakifbank.com.tr/CommonPayment/api/VposTransaction', + $pos->get3DGatewayURL() + ); + $this->assertSame( + 'https://cptest.vakifbank.com.tr/CommonPayment/SecurePayment', + $pos->getQueryAPIUrl() + ); + $this->assertSame(false, $pos->isTestMode()); + } + + public function testAkbankPos(): void + { + $pos = $this->container->get('test.mews_pos.gateway.akbankpos'); + $this->assertInstanceOf(\Mews\Pos\Gateways\AkbankPos::class, $pos); + + $this->assertSame('akbankpos', $pos->getAccount()->getBank()); + $this->assertSame('2023093534534543535353543543', $pos->getAccount()->getClientId()); + $this->assertSame('2023042423423424242324242123', $pos->getAccount()->getTerminalId()); + $this->assertSame( + '323032333039303431373530303230948048503543392420320234394385349058904932', + $pos->getAccount()->getStoreKey() + ); + $this->assertSame(PosInterface::LANG_TR, $pos->getAccount()->getLang()); + $this->assertSame( + 'https://apipre.akbank.com/api/v1/payment/virtualpos', + $pos->getApiURL() + ); + $this->assertSame( + 'https://virtualpospaymentgatewaypre.akbank.com/securepay', + $pos->get3DGatewayURL() + ); + $this->assertSame( + 'https://virtualpospaymentgatewaypre.akbank.com/payhosting', + $pos->get3DHostGatewayURL() + ); + $this->assertSame(false, $pos->isTestMode()); + } + + public function testToslaPos(): void + { + $pos = $this->container->get('test.mews_pos.gateway.toslapos'); + $this->assertInstanceOf(\Mews\Pos\Gateways\ToslaPos::class, $pos); + + $this->assertSame('toslapos', $pos->getAccount()->getBank()); + $this->assertSame('1000000494', $pos->getAccount()->getClientId()); + $this->assertSame('POS_ENT_Test_001', $pos->getAccount()->getUsername()); + $this->assertSame('POS_ENT_Test_001!*!*', $pos->getAccount()->getStoreKey()); + $this->assertSame(PosInterface::LANG_TR, $pos->getAccount()->getLang()); + $this->assertSame( + 'https://prepentegrasyon.tosla.com/api/Payment', + $pos->getApiURL() + ); + $this->assertSame( + 'https://prepentegrasyon.tosla.com/api/Payment/ProcessCardForm', + $pos->get3DGatewayURL() + ); + $this->assertSame( + 'https://prepentegrasyon.tosla.com/api/Payment/threeDSecure/', + $pos->get3DHostGatewayURL() + ); + $this->assertSame(false, $pos->isTestMode()); + } +} diff --git a/tests/Kernel/Kernel.php b/tests/Kernel/Kernel.php new file mode 100644 index 0000000..f7a9dad --- /dev/null +++ b/tests/Kernel/Kernel.php @@ -0,0 +1,29 @@ +load(__DIR__.'/../config/services.yaml', 'yaml'); + $loader->load(__DIR__.'/../config/mews_pos.yaml', 'yaml'); + } +} diff --git a/tests/bootstrap.php b/tests/bootstrap.php new file mode 100644 index 0000000..53ab368 --- /dev/null +++ b/tests/bootstrap.php @@ -0,0 +1,5 @@ + Date: Sun, 19 May 2024 18:42:19 +0200 Subject: [PATCH 03/10] renamed gateway tag name --- README.md | 2 +- src/DependencyInjection/MewsPosExtension.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5ff960f..bc81380 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,7 @@ class SingleBankThreeDSecurePaymentController extends AbstractController * birden fazla banka oldugunda bu sekilde hepsine erisebilirsiniz * @var PosInterface[] */ - #[TaggedIterator('mews_pos.gateway.bank')] + #[TaggedIterator('mews_pos.gateway')] private iterable $banks, ) { diff --git a/src/DependencyInjection/MewsPosExtension.php b/src/DependencyInjection/MewsPosExtension.php index d221d8b..566d47b 100644 --- a/src/DependencyInjection/MewsPosExtension.php +++ b/src/DependencyInjection/MewsPosExtension.php @@ -40,7 +40,7 @@ public function load(array $configs, ContainerBuilder $container): void $container->registerAliasForArgument($serviceId, PosInterface::class, $bank) ->setPublic(false); - $gatewayDefinition->addTag('mews_pos.gateway.bank', ['key' => $serviceId]); + $gatewayDefinition->addTag('mews_pos.gateway', ['key' => $serviceId]); if ($i === 0) { // set the first gateway as a default for injection From 630a0fd3ee663fa863b7a3b98d32a4c616c390a5 Mon Sep 17 00:00:00 2001 From: Nuryagdy Mustapayev Date: Sun, 19 May 2024 18:43:23 +0200 Subject: [PATCH 04/10] docs - example updates --- README.md | 20 +++----------------- docs/EXAMPLE_CONFIGURATIONS.md | 22 ++++------------------ 2 files changed, 7 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index bc81380..10533e2 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ estpos: # herhangi unique bir isim gateway_class: Mews\Pos\Gateways\EstV3Pos lang: !php/const Mews\Pos\PosInterface::LANG_TR # optional + test_mode: false #optional, default: false; credentials: payment_model: !php/const Mews\Pos\PosInterface::MODEL_3D_SECURE merchant_id: 700xxxxxx @@ -38,7 +39,6 @@ payment_api: 'https://entegrasyon.asseco-see.com.tr/fim/api' gateway_3d: 'https://entegrasyon.asseco-see.com.tr/fim/est3Dgate' gateway_3d_host: 'https://sanalpos.sanalakpos.com.tr/fim/est3Dgate' # optional, 3D Host ödemeler için zorunlu - test_mode: false #optional, default: false; yapikredi: gateway_class: Mews\Pos\Gateways\PosNet credentials: @@ -50,7 +50,6 @@ gateway_endpoints: payment_api: 'https://setmpos.ykb.com/PosnetWebService/XML' gateway_3d: 'https://setmpos.ykb.com/3DSWebService/YKBPaymentService' - test_mode: false ``` ### Ornek 3D Secure Odeme @@ -129,15 +128,7 @@ class SingleBankThreeDSecurePaymentController extends AbstractController ); $session->set('order', $order); - //$card = $this->createCard($this->pos, $request->request->all()); - $card = $this->createCard($this->pos, [ // normalde POST ile kart bilgileri gelecek - 'number' => '4546xxxxyyyywwwwzzzz', - 'year' => '26', - 'month' => '12', - 'cvv' => '000', - 'name' => 'John Doe', - 'type' => CreditCardInterface::CARD_TYPE_VISA, - ]); + $card = $this->createCard($this->pos, $request->request->all()); /** * PayFlex'te provizyonu (odemeyi) tamamlamak icin tekrar kredi kart bilgileri isteniyor, @@ -285,14 +276,9 @@ class SingleBankThreeDSecurePaymentController extends AbstractController dd($e); } - $response = $this->pos->getResponse(); - - // iptal, iade, siparis durum sorgulama islemleri yapabilmek icin $response'u kaydediyoruz - $session->set('last_response', $response); - if ($this->pos->isSuccess()) { echo 'success'; - exit; + dd($this->pos->getResponse()); } else { dd($response); } diff --git a/docs/EXAMPLE_CONFIGURATIONS.md b/docs/EXAMPLE_CONFIGURATIONS.md index 90da062..99d2eb9 100644 --- a/docs/EXAMPLE_CONFIGURATIONS.md +++ b/docs/EXAMPLE_CONFIGURATIONS.md @@ -83,6 +83,7 @@ mews_pos: estpos_payten: gateway_class: Mews\Pos\Gateways\EstV3Pos lang: !php/const Mews\Pos\PosInterface::LANG_TR #optional + test_mode: true # optional credentials: payment_model: !php/const Mews\Pos\PosInterface::MODEL_3D_SECURE merchant_id: 700XXXXXXX @@ -93,7 +94,6 @@ mews_pos: payment_api: 'https://entegrasyon.asseco-see.com.tr/fim/api' gateway_3d: 'https://entegrasyon.asseco-see.com.tr/fim/est3Dgate' gateway_3d_host: 'https://sanalpos.sanalakpos.com.tr/fim/est3Dgate' - test_mode: true yapikredi: gateway_class: Mews\Pos\Gateways\PosNet credentials: @@ -105,7 +105,6 @@ mews_pos: gateway_endpoints: payment_api: 'https://setmpos.ykb.com/PosnetWebService/XML' gateway_3d: 'https://setmpos.ykb.com/3DSWebService/YKBPaymentService' - test_mode: true albaraka: gateway_class: Mews\Pos\Gateways\PosNetV1Pos credentials: @@ -115,9 +114,8 @@ mews_pos: user_name: 10100628XXXXXXX # 16 haneli üye işyeri EPOS numarası. enc_key: 10,43,43,45,65,56,76,08 # Şifreleme anahtar gateway_endpoints: - payment_api: 'https://setmpos.ykb.com/PosnetWebService/XML' - gateway_3d: 'https://setmpos.ykb.com/3DSWebService/YKBPaymentService' - test_mode: true + payment_api: 'https://epostest.albarakaturk.com.tr/ALBMerchantService/MerchantJSONAPI.svc' + gateway_3d: 'https://epostest.albarakaturk.com.tr/ALBSecurePaymentUI/SecureProcess/SecureVerification.aspx' payfor_finansbank: gateway_class: Mews\Pos\Gateways\PayForPos credentials: @@ -130,7 +128,6 @@ mews_pos: payment_api: 'https://vpostest.qnbfinansbank.com/Gateway/XMLGate.aspx' gateway_3d: 'https://vpostest.qnbfinansbank.com/Gateway/Default.aspx' gateway_3d_host: 'https://vpostest.qnbfinansbank.com/Gateway/3DHost.aspx' - test_mode: true garanti: gateway_class: Mews\Pos\Gateways\GarantiPos credentials: @@ -145,12 +142,10 @@ mews_pos: gateway_endpoints: payment_api: 'https://sanalposprovtest.garantibbva.com.tr/VPServlet' gateway_3d: 'https://sanalposprovtest.garantibbva.com.tr/servlet/gt3dengine' - test_mode: true interpos_denizbank: gateway_class: Mews\Pos\Gateways\InterPos credentials: - #payment_model: !php/const Mews\Pos\PosInterface::MODEL_3D_SECURE - payment_model: !php/const Mews\Pos\PosInterface::MODEL_3D_HOST + payment_model: !php/const Mews\Pos\PosInterface::MODEL_3D_SECURE merchant_id: InterXXXXXXXX # ShopCode user_name: 31XXXXXXXX # UserCode user_password: 3XXXXXXXX # UserPass @@ -159,7 +154,6 @@ mews_pos: payment_api: 'https://test.inter-vpos.com.tr/mpi/Default.aspx' gateway_3d: 'https://test.inter-vpos.com.tr/mpi/Default.aspx' gateway_3d_host: 'https://test.inter-vpos.com.tr/mpi/3DHost.aspx' - test_mode: true kuveytpos: gateway_class: Mews\Pos\Gateways\KuveytPos credentials: @@ -172,7 +166,6 @@ mews_pos: payment_api: 'https://boatest.kuveytturk.com.tr/boa.virtualpos.services/Home' gateway_3d: 'https://boatest.kuveytturk.com.tr/boa.virtualpos.services/Home/ThreeDModelPayGate' query_api: 'https://boatest.kuveytturk.com.tr/BOA.Integration.WCFService/BOA.Integration.VirtualPos/VirtualPosService.svc?wsdl' - test_mode: true vakifkatilim: gateway_class: Mews\Pos\Gateways\VakifKatilimPos credentials: @@ -185,7 +178,6 @@ mews_pos: payment_api: 'https://boa.vakifkatilim.com.tr/VirtualPOS.Gateway/Home' gateway_3d: 'https://boa.vakifkatilim.com.tr/VirtualPOS.Gateway/Home/ThreeDModelPayGate' gateway_3d_host: 'https://boa.vakifkatilim.com.tr/VirtualPOS.Gateway/CommonPaymentPage/CommonPaymentPage' - test_mode: true payflexv4_ziraat: gateway_class: Mews\Pos\Gateways\PayFlexV4Pos credentials: @@ -197,7 +189,6 @@ mews_pos: payment_api: 'https://preprod.payflex.com.tr/Ziraatbank/VposWeb/v3/Vposreq.aspx' gateway_3d: 'https://preprod.payflex.com.tr/ZiraatBank/MpiWeb/MPI_Enrollment.aspx' query_api: 'https://sanalpos.ziraatbank.com.tr/v4/UIWebService/Search.aspx' - test_mode: true payflexcpv4_vakifbank: gateway_class: Mews\Pos\Gateways\PayFlexCPV4Pos credentials: @@ -209,7 +200,6 @@ mews_pos: payment_api: 'https://cptest.vakifbank.com.tr/CommonPayment/api/RegisterTransaction' gateway_3d: 'https://cptest.vakifbank.com.tr/CommonPayment/api/VposTransaction' query_api: 'https://cptest.vakifbank.com.tr/CommonPayment/SecurePayment' - test_mode: true akbankpos: gateway_class: Mews\Pos\Gateways\AkbankPos credentials: @@ -222,7 +212,6 @@ mews_pos: payment_api: 'https://apipre.akbank.com/api/v1/payment/virtualpos' gateway_3d: 'https://virtualpospaymentgatewaypre.akbank.com/securepay' gateway_3d_host: 'https://virtualpospaymentgatewaypre.akbank.com/payhosting' - test_mode: true toslapos: gateway_class: Mews\Pos\Gateways\ToslaPos credentials: @@ -234,7 +223,4 @@ mews_pos: payment_api: 'https://prepentegrasyon.tosla.com/api/Payment' gateway_3d: 'https://prepentegrasyon.tosla.com/api/Payment/ProcessCardForm' gateway_3d_host: 'https://prepentegrasyon.tosla.com/api/Payment/threeDSecure' - test_mode: true - - ``` From 9f87a8821b1b7b3787420d9e21b3649c7464625c Mon Sep 17 00:00:00 2001 From: Nuryagdy Mustapayev Date: Sun, 19 May 2024 18:44:21 +0200 Subject: [PATCH 05/10] add support for mews/pos 1.2 version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index a247c9a..bd7f508 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ ], "require": { "php": ">=7.4", - "mews/pos": "^1.1", + "mews/pos": "^1.1 | ^1.2", "symfony/config": "^4.0 | ^5.0 | ^6.0 | ^7.0", "symfony/dependency-injection": "^4.0 | ^5.0 | ^6.0 | ^7.0", "symfony/event-dispatcher": "^4.0 | ^5.0 | ^6.0 | ^7.0", From b35a4be0c10833381614263c1a6a6eeb974ba447 Mon Sep 17 00:00:00 2001 From: Nuryagdy Mustapayev Date: Sun, 19 May 2024 18:45:35 +0200 Subject: [PATCH 06/10] add github ci actions --- .github/workflows/ci-php.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/ci-php.yml diff --git a/.github/workflows/ci-php.yml b/.github/workflows/ci-php.yml new file mode 100644 index 0000000..14ddf35 --- /dev/null +++ b/.github/workflows/ci-php.yml @@ -0,0 +1,21 @@ +name: Unit Tests + +on: [push, pull_request] + +jobs: + test: + + runs-on: ubuntu-latest + strategy: + fail-fast: true + matrix: + php: ['7.4', '8.2'] + dependency-version: [prefer-stable] + steps: + - uses: actions/checkout@v1 + + - name: Install dependencies + run: composer install --no-progress --no-suggest + + - name: Run integration test suite + run: vendor/bin/simple-phpunit --testsuite=integration From 73727a59ebe0b5dfb6a7156e7e1ec01531876071 Mon Sep 17 00:00:00 2001 From: Nuryagdy Mustapayev Date: Sun, 19 May 2024 19:12:09 +0200 Subject: [PATCH 07/10] trying to fix pipeline --- .github/workflows/ci-php.yml | 2 +- README.md | 2 +- composer.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-php.yml b/.github/workflows/ci-php.yml index 14ddf35..86229f9 100644 --- a/.github/workflows/ci-php.yml +++ b/.github/workflows/ci-php.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/checkout@v1 - name: Install dependencies - run: composer install --no-progress --no-suggest + run: composer install --no-suggest - name: Run integration test suite run: vendor/bin/simple-phpunit --testsuite=integration diff --git a/README.md b/README.md index 10533e2..2aef893 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ ## Minimum Gereksinimler - PHP >= 7.4 - - mews/pos ^1.1 + - mews/pos ^1.2 - Symfony 4|5|6|7 ## Kurulum diff --git a/composer.json b/composer.json index bd7f508..edcbd95 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ ], "require": { "php": ">=7.4", - "mews/pos": "^1.1 | ^1.2", + "mews/pos": "^1.2", "symfony/config": "^4.0 | ^5.0 | ^6.0 | ^7.0", "symfony/dependency-injection": "^4.0 | ^5.0 | ^6.0 | ^7.0", "symfony/event-dispatcher": "^4.0 | ^5.0 | ^6.0 | ^7.0", From 8bd25843978f4b0444e7350d5d2cd39b28dfcdb2 Mon Sep 17 00:00:00 2001 From: Nuryagdy Mustapayev Date: Sun, 19 May 2024 19:20:35 +0200 Subject: [PATCH 08/10] trying to fix pipeline --- .github/workflows/ci-php.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci-php.yml b/.github/workflows/ci-php.yml index 86229f9..ba31378 100644 --- a/.github/workflows/ci-php.yml +++ b/.github/workflows/ci-php.yml @@ -4,12 +4,11 @@ on: [push, pull_request] jobs: test: - runs-on: ubuntu-latest strategy: fail-fast: true matrix: - php: ['7.4', '8.2'] + php: ['8.2'] dependency-version: [prefer-stable] steps: - uses: actions/checkout@v1 From 739914f3f593d0cc0b24bd0d026715d94a010c45 Mon Sep 17 00:00:00 2001 From: Nuryagdy Mustapayev Date: Sun, 19 May 2024 19:39:20 +0200 Subject: [PATCH 09/10] trying to fix pipeline --- .github/workflows/ci-php.yml | 3 ++- composer.json | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-php.yml b/.github/workflows/ci-php.yml index ba31378..86229f9 100644 --- a/.github/workflows/ci-php.yml +++ b/.github/workflows/ci-php.yml @@ -4,11 +4,12 @@ on: [push, pull_request] jobs: test: + runs-on: ubuntu-latest strategy: fail-fast: true matrix: - php: ['8.2'] + php: ['7.4', '8.2'] dependency-version: [prefer-stable] steps: - uses: actions/checkout@v1 diff --git a/composer.json b/composer.json index edcbd95..f108d95 100644 --- a/composer.json +++ b/composer.json @@ -37,10 +37,10 @@ "require-dev": { "nyholm/psr7": "^1.8", "psr/http-client": "^1.0", - "symfony/framework-bundle": "^7.0", - "symfony/http-client": "^7.0", - "symfony/phpunit-bridge": "^7.0", - "symfony/yaml": "^7.0" + "symfony/framework-bundle": "^6.0", + "symfony/http-client": "^6.0", + "symfony/phpunit-bridge": "^6.0", + "symfony/yaml": "^6.0" }, "autoload": { "psr-4": { From f30be457249959a5383b7fae6d39f069059e8cd5 Mon Sep 17 00:00:00 2001 From: Nuryagdy Mustapayev Date: Sun, 19 May 2024 19:44:37 +0200 Subject: [PATCH 10/10] trying to fix pipeline --- composer.json | 8 ++++---- tests/Kernel/Kernel.php | 1 + tests/config/framework.yaml | 5 +++++ 3 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 tests/config/framework.yaml diff --git a/composer.json b/composer.json index f108d95..18a4333 100644 --- a/composer.json +++ b/composer.json @@ -37,10 +37,10 @@ "require-dev": { "nyholm/psr7": "^1.8", "psr/http-client": "^1.0", - "symfony/framework-bundle": "^6.0", - "symfony/http-client": "^6.0", - "symfony/phpunit-bridge": "^6.0", - "symfony/yaml": "^6.0" + "symfony/framework-bundle": "^6.4", + "symfony/http-client": "^6.4", + "symfony/phpunit-bridge": "^6.4", + "symfony/yaml": "^6.4" }, "autoload": { "psr-4": { diff --git a/tests/Kernel/Kernel.php b/tests/Kernel/Kernel.php index f7a9dad..147c892 100644 --- a/tests/Kernel/Kernel.php +++ b/tests/Kernel/Kernel.php @@ -23,6 +23,7 @@ public function registerBundles(): iterable public function registerContainerConfiguration(LoaderInterface $loader): void { + $loader->load(__DIR__.'/../config/framework.yaml', 'yaml'); $loader->load(__DIR__.'/../config/services.yaml', 'yaml'); $loader->load(__DIR__.'/../config/mews_pos.yaml', 'yaml'); } diff --git a/tests/config/framework.yaml b/tests/config/framework.yaml new file mode 100644 index 0000000..bacddce --- /dev/null +++ b/tests/config/framework.yaml @@ -0,0 +1,5 @@ +framework: + http_method_override: false + handle_all_throwables: true + php_errors: + log: true