Skip to content

Commit

Permalink
Merge pull request #36 from wirecard/TPWDCEE-666
Browse files Browse the repository at this point in the history
Tpwdcee 666
  • Loading branch information
rinnhofer authored Jan 2, 2018
2 parents 69c5943 + 1be2f6e commit 57cf415
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Wirecard Checkout Page plugin for Gambio GX3

[![License](https://img.shields.io/badge/license-GPLv2-blue.svg)](https://raw.githubusercontent.com/wirecard/gambio-wcp/master/LICENSE)
[![Gambio GX3](https://img.shields.io/badge/Gambio_GX3-v3.7.2.0-green.svg)](http://www.gambio.de/)
[![Gambio GX3](https://img.shields.io/badge/Gambio_GX3-v3.7.3.0-green.svg)](http://www.gambio.de/)
[![PHP v5.6](https://img.shields.io/badge/php-v5.6-yellow.svg)](http://www.php.net)
[![PHP v7.0](https://img.shields.io/badge/php-v7.0-yellow.svg)](http://www.php.net)

Expand Down
2 changes: 1 addition & 1 deletion checkout_wirecard_checkout_page.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
$smarty->assign('IFRAME', false);
$smarty->assign('GM_CART_ON_TOP', false);
}
$smarty->assign('BUTTON_CONTINUE', $_SESSION['wirecard_checkout_page']['translation']['button_continue']);
$smarty->assign('BUTTON_CONTINUE', IMAGE_BUTTON_CONTINUE);
$smarty->assign('BUTTON_CANCEL', $_SESSION['wirecard_checkout_page']['translation']['button_cancel']);
$smarty->assign('LIGHTBOX', gm_get_conf('GM_LIGHTBOX_CHECKOUT'));
$smarty->assign('tpl_path', 'templates/'.CURRENT_TEMPLATE.'/');
Expand Down
2 changes: 1 addition & 1 deletion cout_wirecard_checkout_page_iframe.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
$smarty->assign('language', $_SESSION['language']);

$smarty->assign('FORM_ACTION', $_SESSION['wirecard_checkout_page']['process_form']);
$smarty->assign('BUTTON_CONTINUE', $_SESSION['wirecard_checkout_page']['translation']['button_continue']);
$smarty->assign('BUTTON_CONTINUE', IMAGE_BUTTON_CONTINUE);
$smarty->assign('BUTTON_CANCEL', $_SESSION['wirecard_checkout_page']['translation']['button_cancel']);
$smarty->assign('FORM_END', '</form>'.$_SESSION['wirecard_checkout_page']['process_js']);
$smarty->assign('CHECKOUT_TITLE', $_SESSION['wirecard_checkout_page']['translation']['title']);
Expand Down
2 changes: 1 addition & 1 deletion gambio_updater/updates/wcp_2.0/configuration.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[update_properties]
version = 2.2.3
name = Wirecard WCP v2.2.4
name = Wirecard WCP v2.2.5
key = wcp
revision = 0
type = update
Expand Down
13 changes: 9 additions & 4 deletions includes/modules/payment/wcp.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

define('TABLE_PAYMENT_WCP', 'payment_wirecard_checkout_page');
define('INIT_SERVER_URL', 'https://checkout.wirecard.com/page/init-server.php');
define('WCP_PLUGIN_VERSION', '2.2.4');
define('WCP_PLUGIN_VERSION', '2.2.5');
define('WCP_PLUGIN_NAME', 'GambioGX2_WCP');
define('MODULE_PAYMENT_WCP_WINDOW_NAME', 'wirecardCheckoutPageIFrame');

Expand Down Expand Up @@ -69,7 +69,7 @@ function init() {
include(DIR_FS_CATALOG.'lang/'.$_SESSION['language'].'/modules/payment/wcp.php');

$this->code = get_class($this);
$configExportUrl = GM_HTTP_SERVER.DIR_WS_ADMIN.'wcp_config_export.php';
$configExportUrl = GM_HTTP_SERVER.DIR_WS_ADMIN.'wcp_config_export.php';
$c = strtoupper($this->code);
$logoTag = ($this->logoFilename) ? '<img src="'.DIR_WS_CATALOG.'images/icons/wcp/'.$this->logoFilename.'" alt="'.$c.' Logo"/>' : '';

Expand Down Expand Up @@ -272,6 +272,7 @@ function get_order_post_variables_array() {
$config = $this->get_config_values();
$preshared_key = $config[0];
$customerId = $config[1];
$shopId = $config[2];

$orderDescription = $billingInformation['firstname'].' '.$billingInformation['lastname'].' - '.$order->customer['email_address'];

Expand Down Expand Up @@ -367,8 +368,10 @@ function get_order_post_variables_array() {
}

// set shop id if isset
if(constant("MODULE_PAYMENT_{$c}_SHOP_ID")) {
if (constant("MODULE_PAYMENT_{$c}_SHOP_ID")) {
$post_variables['shopId'] = wcp_core::constant("MODULE_PAYMENT_{$c}_SHOP_ID");
} else if ($shopId != "") {
$post_variables['shopId'] = $shopId;
}

// set layout if isset
Expand Down Expand Up @@ -410,6 +413,7 @@ function get_order_post_variables_array() {

function get_config_values() {
$c = strtoupper($this->code);
$shopId = "";

switch(wcp_core::constant("MODULE_PAYMENT_{$c}_PLUGIN_MODE")) {
case 'Demo':
Expand All @@ -423,14 +427,15 @@ function get_config_values() {
case 'Test3D':
$preshared_key = $this->secretTest3DMode;
$customerId = $this->customerIdTestMode;
$shopId = $this->shopIdTest3DMode;
break;
case 'Live':
default:
$preshared_key = trim(wcp_core::constant("MODULE_PAYMENT_{$c}_PRESHARED_KEY"));
$customerId = trim(wcp_core::constant("MODULE_PAYMENT_{$c}_CUSTOMER_ID"));
break;
}
return array($preshared_key, $customerId);
return array($preshared_key, $customerId, $shopId);
}
/**
* Create shopping basket items including shipping
Expand Down

0 comments on commit 57cf415

Please sign in to comment.