-
Notifications
You must be signed in to change notification settings - Fork 12
/
validation.php
42 lines (30 loc) · 1.05 KB
/
validation.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
$useSSL = true;
$root_dir = str_replace('modules/veritranspay', '', dirname($_SERVER['SCRIPT_FILENAME']));
include_once($root_dir.'/config/config.inc.php');
$controller = new FrontController();
if (Tools::usingSecureMode())
$useSSL = $controller->ssl = true;
$controller->init();
include_once($root_dir.'/modules/veritranspay/veritranspay.php');
if (!$cookie->isLogged(true))
Tools::redirect('authentication.php?back=order.php');
elseif (!Customer::getAddressesTotalById((int)($cookie->id_customer)))
Tools::redirect('address.php?back=order.php?step=1');
$veritransPay = new VeritransPay();
$keys = $veritransPay->execValidation($cart);
$veritrans_api_version = Configuration::get('VT_API_VERSION');
$veritrans_payment_method = Configuration::get('VT_PAYMENT_TYPE');
if ($keys['errors'])
{
var_dump($keys['errors']);
exit;
} else
{
if ($veritrans_api_version == 2 && $veritrans_payment_method == 'vtweb')
{
Tools::redirectLink($keys['redirect_url']);
} else if ($veritrans_api_version == 2 && $veritrans_payment_method == 'vtdirect')
{
}
}