Skip to content

Commit

Permalink
Merge pull request #28 from nuryagdym/master
Browse files Browse the repository at this point in the history
Vakifbank VPOS eklendi
  • Loading branch information
mewebstudio authored Jun 1, 2021
2 parents 4e9def2 + 4dc3b3b commit 7484b3e
Show file tree
Hide file tree
Showing 86 changed files with 4,326 additions and 2,268 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ YapıKredi Posnet sistemi 3D ödeme çalışmaktadır, fakat `cancel`, `refund`

Finansbank'ın PayFor sanal pos sistemini desteklemektedir, Finansbank'ın IP kısıtlaması olmadığı için localhost'ta test `examples` klasöründeki örnek kodları çalıştırabilirsiniz.

VakifBank GET 7/24 MPI ve VPOS 7/24 eklendi ama test ortami olmadigi icin test edilemedi, gelen geri donuslere gore hatalar giderilecek.
> EST altyapısında olan Akbank, TEB ve Ziraat bankası test edilmiştir.
### Özellikler
Expand Down Expand Up @@ -82,7 +83,7 @@ $order = [
'name' => 'John Doe', // zorunlu değil
'email' => '[email protected]', // zorunlu değil
'user_id' => '12', // zorunlu değil
'amount' => (double) 20, // Sipariş tutarı
'amount' => (float) 20, // Sipariş tutarı
'installment' => '0',
'currency' => 'TRY',
'ip' => $ip,
Expand Down
14 changes: 13 additions & 1 deletion config/pos.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,18 @@
'test' => 'https://vpostest.qnbfinansbank.com/Gateway/3DHost.aspx',
],
]
]
],
'vakifbank' => [
'name' => 'VakifBank-VPOS',
'class' => Mews\Pos\Gateways\VakifBankPos::class,
'urls' => [
'production' => 'https://onlineodeme.vakifbank.com.tr:4443/VposService/v3/Vposreq.aspx',
'test' => 'https://onlineodemetest.vakifbank.com.tr:4443/VposService/v3/Vposreq.aspx',
'gateway' => [
'production' => 'https://3dsecure.vakifbank.com.tr:4443/MPIAPI/MPI_Enrollment.aspx',
'test' => 'https://3dsecuretest.vakifbank.com.tr:4443/MPIAPI/MPI_Enrollment.aspx',
],
],
],
],
];
69 changes: 37 additions & 32 deletions examples/akbank/3d-pay/form.php
Original file line number Diff line number Diff line change
@@ -1,41 +1,46 @@
<?php

use Mews\Pos\Entity\Card\CreditCardEstPos;
use Mews\Pos\Gateways\AbstractGateway;
use Mews\Pos\Gateways\EstPos;
use Symfony\Component\HttpFoundation\RedirectResponse;

require '_config.php';

require '../../template/_header.php';

if ($request->getMethod() !== 'POST') {
echo new \Symfony\Component\HttpFoundation\RedirectResponse($baseUrl);
echo new RedirectResponse($baseUrl);
exit();
}

$orderId = date('Ymd') . strtoupper(substr(uniqid(sha1(time())),0,4));
$orderId = date('Ymd').strtoupper(substr(uniqid(sha1(time())), 0, 4));

$amount = (double) 32.0;
$instalment = '0';
$amount = (float) 32.0;
$installment = '0';

$success_url = $baseUrl . 'response.php';
$fail_url = $baseUrl . 'response.php';
$successUrl = $baseUrl.'response.php';
$failUrl = $baseUrl.'response.php';

$rand = microtime();

$order = [
'id' => $orderId,
'email' => '[email protected]', // optional
'name' => 'John Doe', // optional
'amount' => $amount,
'installment' => $instalment,
'currency' => 'TRY',
'ip' => $ip,
'success_url' => $success_url,
'fail_url' => $fail_url,
'lang' => \Mews\Pos\Gateways\EstPos::LANG_TR,
'rand' => $rand,
'id' => $orderId,
'email' => '[email protected]', // optional
'name' => 'John Doe', // optional
'amount' => $amount,
'installment' => $installment,
'currency' => 'TRY',
'ip' => $ip,
'success_url' => $successUrl,
'fail_url' => $failUrl,
'lang' => EstPos::LANG_TR,
'rand' => $rand,
];

$redis->lPush('order', json_encode($order));

