Skip to content

Commit 91327fc

Browse files
author
mustapayev
committed
mews/pos v1.6 update
1 parent 306d3a0 commit 91327fc

File tree

4 files changed

+63
-24
lines changed

4 files changed

+63
-24
lines changed

README.md

Lines changed: 35 additions & 20 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
@@ -275,7 +275,18 @@ class ThreeDSecurePaymentController extends Controller
275275
$session->set('tx', $transaction);
276276
277277
try {
278-
$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+
);
279290
} catch (\Throwable $e) {
280291
dd($e);
281292
}
@@ -406,24 +417,28 @@ Route::match(['GET','POST'], '/payment/3d/response', [\App\Http\Controllers\Thre
406417
407418
```html
408419
<!--/resources/views/redirect-form.blade.php-->
409-
<form method="{{ $formData['method'] }}" action="{{ $formData['gateway'] }}" class="redirect-form" role="form">
410-
@foreach($formData['inputs'] as $key => $value)
411-
<input type="hidden" name="{{ $key }}" value="{{ $value }}">
412-
@endforeach
413-
<div class="text-center">Redirecting...</div>
414-
<hr>
415-
<div class="form-group text-center">
416-
<button type="submit" class="btn btn-lg btn-block btn-success">Submit</button>
417-
</div>
418-
419-
</form>
420-
<script>
421-
// Formu JS ile otomatik submit ederek kullaniciyi banka gatewayine yonlendiriyoruz.
422-
let redirectForm = document.querySelector('form.redirect-form');
423-
if (redirectForm) {
424-
redirectForm.submit();
425-
}
426-
</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
427442
```
428443
429444
### 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)