Skip to content

Commit

Permalink
Merge pull request #2 from wirecard/hmacPaysafecard
Browse files Browse the repository at this point in the history
#1 Add hmac and paysafecard parameter
  • Loading branch information
jakubpolomsky authored Dec 9, 2016
2 parents 42500b6 + 4973150 commit 3b3c7d3
Show file tree
Hide file tree
Showing 6 changed files with 153 additions and 54 deletions.
9 changes: 5 additions & 4 deletions ext/modules/payment/wirecard/checkout_page_iframe.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
chdir('../../../../');
require('includes/application_top.php');
require_once (DIR_FS_CATALOG.'includes/modules/payment/wirecard_checkout_page.php');
require_once ('includes/languages/'. $_SESSION["language"] .'/modules/payment/wirecard_checkout_page.php');

// if the customer is not logged on, redirect them to the login page
if (!tep_session_is_registered('customer_id')) {
Expand Down Expand Up @@ -72,16 +73,16 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15" />
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>" />
<link rel="stylesheet" type="text/css" href="ext/jquery/ui/redmond/jquery-ui-1.8.22.css" />
<script type="text/javascript" src="ext/jquery/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="ext/jquery/ui/jquery-ui-1.8.22.min.js"></script>
<link rel="stylesheet" type="text/css" href="ext/jquery/ui/redmond/jquery-ui-1.10.4.min.css" />
<script type="text/javascript" src="ext/jquery/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="ext/jquery/ui/jquery-ui-1.10.4.min.js"></script>
<link rel="stylesheet" type="text/css" href="stylesheet.css" />

</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center"><?php echo $redirectText ?></td>
<td align="center"><?php echo MODULE_PAYMENT_WIRECARD_CHECKOUT_PAGE_REDIRECTTEXT; ?></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
Expand Down
5 changes: 2 additions & 3 deletions ext/modules/payment/wirecard/checkout_page_return.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
chdir('../../../../');
require_once('includes/modules/payment/wirecard_checkout_page.php');
require_once('includes/application_top.php');
require_once ('includes/languages/'. $_SESSION["language"] .'/modules/payment/wirecard_checkout_page.php');

$redirectUrl = tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL', true, false);

Expand All @@ -33,11 +34,9 @@
{
$formFields .= tep_draw_hidden_field($param, $value);
}

$redirectText = $_SESSION['wirecard_checkout_page']['paypage_redirecttext'];
?>
<form action="<?php echo $redirectUrl; ?>" method="post" target="_parent" name="wirecardCheckoutPageReturn">
<?php echo $redirectText; ?>
<?php echo MODULE_PAYMENT_WIRECARD_CHECKOUT_PAGE_REDIRECTTEXT; ?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="right">
Expand Down
89 changes: 89 additions & 0 deletions ext/modules/payment/wirecard/checkout_page_success.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<?php
/**
Shop System Plugins - Terms of use
This terms of use regulates warranty and liability between Wirecard
Central Eastern Europe (subsequently referred to as WDCEE) and it's
contractual partners (subsequently referred to as customer or customers)
which are related to the use of plugins provided by WDCEE.
The Plugin is provided by WDCEE free of charge for it's customers and
must be used for the purpose of WDCEE's payment platform integration
only. It explicitly is not part of the general contract between WDCEE
and it's customer. The plugin has successfully been tested under
specific circumstances which are defined as the shopsystem's standard
configuration (vendor's delivery state). The Customer is responsible for
testing the plugin's functionality before putting it into production
enviroment.
The customer uses the plugin at own risk. WDCEE does not guarantee it's
full functionality neither does WDCEE assume liability for any
disadvantage related to the use of this plugin. By installing the plugin
into the shopsystem the customer agrees to the terms of use. Please do
not use this plugin if you do not agree to the terms of use!
*/

chdir('../../../../');
require('includes/application_top.php');
require_once (DIR_FS_CATALOG.'includes/modules/payment/wirecard_checkout_page.php');
require_once ('includes/languages/'. $_SESSION["language"] .'/modules/payment/wirecard_checkout_page.php');

$cart->reset(true);
tep_session_unregister('sendto');
tep_session_unregister('billto');
tep_session_unregister('shipping');
tep_session_unregister('payment');
tep_session_unregister('comments');

// if the customer is not logged on, redirect them to the login page
if (!tep_session_is_registered('customer_id')) {
$navigation->set_snapshot(array('mode' => 'SSL', 'page' => FILENAME_CHECKOUT_SUCCESS));
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
}

$orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where customers_id = '" . (int)$customer_id . "' order by date_purchased desc limit 1");

// redirect to shopping cart page if no orders exist
if ( !tep_db_num_rows($orders_query) ) {
tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
}

$orders = tep_db_fetch_array($orders_query);

$order_id = $orders['orders_id'];

$page_content = $oscTemplate->getContent('checkout_success');

if ( isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'update') ) {
tep_redirect(tep_href_link(FILENAME_DEFAULT));
}

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_SUCCESS);

