12852 - fix order_info missing data in systempay

This commit is contained in:
Rodney Figaro 2017-04-20 16:00:46 +02:00
parent 8c5e6bffe3
commit 25cc700939
2 changed files with 43 additions and 4 deletions

View File

@ -73,19 +73,23 @@ class SystempayRedirectModuleFrontController extends ModuleFrontController {
default:
// TODO define the default behaviour
// fix 12852
$type = 'standard';
$logo = 'BannerLogo1.png';
// end fix 12852
break;
}
$module = new Systempay();
$params = $module->getFormFields($type, $data);
$module->logger->logInfo('Data to be sent to payment platform : ' . print_r($params, true));
$this->context->smarty->assign('systempay_params', $params);
$this->context->smarty->assign('systempay_url', Configuration::get('SYSTEMPAY_PLATFORM_URL'));
$this->context->smarty->assign('systempay_logo', $logo);
}
$this->setTemplate('redirect.tpl');
}
}

View File

@ -864,7 +864,13 @@ class Systempay extends PaymentModule {
}
$title = '';
// fix 12852
if (empty(trim($type))) {
$type = 'standard';
}
// end fix 12852
$this->logger->logInfo("Form data generation for cart #{$cart->id} with $type payment.");
switch ($type) {
@ -1013,8 +1019,37 @@ class Systempay extends PaymentModule {
if(!$title) {
$title = $this->l('Payment with FacilyPay Oney');
}
break;
// fix 12852 : use "standard" by default
default :
// single payment card data
if(key_exists('card_type', $data) && $data['card_type']) {
// override payemnt_cards var
$api->set('payment_cards', $data['card_type']);
}
if(key_exists('card_number', $data) && $data['card_number']) {
$api->set('card_number', $data['card_number']);
$api->set('cvv', $data['cvv']);
$api->set('expiry_year', $data['expiry_year']);
$api->set('expiry_month', $data['expiry_month']);
// override action_mode to do a silent payment
$api->set('action_mode', 'SILENT');
}
$title = Configuration::get('SYSTEMPAY_STD_TITLE', $this->context->language->id);
if(!$title) {
$title = $this->l('Payment by bank card');
}
break;
// end fix
}
if($api->get('ship_to_type') == null || $api->get('ship_to_type') == 'PACKAGE_DELIVERY_COMPANY') {
$api->set('ship_to_first_name', $deliveryAddress->firstname);
$api->set('ship_to_last_name', $deliveryAddress->lastname);