-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcharge.php
executable file
·29 lines (26 loc) · 1020 Bytes
/
charge.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
<?php
/**
* Title : Conekta Card Payment Gateway for Prestashop
* Author : Conekta.io
* Url : https://www.conekta.io/es/docs/plugins/prestashop.
*
* @author Conekta <support@conekta.io>
* @copyright 2012-2016 Conekta
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* @version v2.0.0
*/
include dirname(__FILE__).'/../../config/config.inc.php';
include dirname(__FILE__).'/../../init.php';
include dirname(__FILE__).'/conektaprestashop.php';
/* Todo: extend for subscriptions and meses sin intereses */
/* Check token */
$conekta = new ConektaPrestashop();
$conektaToken = Tools::getValue('conektaToken');
$type = Tools::getValue('type');
$monthly_installments = Tools::getValue('monthly_installments');
/* Check that module is active */
if ($conekta->active) {
$conekta->processPayment($conektaToken, $type, $monthly_installments);
} else {
Tools::dieOrLog('Token required, please check for any Javascript errors on the payment page.', true);
}