first commit
This commit is contained in:
16
modules/payu/views/templates/front/conditions17.tpl
Normal file
16
modules/payu/views/templates/front/conditions17.tpl
Normal file
@@ -0,0 +1,16 @@
|
||||
<div class="payuConditions">
|
||||
<div class="checkbox">
|
||||
<input type="checkbox" value="1" {if $payuConditions}checked="checked"{/if} name="payuConditions" id="payuCondition">
|
||||
<label for="payuCondition">
|
||||
{l s='I accept' mod='payu'} <a target="_blank" href="{$conditionUrl}">{l s='Terms of single PayU payment transaction' mod='payu'}</a>
|
||||
</label>
|
||||
</div>
|
||||
{l s="Payment is processed by PayU SA; The recipient's data, the payment title and the amount are provided to PayU SA by the recipient;" mod='payu'} <span class="payu-read-more" data-more="more1">{l s="read more" mod='payu'}</span><span class="payu-more-hidden" id="more1"> {l s="The order is sent for processing when PayU SA receives your payment. The payment is transferred to the recipient within 1 hour, not later than until the end of the next business day; PayU SA does not charge any service fees." mod='payu'}</span><br />
|
||||
{l s='The controller of your personal data is PayU S.A. with its registered office in Poznan (60-166), at Grunwaldzka Street 182 ("PayU").' mod='payu'} <span class="payu-read-more" data-more="more2">{l s="read more" mod='payu'}</span>
|
||||
<span class="payu-more-hidden" id="more2"> {l s='Your personal data will be processed for purposes of processing payment transaction, notifying You about the status of this payment, dealing with complaints and also in order to fulfill the legal obligations imposed on PayU.' mod='payu'}
|
||||
<br />
|
||||
{l s='The recipients of your personal data may be entities cooperating with PayU during processing the payment. Depending on the payment method you choose, these may include: banks, payment institutions, loan institutions, payment card organizations, payment schemes), as well as suppliers supporting PayU’s activity providing: IT infrastructure, payment risk analysis tools and also entities that are authorised to receive it under the applicable provisions of law, including relevant judicial authorities. Your personal data may be shared with merchants to inform them about the status of the payment.' mod='payu'}
|
||||
<br />
|
||||
{l s='You have the right to access, rectify, restrict or oppose the processing of data, not to be subject to automated decision making, including profiling, or to transfer and erase Your personal data. Providing personal data is voluntary however necessary for the processing the payment and failure to provide the data may result in the rejection of the payment. For more information on how PayU processes your personal data, please click' mod='payu'} <a href="{l s='https://static.payu.com/sites/terms/files/payu_privacy_policy_en_en.pdf' mod='payu'}" target="_blank">{l s='Payu Privacy Policy' mod='payu'}</a>.
|
||||
</span>
|
||||
</div>
|
||||
28
modules/payu/views/templates/front/error.tpl
Normal file
28
modules/payu/views/templates/front/error.tpl
Normal file
@@ -0,0 +1,28 @@
|
||||
{*
|
||||
* @author PayU
|
||||
* @copyright Copyright (c) 2016 PayU
|
||||
* @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
|
||||
*
|
||||
* http://www.payu.com
|
||||
*}
|
||||
{capture name=path}{l s='Pay with PayU' mod='payu'}{/capture}
|
||||
|
||||
<div class="clearfix">
|
||||
<h2 id="payuAmountInfo">
|
||||
{$payuOrderInfo}:
|
||||
<strong>{if $currency}{convertPriceWithCurrency price=$total currency=$orderCurrency}{else}{convertPrice price=$total}{/if}</strong> {l s='(tax incl.)' mod='payu'}
|
||||
</h2>
|
||||
<img src="{$image}" id="payuLogo">
|
||||
</div>
|
||||
|
||||
{if $payuError}
|
||||
<div class="alert alert-warning">
|
||||
{$payuError}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<p class="cart_navigation clearfix" id="cart_navigation">
|
||||
<a class="button btn btn-default button-medium" href="{$buttonAction}">
|
||||
<span>{l s='Retry pay with PayU' mod='payu'}<i class="icon-chevron-right right"></i></span>
|
||||
</a>
|
||||
</p>
|
||||
29
modules/payu/views/templates/front/error17.tpl
Normal file
29
modules/payu/views/templates/front/error17.tpl
Normal file
@@ -0,0 +1,29 @@
|
||||
{*
|
||||
* @author PayU
|
||||
* @copyright Copyright (c) 2016 PayU
|
||||
* @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
|
||||
*
|
||||
* http://www.payu.com
|
||||
*}
|
||||
{extends file=$layout}
|
||||
|
||||
{block name='content'}
|
||||
|
||||
<div class="clearfix">
|
||||
<h2 id="payuAmountInfo">{$payuOrderInfo}: <strong>{$total}</strong> {l s='(tax incl.)' mod='payu'}</h2>
|
||||
<img src="{$image}" id="payuLogo">
|
||||
</div>
|
||||
|
||||
{if $payuError}
|
||||
<div class="alert alert-warning">
|
||||
{$payuError}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<p class="cart_navigation clearfix" id="cart_navigation">
|
||||
<a class="btn btn-primary float-xs-right continue" href="{$buttonAction}">
|
||||
<span>{l s='Retry pay with PayU' mod='payu'}</span>
|
||||
</a>
|
||||
</p>
|
||||
|
||||
{/block}
|
||||
22
modules/payu/views/templates/front/index.php
Normal file
22
modules/payu/views/templates/front/index.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* PayU
|
||||
*
|
||||
* @author PayU
|
||||
* @copyright Copyright (c) 2014 PayU
|
||||
* @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
|
||||
*
|
||||
* http://www.payu.com
|
||||
* http://openpayu.com
|
||||
* http://twitter.com/openpayu
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../../../');
|
||||
exit;
|
||||
82
modules/payu/views/templates/front/payMethods.tpl
Normal file
82
modules/payu/views/templates/front/payMethods.tpl
Normal file
@@ -0,0 +1,82 @@
|
||||
{*
|
||||
* @author PayU
|
||||
* @copyright Copyright (c) 2014-2018 PayU
|
||||
* @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
|
||||
*
|
||||
* http://www.payu.com
|
||||
*}
|
||||
{capture name=path}{l s='Pay with PayU' mod='payu'}{/capture}
|
||||
|
||||
<div class="clearfix">
|
||||
<h2 id="payuAmountInfo">{$payuOrderInfo}: <strong>
|
||||
{if $currency}{convertPriceWithCurrency price=$total currency=$orderCurrency}{else}{convertPrice price=$total}{/if}
|
||||
</strong>
|
||||
{l s='(tax incl.)' mod='payu'}
|
||||
</h2>
|
||||
<img src="{$image}" id="payuLogo">
|
||||
</div>
|
||||
|
||||
{if $payuErrors|@count}
|
||||
<div class="alert alert-warning">
|
||||
{foreach $payuErrors as $error}
|
||||
{$error}<br>
|
||||
{/foreach}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<form action="{$payuPayAction|escape:'html'}" method="post" id="payuForm">
|
||||
<input type="hidden" name="payuPay" value="1" />
|
||||
|
||||
{if isset($payMethods.error)}
|
||||
<h4 class="error">{l s='Error has occurred' mod='payu'}: {$payMethods.error}</h4>
|
||||
{else}
|
||||
<div id="payMethods">
|
||||
{foreach $payMethods.payByLinks as $payByLink}
|
||||
<div id="payMethodContainer-{$payByLink->value}" class="payMethod {if $payByLink->status != 'ENABLED'}payMethodDisable{else}payMethodEnable{/if} {if $payMethod == $payByLink->value}payMethodActive{/if}" {if $payByLink->value == 'jp'}style="display: none" {/if}>
|
||||
{if $payByLink->status == 'ENABLED'}
|
||||
<input id="payMethod-{$payByLink->value}" type="radio" value="{$payByLink->value}" name="payMethod" {if $payMethod == $payByLink->value}checked="checked"{/if}>
|
||||
{/if}
|
||||
<label for="payMethod-{$payByLink->value}" class="payMethodLabel" data-autosubmit="{$payByClick}">
|
||||
<div class="payMethodImage"><img src="{$payByLink->brandImageUrl}" alt="{$payByLink->name}"></div>
|
||||
{$payByLink->name}
|
||||
</label>
|
||||
</div>
|
||||
{/foreach}
|
||||
</div>
|
||||
|
||||
{include file="$conditionTemplate"}
|
||||
|
||||
{/if}
|
||||
<p class="cart_navigation clearfix" id="cart_navigation">
|
||||
{if !$retryPayment}
|
||||
<a class="button-exclusive btn btn-default button_large" href="{$link->getPageLink('order', true, NULL, "step=3")|escape:'html':'UTF-8'}">
|
||||
<i class="icon-chevron-left"></i>{l s='Other payment methods' mod='payu'}
|
||||
</a>
|
||||
{/if}
|
||||
{if !isset($payMethods.error)}
|
||||
<button class="button btn btn-default button-medium" type="submit">
|
||||
<span>{if !$retryPayment}{l s='I confirm my order' mod='payu'}{else}{l s='Pay' mod='payu'}{/if}<i class="icon-chevron-right right"></i></span>
|
||||
</button>
|
||||
{/if}
|
||||
</p>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
(function () {
|
||||
var applePayAvailable;
|
||||
|
||||
try {
|
||||
applePayAvailable = window.ApplePaySession && window.ApplePaySession.canMakePayments();
|
||||
} catch (e) {
|
||||
applePayAvailable = false;
|
||||
}
|
||||
|
||||
var applePayContainer = document.getElementById('payMethodContainer-jp');
|
||||
|
||||
if (applePayAvailable) {
|
||||
applePayContainer.style.display = 'block';
|
||||
} else {
|
||||
applePayContainer.parentNode.removeChild(applePayContainer);
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
76
modules/payu/views/templates/front/payMethods17.tpl
Normal file
76
modules/payu/views/templates/front/payMethods17.tpl
Normal file
@@ -0,0 +1,76 @@
|
||||
{*
|
||||
* @author PayU
|
||||
* @copyright Copyright (c) 2014-2018 PayU
|
||||
* @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
|
||||
*
|
||||
* http://www.payu.com
|
||||
*}
|
||||
{extends file=$layout}
|
||||
|
||||
{block name='content'}
|
||||
<div class="clearfix container">
|
||||
|
||||
<img src="{$image}" id="payuLogo">
|
||||
</div>
|
||||
|
||||
{if $payuErrors|@count}
|
||||
<div class="alert alert-warning">
|
||||
{foreach $payuErrors as $error}
|
||||
{$error|unescape:'html'}<br>
|
||||
{/foreach}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<form action="{$payuPayAction|escape:'html'}" method="post" id="payuForm" class="container payu-form-margin">
|
||||
<input type="hidden" name="payuPay" value="1" />
|
||||
|
||||
{if isset($payMethods.error)}
|
||||
<h4 class="error">{l s='Error has occurred' mod='payu'}: {$payMethods.error}</h4>
|
||||
{else}
|
||||
<div id="payMethods">
|
||||
{foreach $payMethods.payByLinks as $payByLink}
|
||||
<div id="payMethodContainer-{$payByLink->value}" class="payMethod {if $payByLink->status != 'ENABLED'}payMethodDisable{else}payMethodEnable{/if} {if $payMethod == $payByLink->value}payMethodActive{/if}" {if $payByLink->value == 'jp'}style="display: none" {/if}>
|
||||
{if $payByLink->status == 'ENABLED'}
|
||||
<input id="payMethod-{$payByLink->value}" type="radio" value="{$payByLink->value}" name="payMethod" {if $payMethod == $payByLink->value}checked="checked"{/if}>
|
||||
{/if}
|
||||
<label for="payMethod-{$payByLink->value}" class="payMethodLabel" data-autosubmit="{$payByClick}">
|
||||
<div class="payMethodImage" title="{$payByLink->name}"><img src="{$payByLink->brandImageUrl}" alt="{$payByLink->name}"></div>
|
||||
{$payByLink->name}
|
||||
</label>
|
||||
</div>
|
||||
{/foreach}
|
||||
</div>
|
||||
|
||||
{include file='module:payu/views/templates/front/conditions17.tpl'}
|
||||
{/if}
|
||||
|
||||
<p class="cart_navigation clearfix" id="cart_navigation">
|
||||
<h2 id="payuAmountInfo">{$payuOrderInfo}: <strong>{$total}</strong> {l s='(tax incl.)' mod='payu'}</h2>
|
||||
{if !isset($payMethods.error)}
|
||||
<button class="btn btn-primary float-lg-right floar-md-left float-xs-left continue" type="submit">
|
||||
<span>{if !$retryPayment}{l s='I confirm my order' mod='payu'}{else}{l s='Pay' mod='payu'}{/if}</span>
|
||||
</button>
|
||||
{/if}
|
||||
</p>
|
||||
|
||||
</form>
|
||||
<script>
|
||||
(function () {
|
||||
var applePayAvailable;
|
||||
|
||||
try {
|
||||
applePayAvailable = window.ApplePaySession && window.ApplePaySession.canMakePayments();
|
||||
} catch (e) {
|
||||
applePayAvailable = false;
|
||||
}
|
||||
|
||||
var applePayContainer = document.getElementById('payMethodContainer-jp');
|
||||
|
||||
if (applePayAvailable) {
|
||||
applePayContainer.style.display = 'block';
|
||||
} else {
|
||||
applePayContainer.parentNode.removeChild(applePayContainer);
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
{/block}
|
||||
25
modules/payu/views/templates/front/payuCardForm.tpl
Normal file
25
modules/payu/views/templates/front/payuCardForm.tpl
Normal file
@@ -0,0 +1,25 @@
|
||||
{*
|
||||
* @author PayU
|
||||
* @copyright Copyright (c) 2014-2018 PayU
|
||||
* @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
|
||||
*
|
||||
* http://www.payu.com
|
||||
*}
|
||||
<div class="payu-card-form-container">
|
||||
<div class="payu-card-container">
|
||||
<div class="aside">{l s='Card number' mod='payu'}</div>
|
||||
<div class="payu-card-form" id="payu-card-number"></div>
|
||||
|
||||
<div class="card-details payu-card-clearfix">
|
||||
<div class="expiration">
|
||||
<div class="aside">{l s='Valid thru' mod='payu'}</div>
|
||||
<div class="payu-card-form" id="payu-card-date"></div>
|
||||
</div>
|
||||
|
||||
<div class="cvv">
|
||||
<div class="aside">{l s='CVV' mod='payu'}</div>
|
||||
<div class="payu-card-form" id="payu-card-cvv"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
63
modules/payu/views/templates/front/secureForm.tpl
Normal file
63
modules/payu/views/templates/front/secureForm.tpl
Normal file
@@ -0,0 +1,63 @@
|
||||
{*
|
||||
* @author PayU
|
||||
* @copyright Copyright (c) 2014-2018 PayU
|
||||
* @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
|
||||
*
|
||||
* http://www.payu.com
|
||||
*}
|
||||
{capture name=path}{l s='Pay with PayU' mod='payu'}{/capture}
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.auto.min.js"></script>
|
||||
<script type="text/javascript" src="{$jsSdk}"></script>
|
||||
|
||||
<div class="clearfix">
|
||||
<h2 id="payuAmountInfo">{$payuOrderInfo}: <strong>
|
||||
{if $currency}{convertPriceWithCurrency price=$total currency=$orderCurrency}{else}{convertPrice price=$total}{/if}
|
||||
</strong>
|
||||
{l s='(tax incl.)' mod='payu'}
|
||||
</h2>
|
||||
<img src="{$image}" id="payuLogo">
|
||||
</div>
|
||||
|
||||
{if $payuErrors|@count}
|
||||
<div class="alert alert-warning">
|
||||
{foreach $payuErrors as $error}
|
||||
{$error}<br>
|
||||
{/foreach}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<form action="{$payuPayAction|escape:'html'}" method="post" id="payu-card-form">
|
||||
<input type="hidden" name="payuPay" value="1" />
|
||||
<input type="hidden" name="payMethod" value="card" />
|
||||
<input type="hidden" name="cardToken" value="" id="card-token" />
|
||||
<div id="card-form-container">
|
||||
{if isset($payMethods.error)}
|
||||
<h4 class="error">{l s='Error has occurred' mod='payu'}: {$payMethods.error}</h4>
|
||||
{else}
|
||||
<div id="payMethods" style="padding-bottom: 5px">
|
||||
<div id="response-box" class="alert alert-warning" style="display: none; margin-bottom: 10px"></div>
|
||||
|
||||
{include file="$payCardTemplate"}
|
||||
|
||||
</div>
|
||||
{include file="$conditionTemplate"}
|
||||
{/if}
|
||||
|
||||
<p class="cart_navigation clearfix" id="cart_navigation">
|
||||
{if !$retryPayment}
|
||||
<a class="button-exclusive btn btn-default button_large" href="{$link->getPageLink('order', true, NULL, "step=3")|escape:'html':'UTF-8'}">
|
||||
<i class="icon-chevron-left"></i>{l s='Other payment methods' mod='payu'}
|
||||
</a>
|
||||
{/if}
|
||||
{if !isset($payMethods.error)}
|
||||
<button class="button btn btn-default button-medium" type="submit" id="secure-form-pay">
|
||||
<span>{if !$retryPayment}{l s='I confirm my order' mod='payu'}{else}{l s='Pay' mod='payu'}{/if}<i class="icon-chevron-right right"></i></span>
|
||||
</button>
|
||||
{/if}
|
||||
</p>
|
||||
</div>
|
||||
<h2 id="waiting-box" style="display: none">{l s='Please wait' mod='payu'}...</h2>
|
||||
</form>
|
||||
|
||||
{include file="$secureFormJsTemplate"}
|
||||
62
modules/payu/views/templates/front/secureForm17.tpl
Normal file
62
modules/payu/views/templates/front/secureForm17.tpl
Normal file
@@ -0,0 +1,62 @@
|
||||
{*
|
||||
* @author PayU
|
||||
* @copyright Copyright (c) 2014-2018 PayU
|
||||
* @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
|
||||
*
|
||||
* http://www.payu.com
|
||||
*}
|
||||
{extends file=$layout}
|
||||
|
||||
{block name='content'}
|
||||
<section id="main">
|
||||
<script src="https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.auto.min.js"></script>
|
||||
<script type="text/javascript" src="{$jsSdk}"></script>
|
||||
|
||||
<div class="clearfix">
|
||||
<h2 id="payuAmountInfo">{$payuOrderInfo}: <strong>{$total}</strong> {l s='(tax incl.)' mod='payu'}</h2>
|
||||
<img src="{$image}" id="payuLogo">
|
||||
</div>
|
||||
|
||||
{if $payuErrors|@count}
|
||||
<div class="alert alert-warning">
|
||||
{foreach $payuErrors as $error}
|
||||
{$error}<br>
|
||||
{/foreach}
|
||||
</div>
|
||||
{/if}
|
||||
<section id="content" class="page-content page-cms">
|
||||
<form action="{$payuPayAction|escape:'html'}" method="post" id="payu-card-form">
|
||||
<input type="hidden" name="payuPay" value="1" />
|
||||
<input type="hidden" name="payMethod" value="card" />
|
||||
<input type="hidden" name="cardToken" value="" id="card-token" />
|
||||
<div id="card-form-container">
|
||||
{if isset($payMethods.error)}
|
||||
<h4 class="error">{l s='Error has occurred' mod='payu'}: {$payMethods.error}</h4>
|
||||
{else}
|
||||
<div id="payMethods" style="padding-bottom: 5px">
|
||||
<div id="response-box" class="alert alert-warning" style="display: none; margin-bottom: 10px"></div>
|
||||
|
||||
{include file='module:payu/views/templates/front/payuCardForm.tpl'}
|
||||
</div>
|
||||
{include file='module:payu/views/templates/front/conditions17.tpl'}
|
||||
{/if}
|
||||
|
||||
<p class="cart_navigation clearfix" id="cart_navigation">
|
||||
{if !$retryPayment}
|
||||
<a class="label" href="{$link->getPageLink('order', true, NULL, "step=3")|escape:'html':'UTF-8'}">
|
||||
{l s='Other payment methods' mod='payu'}
|
||||
</a>
|
||||
{/if}
|
||||
{if !isset($payMethods.error)}
|
||||
<button class="btn btn-primary float-xs-right continue" type="submit" id="secure-form-pay">
|
||||
<span>{if !$retryPayment}{l s='I confirm my order' mod='payu'}{else}{l s='Pay' mod='payu'}{/if}</span>
|
||||
</button>
|
||||
{/if}
|
||||
</p>
|
||||
</div>
|
||||
<div id="waiting-box" style="display: none">{l s='Please wait' mod='payu'}...</div>
|
||||
</form>
|
||||
</section>
|
||||
{include file='module:payu/views/templates/front/secureFormJs.tpl'}
|
||||
</section>
|
||||
{/block}
|
||||
178
modules/payu/views/templates/front/secureFormJs.tpl
Normal file
178
modules/payu/views/templates/front/secureFormJs.tpl
Normal file
@@ -0,0 +1,178 @@
|
||||
{*
|
||||
* @author PayU
|
||||
* @copyright Copyright (c) 2014-2018 PayU
|
||||
* @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
|
||||
*
|
||||
* http://www.payu.com
|
||||
*}
|
||||
<script>
|
||||
(function () {
|
||||
//Polifill from https://developer.mozilla.org/pl/docs/Web/JavaScript/Referencje/Obiekty/Object/assign
|
||||
if (typeof Object.assign != 'function') {
|
||||
Object.assign = function(target, varArgs) { // .length of function is 2
|
||||
'use strict';
|
||||
if (target == null) { // TypeError if undefined or null
|
||||
throw new TypeError('Cannot convert undefined or null to object');
|
||||
}
|
||||
|
||||
var to = Object(target);
|
||||
|
||||
for (var index = 1; index < arguments.length; index++) {
|
||||
var nextSource = arguments[index];
|
||||
|
||||
if (nextSource != null) { // Skip over if undefined or null
|
||||
for (var nextKey in nextSource) {
|
||||
// Avoid bugs when hasOwnProperty is shadowed
|
||||
if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
|
||||
to[nextKey] = nextSource[nextKey];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return to;
|
||||
};
|
||||
}
|
||||
|
||||
var secureFormOptions = {
|
||||
elementFormNumber: '#payu-card-number',
|
||||
elementFormDate: '#payu-card-date',
|
||||
elementFormCvv: '#payu-card-cvv',
|
||||
element: '#secure-form',
|
||||
profile: 'widthGt300',
|
||||
profiles: {
|
||||
widthLt290: {
|
||||
cardIcon: false,
|
||||
style: {
|
||||
basic: {
|
||||
fontSize: '14px',
|
||||
}
|
||||
},
|
||||
},
|
||||
widthLt340: {
|
||||
cardIcon: true,
|
||||
style: {
|
||||
basic: {
|
||||
fontSize: '14px',
|
||||
}
|
||||
},
|
||||
},
|
||||
widthGt340: {
|
||||
cardIcon: true,
|
||||
style: {
|
||||
basic: {
|
||||
fontSize: '18px',
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
config: {
|
||||
cardIcon: true,
|
||||
placeholder: {
|
||||
number: '',
|
||||
cvv: ''
|
||||
},
|
||||
style: {
|
||||
basic: {
|
||||
fontSize: '18px',
|
||||
}
|
||||
},
|
||||
lang: '{$lang}'
|
||||
}
|
||||
};
|
||||
|
||||
secureFormOptions.profile = calculateProfile();
|
||||
secureFormOptions.config = Object.assign({}, secureFormOptions.config, secureFormOptions.profiles[secureFormOptions.profile]);
|
||||
|
||||
|
||||
var payu = PayU({$posId});
|
||||
|
||||
var secureForms = payu.secureForms();
|
||||
var secureFormNumber = secureForms.add('number', secureFormOptions.config);
|
||||
secureFormNumber.render(secureFormOptions.elementFormNumber);
|
||||
var secureFormDate = secureForms.add('date', secureFormOptions.config);
|
||||
secureFormDate.render(secureFormOptions.elementFormDate);
|
||||
var secureFormCvv = secureForms.add('cvv', secureFormOptions.config);
|
||||
secureFormCvv.render(secureFormOptions.elementFormCvv);
|
||||
window.addEventListener('resize', secureFormResize);
|
||||
|
||||
var payButton = document.getElementById('secure-form-pay');
|
||||
var responseBox = document.getElementById('response-box');
|
||||
var cardTokenInput = document.getElementById('card-token');
|
||||
|
||||
payButton.addEventListener('click', function(event) {
|
||||
event.preventDefault();
|
||||
|
||||
var isAcceptPayuConditions = document.getElementById('payuCondition').checked;
|
||||
|
||||
if (!isAcceptPayuConditions) {
|
||||
showMessageBox('<strong>{l s='Please accept "Terms of single PayU payment transaction"' mod='payu'}</strong>');
|
||||
return;
|
||||
}
|
||||
|
||||
hideMessageBox();
|
||||
cardTokenInput.value = '';
|
||||
secureFormNumber.update({ disabled: true });
|
||||
secureFormDate.update({ disabled: true });
|
||||
secureFormCvv.update({ disabled: true });
|
||||
|
||||
try {
|
||||
payu.tokenize().then(function(result) {
|
||||
if (result.status === 'SUCCESS') {
|
||||
secureFormNumber.remove();
|
||||
secureFormDate.remove();
|
||||
secureFormCvv.remove();
|
||||
cardTokenInput.value = result.body.token;
|
||||
document.getElementById('waiting-box').style.display = '';
|
||||
document.getElementById('card-form-container').style.display = 'none';
|
||||
document.getElementById('payu-card-form').submit();
|
||||
} else {
|
||||
var errorMessage = "{l s='An error occurred while trying to use the card' mod='payu'}:<br>";
|
||||
result.error.messages.forEach(function(error) {
|
||||
errorMessage += '<strong>' + error.message + '<strong><br>';
|
||||
});
|
||||
|
||||
showMessageBox(errorMessage);
|
||||
|
||||
secureFormNumber.update({ disabled: false });
|
||||
secureFormDate.update({ disabled: false });
|
||||
secureFormCvv.update({ disabled: false });
|
||||
}
|
||||
});
|
||||
} catch(e) {
|
||||
showMessageBox(e.message);
|
||||
}
|
||||
});
|
||||
|
||||
function calculateProfile() {
|
||||
if (window.innerWidth <= 290) {
|
||||
return 'widthLt290';
|
||||
} else if (window.innerWidth <= 340) {
|
||||
return 'widthLt340';
|
||||
}
|
||||
|
||||
return 'widthGt340';
|
||||
}
|
||||
|
||||
function secureFormResize() {
|
||||
var newProfile = calculateProfile();
|
||||
|
||||
if (newProfile !== secureFormOptions.profile) {
|
||||
secureFormOptions.profile = newProfile;
|
||||
secureFormNumber.update(secureFormOptions.profiles[secureFormOptions.profile]);
|
||||
secureFormDate.update(secureFormOptions.profiles[secureFormOptions.profile]);
|
||||
secureFormCvv.update(secureFormOptions.profiles[secureFormOptions.profile]);
|
||||
}
|
||||
}
|
||||
|
||||
function showMessageBox(message) {
|
||||
responseBox.innerHTML = message;
|
||||
responseBox.style.display = '';
|
||||
}
|
||||
|
||||
function hideMessageBox() {
|
||||
responseBox.innerHTML = '';
|
||||
responseBox.style.display = 'none';
|
||||
}
|
||||
|
||||
})();
|
||||
</script>
|
||||
26
modules/payu/views/templates/front/status.tpl
Normal file
26
modules/payu/views/templates/front/status.tpl
Normal file
@@ -0,0 +1,26 @@
|
||||
{*
|
||||
* @author PayU
|
||||
* @copyright Copyright (c) 2014-2017 PayU
|
||||
* @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
|
||||
*
|
||||
* http://www.payu.com
|
||||
*}
|
||||
{capture name=path}{l s='Pay with PayU' mod='payu'}{/capture}
|
||||
|
||||
|
||||
<div class="box clearfix">
|
||||
<img src="{$payuLogo}"> {l s='Thanks for choosing PayU payment' mod='payu'}
|
||||
<h2 style="margin: 30px 0">
|
||||
{l s='Order status' mod='payu'} {$orderPublicId} - {$orderStatus} <br/>
|
||||
</h2>
|
||||
|
||||
{$HOOK_ORDER_CONFIRMATION nofilter}
|
||||
{$HOOK_PAYMENT_RETURN nofilter}
|
||||
|
||||
<a class="button btn btn-default button-medium pull-right" href="{$redirectUrl}">
|
||||
<span>
|
||||
{l s='Order details' mod='payu'}
|
||||
<i class="icon-chevron-right"></i>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
30
modules/payu/views/templates/front/status17.tpl
Normal file
30
modules/payu/views/templates/front/status17.tpl
Normal file
@@ -0,0 +1,30 @@
|
||||
{*
|
||||
* @author PayU
|
||||
* @copyright Copyright (c) 2014-2017 PayU
|
||||
* @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
|
||||
*
|
||||
* http://www.payu.com
|
||||
*}
|
||||
{extends file=$layout}
|
||||
|
||||
{block name='content'}
|
||||
|
||||
<section id="main">
|
||||
<div class="text-xs-center">
|
||||
<img src="{$payuLogo}"> {l s='Thanks for choosing PayU payment' mod='payu'}
|
||||
<h2 style="margin: 30px 0">
|
||||
{l s='Order status' mod='payu'} {$orderPublicId} - {$orderStatus} <br/>
|
||||
</h2>
|
||||
|
||||
{$HOOK_ORDER_CONFIRMATION nofilter}
|
||||
{$HOOK_PAYMENT_RETURN nofilter}
|
||||
|
||||
<p class="cart_navigation">
|
||||
<a class="btn btn-primary" href="{$redirectUrl}">
|
||||
{l s='Order details' mod='payu'}
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{/block}
|
||||
Reference in New Issue
Block a user