-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63 from mewebstudio/60-vakifbank-odeme-calismiyor
issue #60 Vakifbak 3D secure odeme sorunlari giderildi
- Loading branch information
Showing
31 changed files
with
717 additions
and
554 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,24 @@ | ||
<?php | ||
|
||
use Mews\Pos\Exceptions\BankClassNullException; | ||
use Mews\Pos\Exceptions\BankNotFoundException; | ||
use Mews\Pos\Factory\AccountFactory; | ||
use Mews\Pos\Factory\PosFactory; | ||
use Mews\Pos\Gateways\VakifBankPos; | ||
use Symfony\Component\HttpFoundation\Request; | ||
require '../_payment_config.php'; | ||
|
||
require '../../_main_config.php'; | ||
|
||
$path = '/vakifbank/3d/'; | ||
$baseUrl = $hostUrl.$path; | ||
$baseUrl = $hostUrl.'/vakifbank/3d/'; | ||
|
||
$successUrl = $failUrl = $baseUrl.'response.php'; | ||
|
||
$account = AccountFactory::createVakifBankAccount('vakifbank', '000000000111111', '3XTgER89as', 'VP999999', '3d'); | ||
$merchantId = '000000000111111'; | ||
$terminalId = 'VP000095'; | ||
$isyeriSifre = '3XTgER89as'; | ||
$account = \Mews\Pos\Factory\AccountFactory::createVakifBankAccount( | ||
'vakifbank', | ||
$merchantId, | ||
$isyeriSifre, | ||
$terminalId, | ||
'3d' | ||
); | ||
|
||
$request = Request::createFromGlobals(); | ||
$ip = $request->getClientIp(); | ||
$pos = getGateway($account); | ||
|
||
try { | ||
/** | ||
* @var VakifBankPos $pos | ||
*/ | ||
$pos = PosFactory::createPosGateway($account); | ||
$pos->setTestMode(true); | ||
} catch (BankNotFoundException $e) { | ||
dump($e->getCode(), $e->getMessage()); | ||
} catch (BankClassNullException $e) { | ||
dump($e->getCode(), $e->getMessage()); | ||
} | ||
$transaction = \Mews\Pos\Gateways\AbstractGateway::TX_PAY; | ||
|
||
$templateTitle = '3D Model Payment'; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
use Mews\Pos\Entity\Card\CreditCardVakifBank; | ||
use Symfony\Component\HttpFoundation\RedirectResponse; | ||
|
||
require '_config.php'; | ||
require '../../template/_header.php'; | ||
require '../_header.php'; | ||
|
||
if ($request->getMethod() !== 'POST') { | ||
echo new RedirectResponse($baseUrl.'index.php'); | ||
exit(); | ||
} | ||
|
||
$order = getNewOrder($baseUrl, $ip, $session, $request->get('installment')); | ||
$session->set('order', $order); | ||
|
||
$card = new CreditCardVakifBank( | ||
$request->get('number'), | ||
$request->get('year'), | ||
$request->get('month'), | ||
$request->get('cvv'), | ||
$request->get('name'), | ||
$request->get('type') | ||
); | ||
|
||
/** | ||
* provizyonu (odemeyi) tamamlamak icin tekrar kredi kart bilgileri isteniyor, bu yuzden kaydediyoruz | ||
*/ | ||
$session->set('card', [ | ||
'number' => $request->get('number'), | ||
'year' => $request->get('year'), | ||
'month' => $request->get('month'), | ||
'cvv' => $request->get('cvv'), | ||
'name' => $request->get('name'), | ||
'type' => $request->get('type'), | ||
]); | ||
|
||
$pos->prepare($order, $transaction, $card); | ||
try { | ||
$formData = $pos->get3DFormData(); | ||
} catch (\Exception $e) { | ||
dd($e); | ||
} | ||
|
||
require '../_redirect_form.php'; | ||
require '../../template/_footer.php'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
require '_config.php'; | ||
require '../../template/_header.php'; | ||
require '../_header.php'; | ||
|
||
$url = $baseUrl.'form.php'; | ||
$card = $testCards['visa1']; | ||
|
||
require '../_credit_card_form.php'; | ||
require '../../template/_footer.php'; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.