Skip to content

Commit 646f876

Browse files
authored
Merge pull request #32 from mewebstudio/payfor-ziraat-katilim-destegi
mews/pos v1.7 update
2 parents 3bb4abf + 6062c71 commit 646f876

File tree

6 files changed

+61
-11
lines changed

6 files changed

+61
-11
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
### Minimum Gereksinimler
1616
- PHP >= 7.4
17-
- mews/pos ^1.6
17+
- mews/pos ^1.7
1818
- laravel 8, 9, 10, 11, 12
1919

2020
### Kurulum

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"php": ">=7.4",
2424
"illuminate/config": "^8.0|^9.0|^10.0|^11.0|^12.0",
2525
"illuminate/support": "^8.0|^9.0|^10.0|^11.0|^12.0",
26-
"mews/pos": "^1.6"
26+
"mews/pos": "^1.7"
2727
},
2828
"require-dev": {
2929
"orchestra/testbench": "^8.17|^9.0|^10.0|^11.0"

config/laravel-pos.php

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,22 @@
4545

4646
// GarantiPos: ProvisionPassword
4747
'refund_user_password' => null,
48+
49+
// PayForPos only
50+
'mbr_id' => null,
4851
],
4952
'gateway_endpoints' => [ // Required
50-
'payment_api' => null, // Required
51-
'gateway_3d' => null, // Required
52-
'gateway_3d_host' => null,
53-
'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
5463
],
55-
'test_mode' => false,
5664
],
5765
],
5866
];

docs/EXAMPLE_CONFIGURATIONS.md

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,22 @@ return [
5151

5252
// GarantiPos: ProvisionPassword
5353
'refund_user_password' => null,
54+
55+
// PayForPos: MbrId
56+
'mbr_id' => null,
5457
],
5558
'gateway_endpoints' => [ // Required
5659
'payment_api' => null, // Required
5760
'gateway_3d' => null, // Required
5861
'gateway_3d_host' => null,
5962
'query_api' => null,
6063
],
61-
'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+
],
6270
],
6371
],
6472
];
@@ -84,7 +92,6 @@ return [
8492
'estpos_payten' => [
8593
'gateway_class' => \Mews\Pos\Gateways\EstV3Pos::class,
8694
'lang' => \Mews\Pos\PosInterface::LANG_TR, // optional
87-
'test_mode' => true, // optional
8895
'credentials' => [
8996
'payment_model' => \Mews\Pos\PosInterface::MODEL_3D_SECURE,
9097
'merchant_id' => '700XXXXXXX',
@@ -134,13 +141,34 @@ return [
134141
'user_name' => 'QNB_API_XXXXXXXX', // UserCode: Otorizasyon sistemi kullanıcı kodu.
135142
'user_password' => 'XXXXXXXX', // Otorizasyon sistemi kullanıcı şifresi.
136143
'enc_key' => 'XXXXXXXX', // MerchantPass: 3D Secure şifresidir.
144+
'mbr_id' => \Mews\Pos\Entity\Account\PayForAccount::MBR_ID_FINANSBANK, // veya MBR_ID_ZIRAAT_KATILIM (Kurum Kodu)
137145
],
138146
'gateway_endpoints' => [
139147
'payment_api' => 'https://vpostest.qnbfinansbank.com/Gateway/XMLGate.aspx',
140148
'gateway_3d' => 'https://vpostest.qnbfinansbank.com/Gateway/Default.aspx',
141149
'gateway_3d_host' => 'https://vpostest.qnbfinansbank.com/Gateway/3DHost.aspx',
142150
],
143151
],
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+
],
144172
'garanti' => [
145173
'gateway_class' => \Mews\Pos\Gateways\GarantiPos::class,
146174
'credentials' => [
@@ -157,6 +185,9 @@ return [
157185
'payment_api' => 'https://sanalposprovtest.garantibbva.com.tr/VPServlet',
158186
'gateway_3d' => 'https://sanalposprovtest.garantibbva.com.tr/servlet/gt3dengine',
159187
],
188+
'gateway_configs' => [ // optional
189+
'test_mode' => true, // test ortamı için true
190+
],
160191
],
161192
'interpos_denizbank' => [
162193
'gateway_class' => \Mews\Pos\Gateways\InterPos::class,
@@ -182,6 +213,10 @@ return [
182213
'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.
183214
'enc_key' => 'ApiXXXXXXXX', // Password: Oluşturulan APİ kullanıcısının şifre bilgisidir.
184215
],
216+
'gateway_configs' => [
217+
// Testlerinizi SSL olmayan ortamda yapıyorsanız true yapmanız gerekir.
218+
'test_mode' => true,
219+
],
185220
'gateway_endpoints' => [
186221
'payment_api' => 'https://boatest.kuveytturk.com.tr/boa.virtualpos.services/Home',
187222
'gateway_3d' => 'https://boatest.kuveytturk.com.tr/boa.virtualpos.services/Home/ThreeDModelPayGate',

src/Factory/AccountFactory.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Mews\Pos\Entity\Account\AbstractPosAccount;
66
use Mews\Pos\Entity\Account\PayFlexAccount;
7+
use Mews\Pos\Entity\Account\PayForAccount;
78
use Mews\Pos\Exceptions\MissingAccountInfoException;
89
use Mews\Pos\Factory\AccountFactory as MewsPosAccountFactory;
910
use Mews\Pos\Gateways\AkbankPos;
@@ -69,6 +70,7 @@ public static function create(string $gatewayClass, string $name, array $credent
6970
$credentials['payment_model'],
7071
$credentials['enc_key'] ?? null,
7172
$lang,
73+
$credentials['mbr_id'] ?? PayForAccount::MBR_ID_FINANSBANK,
7274
);
7375
case GarantiPos::class:
7476
return MewsPosAccountFactory::createGarantiPosAccount(

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)