[+] MO : Uptdate module to store payment cc information
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@9683 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -123,5 +123,20 @@ class CashTicket extends PrepaidServices
|
||||
|
||||
return $error_msg[$error_code];
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the detail of a payment - Call before the validate order init
|
||||
* correctly the pcc object
|
||||
* See Authorize documentation to know the associated key => value
|
||||
* @param array fields
|
||||
*/
|
||||
public function setTransactionDetail($response)
|
||||
{
|
||||
// If Exist we can store the details
|
||||
if (isset($this->pcc))
|
||||
{
|
||||
$this->pcc->transaction_id = (string)$response['transaction_id'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -88,8 +88,10 @@ if ($state != Configuration::get('PS_OS_ERROR'))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$module->validateOrder((int)($cart->id), $state, (float)($cart->getOrderTotal(true, Cart::BOTH)), $module->displayName, $message, NULL, (int)($currency->id), false, $cart->secure_key);
|
||||
$module->setTransactionDetail(array(
|
||||
'transaction_id', $disposition['mtid']));
|
||||
$module->validateOrder((int)($cart->id), $state, (float)($cart->getOrderTotal(true, Cart::BOTH)),
|
||||
$module->displayName, $message, NULL, (int)($currency->id), false, $cart->secure_key);
|
||||
|
||||
if ($state == Configuration::get('PS_OS_ERROR'))
|
||||
{
|
||||
|
||||
+36
-1
@@ -25,6 +25,14 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
function debugLog($content)
|
||||
{
|
||||
ob_start();
|
||||
var_dump($content);
|
||||
$result = ob_get_clean();
|
||||
file_put_contents(dirname(__FILE__).'/logTest.log', $result, FILE_APPEND);
|
||||
}
|
||||
|
||||
if (!defined('_PS_VERSION_'))
|
||||
exit;
|
||||
|
||||
@@ -73,7 +81,7 @@ class dibs extends PaymentModule
|
||||
* @var array
|
||||
*/
|
||||
private static $accepted_lang = array('da','en','es','fi','fo','fr','it','nl','no','pl','sv');
|
||||
|
||||
|
||||
/**
|
||||
* Formular link to DIBS subscription
|
||||
* @var array
|
||||
@@ -404,4 +412,31 @@ class dibs extends PaymentModule
|
||||
$this->context->smarty->assign('logo_color', self::$MORE_SETTINGS['logo_color']);
|
||||
return $this->display(__FILE__, 'dibs.tpl');
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the detail of a payment to prepare the validate order
|
||||
* See Authorize documentation to know the associated key => value
|
||||
* @param array fields
|
||||
* @return bool success state
|
||||
*/
|
||||
public function setTransactionDetail($response)
|
||||
{
|
||||
// If Exist we can store the details
|
||||
if (isset($this->pcc))
|
||||
{
|
||||
$this->pcc->transaction_id = (string)$response['transact'];
|
||||
|
||||
// 50 => Card number (XXXX0000)
|
||||
$this->pcc->card_number = (string)substr($response['cardnomask'], -4);
|
||||
|
||||
// 51 => Card Mark (Visa, Master card)
|
||||
$this->pcc->card_brand = (string)$response['paytype'];
|
||||
|
||||
$this->pcc->card_expiration = '0000';
|
||||
|
||||
// 68 => Owner name
|
||||
$this->pcc->card_holder = '';
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
|
||||
|
||||
include(dirname(__FILE__). '/../../config/config.inc.php');
|
||||
include(dirname(__FILE__).'/dibs.php');
|
||||
|
||||
@@ -41,7 +41,12 @@ if (count($_POST))
|
||||
$message .= $error."\n";
|
||||
$message = nl2br(strip_tags($message));
|
||||
if ($valid_order === true)
|
||||
$obj_dibs->validateOrder((int)$posted_values['orderid'], Configuration::get('PS_OS_PAYMENT'), (float)((int)$posted_values['amount'] / 100), $obj_dibs->displayName, $message, array(), NULL, false, $secure_cart[2]);
|
||||
if ($valid_order === false)
|
||||
$obj_dibs->validateOrder((int)$posted_values['orderid'], Configuration::get('PS_OS_ERROR'), 0, $obj_dibs->displayName, $message, array(), NULL, false, $secure_cart[2]);
|
||||
{
|
||||
$obj_dibs->setTransactionDetail($posted_values);
|
||||
$obj_dibs->validateOrder((int)$posted_values['orderid'], Configuration::get('PS_OS_PAYMENT'),
|
||||
(float)((int)$posted_values['amount'] / 100), $obj_dibs->displayName, $message, array(), NULL, false, $secure_cart[2]);
|
||||
}
|
||||
else if ($valid_order === false)
|
||||
$obj_dibs->validateOrder((int)$posted_values['orderid'], Configuration::get('PS_OS_ERROR'), 0, $obj_dibs->displayName,
|
||||
$message, array(), NULL, false, $secure_cart[2]);
|
||||
}
|
||||
@@ -84,7 +84,11 @@ if ($state != Configuration::get('PS_OS_ERROR'))
|
||||
}
|
||||
}
|
||||
|
||||
$module->validateOrder((int)($cart->id), $state, (float)($cart->getOrderTotal(true, Cart::BOTH)), $module->displayName, $message, NULL, (int)($currency->id), false, $cart->secure_key);
|
||||
$module->setTransactionDetail(array(
|
||||
'transaction_id', $disposition['mtid']));
|
||||
|
||||
$module->validateOrder((int)($cart->id), $state, (float)($cart->getOrderTotal(true, Cart::BOTH)),
|
||||
$module->displayName, $message, NULL, (int)($currency->id), false, $cart->secure_key);
|
||||
|
||||
if ($state == Configuration::get('PS_OS_ERROR'))
|
||||
{
|
||||
|
||||
@@ -123,5 +123,21 @@ class PaysafeCard extends PSCPrepaidServices
|
||||
|
||||
return $error_msg[$error_code];
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the detail of a payment - Call before the validate order init
|
||||
* correctly the pcc object
|
||||
* See Authorize documentation to know the associated key => value
|
||||
* @param array fields
|
||||
*/
|
||||
public function setTransactionDetail($response)
|
||||
{
|
||||
// If Exist we can store the details
|
||||
if (isset($this->pcc))
|
||||
{
|
||||
$this->pcc->transaction_id = (string)$response['transaction_id'];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user