$breadcrumb->add(NAVBAR_TITLE_1);
$breadcrumb->add(NAVBAR_TITLE_2);

require(DIR_WS_INCLUDES . 'template_top.php');

?>

<h1><?php echo MODULE_PAYMENT_WIRECARD_CHECKOUT_PAGE_PENDING_TITLE; ?></h1>
<?php echo tep_draw_form('order', tep_href_link(FILENAME_CHECKOUT_SUCCESS, 'action=update', 'SSL')); ?>

<div class="contentContainer">
<?php
echo MODULE_PAYMENT_WIRECARD_CHECKOUT_PAGE_PENDING_DESC;
?>
</div>

<div class="contentContainer">
<div class="buttonSet">
<span class="buttonAction"><?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'triangle-1-e', null, 'primary'); ?></span>
</div>
</div>

</form>

<?php
require(DIR_WS_INCLUDES . 'template_bottom.php');
require(DIR_WS_INCLUDES . 'application_bottom.php');
?>
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@
define('MODULE_PAYMENT_WIRECARD_CHECKOUT_PAGE_PAYSYS_SKRILLWALLET_DESC', 'Enable payment type Skrill Digital Wallet?');
define('MODULE_PAYMENT_WIRECARD_CHECKOUT_PAGE_PAYSYS_MPASS_TITLE', 'mpass');
define('MODULE_PAYMENT_WIRECARD_CHECKOUT_PAGE_PAYSYS_MPASS_DESC', 'Enable payment type mpass?');
define('MODULE_PAYMENT_WIRECARD_CHECKOUT_PAGE_PENDING_TITLE', 'The financial institution has not yet approved your payment');
define('MODULE_PAYMENT_WIRECARD_CHECKOUT_PAGE_PENDING_DESC', 'Payment verification is pending, confirmation will be sent later.');

define('MODULE_PAYMENT_WIRECARD_CHECKOUT_PAGE_INVOICE_MIN_AMOUNT_TITLE', 'Invoice minimum amount');
define('MODULE_PAYMENT_WIRECARD_CHECKOUT_PAGE_INVOICE_MIN_AMOUNT_DESC', 'Enter minimum amount for invoice. (&euro;)');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@
define('MODULE_PAYMENT_WIRECARD_CHECKOUT_PAGE_PAYSYS_SKRILLWALLET_DESC', 'Zahlungsoption Skrill Digital Wallet aktivieren?');
define('MODULE_PAYMENT_WIRECARD_CHECKOUT_PAGE_PAYSYS_MPASS_TITLE', 'mpass');
define('MODULE_PAYMENT_WIRECARD_CHECKOUT_PAGE_PAYSYS_MPASS_DESC', 'Zahlungsoption mpass aktivieren?');
define('MODULE_PAYMENT_WIRECARD_CHECKOUT_PAGE_PENDING_TITLE', 'Ihre Zahlung wurde vom Finanzinstitut noch nicht best&auml;tigt');
define('MODULE_PAYMENT_WIRECARD_CHECKOUT_PAGE_PENDING_DESC', 'Die Zahlungsbest&auml;tigung ist ausst&auml;ndig, sie wird sp&auml;ter zugesendet.');

define('MODULE_PAYMENT_WIRECARD_CHECKOUT_PAGE_INVOICE_MIN_AMOUNT_TITLE','Minimalbetrag Kauf auf Rechnung');
define('MODULE_PAYMENT_WIRECARD_CHECKOUT_PAGE_INVOICE_MIN_AMOUNT_DESC','Geben sie den Minimalbetrag f&uuml;r Kauf auf Rechnung an. (&euro;)');
Expand Down
Loading

0 comments on commit 3b3c7d3

Please sign in to comment.