Skip to content

Commit ef99b03

Browse files
authored
Merge pull request #29 from mewebstudio/mewspos-v16-update
Mewspos v1.6 update
2 parents 65674b6 + 91327fc commit ef99b03

File tree

4 files changed

+64
-61
lines changed

4 files changed

+64
-61
lines changed

README.md

Lines changed: 36 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

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

2020
### Kurulum
@@ -148,60 +148,24 @@
148148
if ($event->getGatewayClass() !== \Mews\Pos\Gateways\KuveytPos::class) {
149149
return;
150150
}
151-
152151
/**
153152
* ekstra eklenmesi gereken verileri isteseniz $order icine ekleyip sonra o verilere
154153
* $event->getOrder() ile erisebilirsiniz.
155154
*/
156155
$additionalRequestDataForKuveyt = [
157156
'DeviceData' => [
158-
/**
159-
* DeviceChannel : DeviceData alanı içerisinde gönderilmesi beklenen işlemin yapıldığı cihaz bilgisi.
160-
* 2 karakter olmalıdır. 01-Mobil, 02-Web Browser için kullanılmalıdır.
161-
*/
162157
'DeviceChannel' => '02',
163158
],
164159
'CardHolderData' => [
165-
/**
166-
* BillAddrCity: Kullanılan kart ile ilişkili kart hamilinin fatura adres şehri.
167-
* Maksimum 50 karakter uzunluğunda olmalıdır.
168-
*/
169160
'BillAddrCity' => 'İstanbul',
170-
/**
171-
* BillAddrCountry Kullanılan kart ile ilişkili kart hamilinin fatura adresindeki ülke kodu.
172-
* Maksimum 3 karakter uzunluğunda olmalıdır.
173-
* ISO 3166-1 sayısal üç haneli ülke kodu standardı kullanılmalıdır.
174-
*/
175161
'BillAddrCountry' => '792',
176-
/**
177-
* BillAddrLine1: Kullanılan kart ile ilişkili kart hamilinin teslimat adresinde yer alan sokak vb. bilgileri içeren açık adresi.
178-
* Maksimum 150 karakter uzunluğunda olmalıdır.
179-
*/
180162
'BillAddrLine1' => 'XXX Mahallesi XXX Caddesi No 55 Daire 1',
181-
/**
182-
* BillAddrPostCode: Kullanılan kart ile ilişkili kart hamilinin fatura adresindeki posta kodu.
183-
*/
184163
'BillAddrPostCode' => '34000',
185-
/**
186-
* BillAddrState: CardHolderData alanı içerisinde gönderilmesi beklenen ödemede kullanılan kart ile ilişkili kart hamilinin fatura adresindeki il veya eyalet bilgisi kodu.
187-
* ISO 3166-2'de tanımlı olan il/eyalet kodu olmalıdır.
188-
*/
189164
'BillAddrState' => '40',
190-
/**
191-
* Email: Kullanılan kart ile ilişkili kart hamilinin iş yerinde oluşturduğu hesapta kullandığı email adresi.
192-
* Maksimum 254 karakter uzunluğunda olmalıdır.
193-
*/
194165
'Email' => 'xxxxx@gmail.com',
195166
'MobilePhone' => [
196-
/**
197-
* Cc: Kullanılan kart ile ilişkili kart hamilinin cep telefonuna ait ülke kodu. 1-3 karakter uzunluğunda olmalıdır.
198-
*/
199167
'Cc' => '90',
200-
/**
201-
* Subscriber: Kullanılan kart ile ilişkili kart hamilinin cep telefonuna ait abone numarası.
202-
* Maksimum 15 karakter uzunluğunda olmalıdır.
203-
*/
204-
'Subscriber' => '1234567899',
168+
'Subscriber' => '5554567899',
205169
],
206170
],
207171
];
@@ -311,7 +275,18 @@ class ThreeDSecurePaymentController extends Controller
311275
$session->set('tx', $transaction);
312276
313277
try {
314-
$formData = $this->pos->get3DFormData($order, $this->paymentModel, $transaction, $card);
278+
$formData = $this->pos->get3DFormData(
279+
$order,
280+
$this->paymentModel,
281+
$transaction,
282+
$card,
283+
/**
284+
* MODEL_3D_SECURE veya MODEL_3D_PAY ödemelerde kredi kart verileri olmadan
285+
* form verisini oluşturmak için true yapabilirsiniz.
286+
* Yine de bazı gatewaylerde kartsız form verisi oluşturulamıyor.
287+
*/
288+
false
289+
);
315290
} catch (\Throwable $e) {
316291
dd($e);
317292
}
@@ -442,24 +417,28 @@ Route::match(['GET','POST'], '/payment/3d/response', [\App\Http\Controllers\Thre
442417
443418
```html
444419
<!--/resources/views/redirect-form.blade.php-->
445-
<form method="{{ $formData['method'] }}" action="{{ $formData['gateway'] }}" class="redirect-form" role="form">
446-
@foreach($formData['inputs'] as $key => $value)
447-
<input type="hidden" name="{{ $key }}" value="{{ $value }}">
448-
@endforeach
449-
<div class="text-center">Redirecting...</div>
450-
<hr>
451-
<div class="form-group text-center">
452-
<button type="submit" class="btn btn-lg btn-block btn-success">Submit</button>
453-
</div>
454-
455-
</form>
456-
<script>
457-
// Formu JS ile otomatik submit ederek kullaniciyi banka gatewayine yonlendiriyoruz.
458-
let redirectForm = document.querySelector('form.redirect-form');
459-
if (redirectForm) {
460-
redirectForm.submit();
461-
}
462-
</script>
420+
@if(is_string($formData))
421+
{!! $formData !!}
422+
@else
423+
<form method="{{ $formData['method'] }}" action="{{ $formData['gateway'] }}" class="redirect-form" role="form">
424+
@foreach($formData['inputs'] as $key => $value)
425+
<input type="hidden" name="{{ $key }}" value="{{ $value }}">
426+
@endforeach
427+
<div class="text-center">Redirecting...</div>
428+
<hr>
429+
<div class="form-group text-center">
430+
<button type="submit" class="btn btn-lg btn-block btn-success">Submit</button>
431+
</div>
432+
433+
</form>
434+
<script>
435+
// Formu JS ile otomatik submit ederek kullaniciyi banka gatewayine yonlendiriyoruz.
436+
let redirectForm = document.querySelector('form.redirect-form');
437+
if (redirectForm) {
438+
redirectForm.submit();
439+
}
440+
</script>
441+
@endif
463442
```
464443
465444
### Troubleshoots

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.3"
26+
"mews/pos": "^1.6"
2727
},
2828
"require-dev": {
2929
"orchestra/testbench": "^8.17|^9.0|^10.0|^11.0"

docs/EXAMPLE_CONFIGURATIONS.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,8 @@ return [
226226
'user_password' => 'XXXXXXXX', // Password: Üye işyeri şifresi
227227
],
228228
'gateway_endpoints' => [
229-
'payment_api' => 'https://cptest.vakifbank.com.tr/CommonPayment/api/RegisterTransaction',
230-
'gateway_3d' => 'https://cptest.vakifbank.com.tr/CommonPayment/api/VposTransaction',
231-
'query_api' => 'https://cptest.vakifbank.com.tr/CommonPayment/SecurePayment',
229+
'payment_api' => 'https://cptest.vakifbank.com.tr/CommonPayment/api/VposTransaction',
230+
'gateway_3d' => 'https://cptest.vakifbank.com.tr/CommonPayment/api/RegisterTransaction',
232231
],
233232
],
234233
'akbankpos' => [
@@ -259,6 +258,22 @@ return [
259258
'gateway_3d_host' => 'https://prepentegrasyon.tosla.com/api/Payment/threeDSecure',
260259
],
261260
],
261+
'parampos' => [
262+
'gateway_class' => \Mews\Pos\Gateways\ParamPos::class,
263+
'credentials' => [
264+
'payment_model' => \Mews\Pos\PosInterface::MODEL_3D_SECURE,
265+
'merchant_id' => '12345', // CLIENT_CODE Terminal ID
266+
'user_name' => 'TestUser', // CLIENT_USERNAME Kullanıcı adı
267+
'user_password' => 'TestPassword', // CLIENT_PASSWORD Şifre
268+
'enc_key' => 'kjsdfk-lkjdf-kjshdf-kjhfdsk-jfhshfsdfdsjf', // GUID Üye İşyeri ait anahtarı
269+
],
270+
'gateway_endpoints' => [
271+
'payment_api' => 'https://test-dmz.param.com.tr/turkpos.ws/service_turkpos_test.asmx',
272+
// API URL for 3D host payment
273+
'payment_api_2' => 'https://test-pos.param.com.tr/to.ws/Service_Odeme.asmx',
274+
'gateway_3d_host' => 'https://test-pos.param.com.tr/default.aspx',
275+
],
276+
],
262277
],
263278
];
264279
```

src/Factory/AccountFactory.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Mews\Pos\Gateways\GarantiPos;
1313
use Mews\Pos\Gateways\InterPos;
1414
use Mews\Pos\Gateways\KuveytPos;
15+
use Mews\Pos\Gateways\ParamPos;
1516
use Mews\Pos\Gateways\PayFlexCPV4Pos;
1617
use Mews\Pos\Gateways\PayFlexV4Pos;
1718
use Mews\Pos\Gateways\PayForPos;
@@ -131,6 +132,14 @@ public static function create(string $gatewayClass, string $name, array $credent
131132
$credentials['user_name'],
132133
$credentials['enc_key'],
133134
);
135+
case ParamPos::class:
136+
return MewsPosAccountFactory::createParamPosAccount(
137+
$name,
138+
$credentials['merchant_id'],
139+
$credentials['user_name'],
140+
$credentials['user_password'],
141+
$credentials['enc_key'],
142+
);
134143
}
135144

136145
throw new \DomainException(

0 commit comments

Comments
 (0)