$card = new \Mews\Pos\Entity\Card\CreditCardEstPos(
$card = new CreditCardEstPos(
$request->get('number'),
$request->get('year'),
$request->get('month'),
Expand All @@ -44,20 +49,20 @@
$request->get('type')
);

$pos->prepare($order, \Mews\Pos\Gateways\AbstractGateway::TX_PAY, $card);
$pos->prepare($order, AbstractGateway::TX_PAY, $card);

$form_data = $pos->get3DFormData();
$formData = $pos->get3DFormData();
?>

<form method="post" action="<?php echo $form_data['gateway']; ?>" class="redirect-form" role="form">
<?php foreach ($form_data['inputs'] as $key => $value): ?>
<input type="hidden" name="<?php echo $key; ?>" value="<?php echo $value; ?>">
<?php endforeach; ?>
<div class="text-center">Redirecting...</div>
<hr>
<div class="form-group text-center">
<button type="submit" class="btn btn-lg btn-block btn-success">Submit</button>
</div>
</form>

<?php require '../../template/_footer.php'; ?>
<form method="post" action="<?= $formData['gateway']; ?>" class="redirect-form" role="form">
<?php foreach ($formData['inputs'] as $key => $value) : ?>
<input type="hidden" name="<?= $key; ?>" value="<?= $value; ?>">
<?php endforeach; ?>
<div class="text-center">Redirecting...</div>
<hr>
<div class="form-group text-center">
<button type="submit" class="btn btn-lg btn-block btn-success">Submit</button>
</div>
</form>

<?php require '../../template/_footer.php';
93 changes: 47 additions & 46 deletions examples/akbank/3d-pay/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,54 +4,55 @@

require '../../template/_header.php';

$url = $baseUrl . 'form.php';
$url = $baseUrl.'form.php';
?>

<form method="post" action="<?php echo $url; ?>" role="form">
<div class="row">
<div class="form-group col-sm-12">
<label for="name">Card holder name</label>
<input type="text" name="name" id="name" class="form-control input-lg" placeholder="Card holder name">
<form method="post" action="<?= $url; ?>" role="form">
<div class="row">
<div class="form-group col-sm-12">
<label for="name">Card holder name</label>
<input type="text" name="name" id="name" class="form-control input-lg" placeholder="Card holder name">
</div>
<div class="form-group col-sm-3">
<label for="type">Card Type</label>
<select name="type" id="type" class="form-control input-lg">
<option value="">Type</option>
<option value="visa">Visa</option>
<option value="master">MasterCard</option>
</select>
</div>
<div class="form-group col-sm-9">
<label for="number">Card Number</label>
<input type="text" name="number" id="number" class="form-control input-lg"
placeholder="Credit card number">
</div>
<div class="form-group col-sm-4">
<label for="month">Expire Month</label>
<select name="month" id="month" class="form-control input-lg">
<option value="">Month</option>
<?php for ($i = 1; $i <= 12; $i++) : ?>
<option value="<?= $i; ?>"><?= str_pad($i, 2, 0, STR_PAD_LEFT); ?></option>
<?php endfor; ?>
</select>
</div>
<div class="form-group col-sm-4">
<label for="year">Expire Year</label>
<select name="year" id="year" class="form-control input-lg">
<option value="">Year</option>
<?php for ($i = date('y'); $i <= date('y') + 20; $i++) : ?>
<option value="<?= $i; ?>"><?= 2000 + $i; ?></option>
<?php endfor; ?>
</select>
</div>
<div class="form-group col-sm-4">
<label for="cvv">Cvv</label>
<input type="text" name="cvv" id="cvv" class="form-control input-lg" placeholder="Cvv">
</div>
</div>
<div class="form-group col-sm-3">
<label for="type">Card Type</label>
<select name="type" id="type" class="form-control input-lg">
<option value="">Type</option>
<option value="visa">Visa</option>
<option value="master">MasterCard</option>
</select>
<hr>
<div class="form-group text-center">
<button type="submit" class="btn btn-lg btn-block btn-success">Payment</button>
</div>
<div class="form-group col-sm-9">
<label for="number">Card Number</label>
<input type="text" name="number" id="number" class="form-control input-lg" placeholder="Credit card number">
</div>
<div class="form-group col-sm-4">
<label for="month">Expire Month</label>
<select name="month" id="month" class="form-control input-lg">
<option value="">Month</option>
<?php for ($i = 1; $i <= 12; $i++): ?>
<option value="<?php echo $i; ?>"><?php echo str_pad($i, 2, 0, STR_PAD_LEFT); ?></option>
<?php endfor; ?>
</select>
</div>
<div class="form-group col-sm-4">
<label for="year">Expire Year</label>
<select name="year" id="year" class="form-control input-lg">
<option value="">Year</option>
<?php for ($i = date('y'); $i <= date('y') + 20; $i++): ?>
<option value="<?php echo $i; ?>"><?php echo 2000 + $i; ?></option>
<?php endfor; ?>
</select>
</div>
<div class="form-group col-sm-4">
<label for="cvv">Cvv</label>
<input type="text" name="cvv" id="cvv" class="form-control input-lg" placeholder="Cvv">
</div>
</div>
<hr>
<div class="form-group text-center">
<button type="submit" class="btn btn-lg btn-block btn-success">Payment</button>
</div>
</form>
</form>

<?php require '../../template/_footer.php'; ?>
<?php require '../../template/_footer.php';
Loading

0 comments on commit 7484b3e

Please sign in to comment.