From 3ee3caf3bec41f8f9bc5a2f5caa11073441258e1 Mon Sep 17 00:00:00 2001 From: mustapayev Date: Tue, 23 Sep 2025 14:22:31 +0200 Subject: [PATCH 1/2] mews/pos v1.7 update PayFor Ziraat Katilim Destegi --- README.md | 2 +- composer.json | 2 +- config/laravel-pos.php | 3 +++ docs/EXAMPLE_CONFIGURATIONS.md | 4 ++++ src/Factory/AccountFactory.php | 2 ++ 5 files changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index aeb8439..5665262 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ ### Minimum Gereksinimler - PHP >= 7.4 -- mews/pos ^1.6 +- mews/pos ^1.7 - laravel 8, 9, 10, 11, 12 ### Kurulum diff --git a/composer.json b/composer.json index 593c703..d8a0d11 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "php": ">=7.4", "illuminate/config": "^8.0|^9.0|^10.0|^11.0|^12.0", "illuminate/support": "^8.0|^9.0|^10.0|^11.0|^12.0", - "mews/pos": "^1.6" + "mews/pos": "^1.7" }, "require-dev": { "orchestra/testbench": "^8.17|^9.0|^10.0|^11.0" diff --git a/config/laravel-pos.php b/config/laravel-pos.php index 71a17ee..938d225 100644 --- a/config/laravel-pos.php +++ b/config/laravel-pos.php @@ -45,6 +45,9 @@ // GarantiPos: ProvisionPassword 'refund_user_password' => null, + + // PayForPos only + 'mbr_id' => null, ], 'gateway_endpoints' => [ // Required 'payment_api' => null, // Required diff --git a/docs/EXAMPLE_CONFIGURATIONS.md b/docs/EXAMPLE_CONFIGURATIONS.md index c6f6200..7df1382 100644 --- a/docs/EXAMPLE_CONFIGURATIONS.md +++ b/docs/EXAMPLE_CONFIGURATIONS.md @@ -51,6 +51,9 @@ return [ // GarantiPos: ProvisionPassword 'refund_user_password' => null, + + // PayForPos: MbrId + 'mbr_id' => null, ], 'gateway_endpoints' => [ // Required 'payment_api' => null, // Required @@ -134,6 +137,7 @@ return [ 'user_name' => 'QNB_API_XXXXXXXX', // UserCode: Otorizasyon sistemi kullanıcı kodu. 'user_password' => 'XXXXXXXX', // Otorizasyon sistemi kullanıcı şifresi. 'enc_key' => 'XXXXXXXX', // MerchantPass: 3D Secure şifresidir. + 'mbr_id' => \Mews\Pos\Entity\Account\PayForAccount::MBR_ID_FINANSBANK, // veya MBR_ID_ZIRAAT_KATILIM (Kurum Kodu) ], 'gateway_endpoints' => [ 'payment_api' => 'https://vpostest.qnbfinansbank.com/Gateway/XMLGate.aspx', diff --git a/src/Factory/AccountFactory.php b/src/Factory/AccountFactory.php index 59af4f7..e45dfe9 100644 --- a/src/Factory/AccountFactory.php +++ b/src/Factory/AccountFactory.php @@ -4,6 +4,7 @@ use Mews\Pos\Entity\Account\AbstractPosAccount; use Mews\Pos\Entity\Account\PayFlexAccount; +use Mews\Pos\Entity\Account\PayForAccount; use Mews\Pos\Exceptions\MissingAccountInfoException; use Mews\Pos\Factory\AccountFactory as MewsPosAccountFactory; use Mews\Pos\Gateways\AkbankPos; @@ -69,6 +70,7 @@ public static function create(string $gatewayClass, string $name, array $credent $credentials['payment_model'], $credentials['enc_key'] ?? null, $lang, + $credentials['mbr_id'] ?? PayForAccount::MBR_ID_FINANSBANK, ); case GarantiPos::class: return MewsPosAccountFactory::createGarantiPosAccount( From 6062c7151fb9cbc0c16d54273ad0dec824a118d1 Mon Sep 17 00:00:00 2001 From: mustapayev Date: Thu, 2 Oct 2025 16:43:45 +0200 Subject: [PATCH 2/2] mews/pos v1.7 update: added gateway_configs configuration --- config/laravel-pos.php | 15 ++++++++++----- docs/EXAMPLE_CONFIGURATIONS.md | 35 ++++++++++++++++++++++++++++++++-- src/Factory/GatewayFactory.php | 9 +++++++-- 3 files changed, 50 insertions(+), 9 deletions(-) diff --git a/config/laravel-pos.php b/config/laravel-pos.php index 938d225..6a96ea0 100644 --- a/config/laravel-pos.php +++ b/config/laravel-pos.php @@ -50,12 +50,17 @@ 'mbr_id' => null, ], 'gateway_endpoints' => [ // Required - 'payment_api' => null, // Required - 'gateway_3d' => null, // Required - 'gateway_3d_host' => null, - 'query_api' => null, + 'payment_api' => null, // Required + 'gateway_3d' => null, // Required + 'gateway_3d_host' => null, + 'query_api' => null, + ], + 'gateway_configs' => [ // optional + 'test_mode' => false, // default: false + // Hash kontrolü kütühaneden dolayı başarısız sonuçlanıyorsa bu ayarla devre dışı bırakılabilir. + // Ancak hash kontrolünün devre dışı bırakılması güvenlik açığı oluşturabilir. + 'disable_3d_hash_check' => false, // default: false ], - 'test_mode' => false, ], ], ]; diff --git a/docs/EXAMPLE_CONFIGURATIONS.md b/docs/EXAMPLE_CONFIGURATIONS.md index 7df1382..6652f0e 100644 --- a/docs/EXAMPLE_CONFIGURATIONS.md +++ b/docs/EXAMPLE_CONFIGURATIONS.md @@ -61,7 +61,12 @@ return [ 'gateway_3d_host' => null, 'query_api' => null, ], - 'test_mode' => false, + 'gateway_configs' => [ // optional + 'test_mode' => false, // default: false + // Hash kontrolü kütühaneden dolayı başarısız sonuçlanıyorsa bu ayarla devre dışı bırakılabilir. + // Ancak hash kontrolünün devre dışı bırakılması güvenlik açığı oluşturabilir. + 'disable_3d_hash_check' => false, // default: false + ], ], ], ]; @@ -87,7 +92,6 @@ return [ 'estpos_payten' => [ 'gateway_class' => \Mews\Pos\Gateways\EstV3Pos::class, 'lang' => \Mews\Pos\PosInterface::LANG_TR, // optional - 'test_mode' => true, // optional 'credentials' => [ 'payment_model' => \Mews\Pos\PosInterface::MODEL_3D_SECURE, 'merchant_id' => '700XXXXXXX', @@ -145,6 +149,26 @@ return [ 'gateway_3d_host' => 'https://vpostest.qnbfinansbank.com/Gateway/3DHost.aspx', ], ], + 'payfor_ziraat_katilim' => [ + 'gateway_class' => \Mews\Pos\Gateways\PayForPos::class, + 'credentials' => [ + 'payment_model' => \Mews\Pos\PosInterface::MODEL_3D_SECURE, + 'merchant_id' => '08530000XXXXXXXX', // Üye İşyeri Numarası. + 'user_name' => 'ZIRAAT_KATILIM_API_XXXXXXXX', // UserCode: Otorizasyon sistemi kullanıcı kodu. + 'user_password' => 'XXXXXXXX', // Otorizasyon sistemi kullanıcı şifresi. + 'enc_key' => 'XXXXXXXX', // MerchantPass: 3D Secure şifresidir. + 'mbr_id' => \Mews\Pos\Entity\Account\PayForAccount::MBR_ID_ZIRAAT_KATILIM, // (Kurum Kodu) + ], + 'gateway_configs' => [ + // Ziraat Katilim için hash kontrolü çalışmıyor. O yüzden devre dışı bırakıyoruz. + 'disable_3d_hash_check' => true, + ], + 'gateway_endpoints' => [ + 'payment_api' => 'https://payfortestziraatkatilim.cordisnetwork.com/Mpi/XMLGate.aspx', + 'gateway_3d' => 'https://payfortestziraatkatilim.cordisnetwork.com/Mpi/Default.aspx', + 'gateway_3d_host' => 'https://payfortestziraatkatilim.cordisnetwork.com/Mpi/3DHost.aspx', + ], + ], 'garanti' => [ 'gateway_class' => \Mews\Pos\Gateways\GarantiPos::class, 'credentials' => [ @@ -161,6 +185,9 @@ return [ 'payment_api' => 'https://sanalposprovtest.garantibbva.com.tr/VPServlet', 'gateway_3d' => 'https://sanalposprovtest.garantibbva.com.tr/servlet/gt3dengine', ], + 'gateway_configs' => [ // optional + 'test_mode' => true, // test ortamı için true + ], ], 'interpos_denizbank' => [ 'gateway_class' => \Mews\Pos\Gateways\InterPos::class, @@ -186,6 +213,10 @@ return [ 'user_name' => 'apiXXXXXXXX', // UserName: https://kurumsal.kuveytturk.com.tr adresine login olarak kullanıcı işlemleri sayfasında APİ rolünde kullanıcı oluşturulmalıdır. 'enc_key' => 'ApiXXXXXXXX', // Password: Oluşturulan APİ kullanıcısının şifre bilgisidir. ], + 'gateway_configs' => [ + // Testlerinizi SSL olmayan ortamda yapıyorsanız true yapmanız gerekir. + 'test_mode' => true, + ], 'gateway_endpoints' => [ 'payment_api' => 'https://boatest.kuveytturk.com.tr/boa.virtualpos.services/Home', 'gateway_3d' => 'https://boatest.kuveytturk.com.tr/boa.virtualpos.services/Home/ThreeDModelPayGate', diff --git a/src/Factory/GatewayFactory.php b/src/Factory/GatewayFactory.php index 668a24a..b8052d0 100644 --- a/src/Factory/GatewayFactory.php +++ b/src/Factory/GatewayFactory.php @@ -51,7 +51,10 @@ public static function create( /** @var PosInterface $gateway */ $gateway = new $gatewayClass( - ['gateway_endpoints' => $options['gateway_endpoints']], + [ + 'gateway_endpoints' => $options['gateway_endpoints'], + 'gateway_configs' => $options['gateway_configs'] ?? [], + ], $account, $requestDataMapper, $responseDataMapper, @@ -61,7 +64,9 @@ public static function create( $logger, ); - $gateway->setTestMode($options['test_mode'] ?? false); + if (!isset($options['gateway_configs']['test_mode']) && isset($options['test_mode'])) { + $gateway->setTestMode($options['test_mode']); + } return $gateway; }