Skip to content

Commit 6062c71

Browse files
committed
mews/pos v1.7 update: added gateway_configs configuration
1 parent 3ee3caf commit 6062c71

File tree

3 files changed

+50
-9
lines changed

3 files changed

+50
-9
lines changed

config/laravel-pos.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,17 @@
5050
'mbr_id' => null,
5151
],
5252
'gateway_endpoints' => [ // Required
53-
'payment_api' => null, // Required
54-
'gateway_3d' => null, // Required
55-
'gateway_3d_host' => null,
56-
'query_api' => null,
53+
'payment_api' => null, // Required
54+
'gateway_3d' => null, // Required
55+
'gateway_3d_host' => null,
56+
'query_api' => null,
57+
],
58+
'gateway_configs' => [ // optional
59+
'test_mode' => false, // default: false
60+
// Hash kontrolü kütühaneden dolayı başarısız sonuçlanıyorsa bu ayarla devre dışı bırakılabilir.
61+
// Ancak hash kontrolünün devre dışı bırakılması güvenlik açığı oluşturabilir.
62+
'disable_3d_hash_check' => false, // default: false
5763
],
58-
'test_mode' => false,
5964
],
6065
],
6166
];

docs/EXAMPLE_CONFIGURATIONS.md

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,12 @@ return [
6161
'gateway_3d_host' => null,
6262
'query_api' => null,
6363
],
64-
'test_mode' => false,
64+
'gateway_configs' => [ // optional
65+
'test_mode' => false, // default: false
66+
// Hash kontrolü kütühaneden dolayı başarısız sonuçlanıyorsa bu ayarla devre dışı bırakılabilir.
67+
// Ancak hash kontrolünün devre dışı bırakılması güvenlik açığı oluşturabilir.
68+
'disable_3d_hash_check' => false, // default: false
69+
],
6570
],
6671
],
6772
];
@@ -87,7 +92,6 @@ return [
8792
'estpos_payten' => [
8893
'gateway_class' => \Mews\Pos\Gateways\EstV3Pos::class,
8994
'lang' => \Mews\Pos\PosInterface::LANG_TR, // optional
90-
'test_mode' => true, // optional
9195
'credentials' => [
9296
'payment_model' => \Mews\Pos\PosInterface::MODEL_3D_SECURE,
9397
'merchant_id' => '700XXXXXXX',
@@ -145,6 +149,26 @@ return [
145149
'gateway_3d_host' => 'https://vpostest.qnbfinansbank.com/Gateway/3DHost.aspx',
146150
],
147151
],
152+
'payfor_ziraat_katilim' => [
153+
'gateway_class' => \Mews\Pos\Gateways\PayForPos::class,
154+
'credentials' => [
155+
'payment_model' => \Mews\Pos\PosInterface::MODEL_3D_SECURE,
156+
'merchant_id' => '08530000XXXXXXXX', // Üye İşyeri Numarası.
157+
'user_name' => 'ZIRAAT_KATILIM_API_XXXXXXXX', // UserCode: Otorizasyon sistemi kullanıcı kodu.
158+
'user_password' => 'XXXXXXXX', // Otorizasyon sistemi kullanıcı şifresi.
159+
'enc_key' => 'XXXXXXXX', // MerchantPass: 3D Secure şifresidir.
160+
'mbr_id' => \Mews\Pos\Entity\Account\PayForAccount::MBR_ID_ZIRAAT_KATILIM, // (Kurum Kodu)
161+
],
162+
'gateway_configs' => [
163+
// Ziraat Katilim için hash kontrolü çalışmıyor. O yüzden devre dışı bırakıyoruz.
164+
'disable_3d_hash_check' => true,
165+
],
166+
'gateway_endpoints' => [
167+
'payment_api' => 'https://payfortestziraatkatilim.cordisnetwork.com/Mpi/XMLGate.aspx',
168+
'gateway_3d' => 'https://payfortestziraatkatilim.cordisnetwork.com/Mpi/Default.aspx',
169+
'gateway_3d_host' => 'https://payfortestziraatkatilim.cordisnetwork.com/Mpi/3DHost.aspx',
170+
],
171+
],
148172
'garanti' => [
149173
'gateway_class' => \Mews\Pos\Gateways\GarantiPos::class,
150174
'credentials' => [
@@ -161,6 +185,9 @@ return [
161185
'payment_api' => 'https://sanalposprovtest.garantibbva.com.tr/VPServlet',
162186
'gateway_3d' => 'https://sanalposprovtest.garantibbva.com.tr/servlet/gt3dengine',
163187
],
188+
'gateway_configs' => [ // optional
189+
'test_mode' => true, // test ortamı için true
190+
],
164191
],
165192
'interpos_denizbank' => [
166193
'gateway_class' => \Mews\Pos\Gateways\InterPos::class,
@@ -186,6 +213,10 @@ return [
186213
'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.
187214
'enc_key' => 'ApiXXXXXXXX', // Password: Oluşturulan APİ kullanıcısının şifre bilgisidir.
188215
],
216+
'gateway_configs' => [
217+
// Testlerinizi SSL olmayan ortamda yapıyorsanız true yapmanız gerekir.
218+
'test_mode' => true,
219+
],
189220
'gateway_endpoints' => [
190221
'payment_api' => 'https://boatest.kuveytturk.com.tr/boa.virtualpos.services/Home',
191222
'gateway_3d' => 'https://boatest.kuveytturk.com.tr/boa.virtualpos.services/Home/ThreeDModelPayGate',

src/Factory/GatewayFactory.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ public static function create(
5151

5252
/** @var PosInterface $gateway */
5353
$gateway = new $gatewayClass(
54-
['gateway_endpoints' => $options['gateway_endpoints']],
54+
[
55+
'gateway_endpoints' => $options['gateway_endpoints'],
56+
'gateway_configs' => $options['gateway_configs'] ?? [],
57+
],
5558
$account,
5659
$requestDataMapper,
5760
$responseDataMapper,
@@ -61,7 +64,9 @@ public static function create(
6164
$logger,
6265
);
6366

64-
$gateway->setTestMode($options['test_mode'] ?? false);
67+
if (!isset($options['gateway_configs']['test_mode']) && isset($options['test_mode'])) {
68+
$gateway->setTestMode($options['test_mode']);
69+
}
6570

6671
return $gateway;
6772
}

0 commit comments

Comments
 (0)