first commit

This commit is contained in:
2024-12-17 13:43:22 +01:00
commit 8e6cd8b410
21292 changed files with 3514826 additions and 0 deletions

12
modules/payu/config.xml Normal file
View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<module>
<name>payu</name>
<displayName><![CDATA[PayU]]></displayName>
<version><![CDATA[3.1.9]]></version>
<description><![CDATA[Accepts payments by PayU]]></description>
<author><![CDATA[PayU]]></author>
<tab><![CDATA[payments_gateways]]></tab>
<is_configurable>1</is_configurable>
<need_instance>1</need_instance>
<limited_countries></limited_countries>
</module>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<module>
<name>payu</name>
<displayName><![CDATA[PayU]]></displayName>
<version><![CDATA[3.1.9]]></version>
<description><![CDATA[Akceptuje płatności przez PayU]]></description>
<author><![CDATA[PayU]]></author>
<tab><![CDATA[payments_gateways]]></tab>
<is_configurable>1</is_configurable>
<need_instance>1</need_instance>
<limited_countries></limited_countries>
</module>

View 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;

View File

@@ -0,0 +1,64 @@
<?php
/**
* PayU notification
*
* @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
*/
include_once(_PS_MODULE_DIR_ . '/payu/tools/SimplePayuLogger/SimplePayuLogger.php');
class PayUNotificationModuleFrontController extends ModuleFrontController
{
public function process()
{
$body = Tools::file_get_contents('php://input');
$data = trim($body);
$payu = new PayU();
$payu->initializeOpenPayU($this->extractCurrencyCode($data));
try {
$result = OpenPayU_Order::consumeNotification($data);
} catch (OpenPayU_Exception $e) {
header('HTTP/1.1 400 Bad Request', true, 400);
die($e->getMessage());
}
$response = $result->getResponse();
if (property_exists($response, 'refund')) {
die('Refund notification - ignore');
}
SimplePayuLogger::addLog('notification', __FUNCTION__, print_r($result, true), $response->order->orderId, 'Incoming notification: ');
if (isset($response->order->orderId)) {
$payu->payu_order_id = $response->order->orderId;
$order_payment = $payu->getOrderPaymentBySessionId($payu->payu_order_id);
if ($order_payment) {
$payu->id_order = (int)$order_payment['id_order'];
$payu->updateOrderData($response);
}
//the response should be status 200
header("HTTP/1.1 200 OK");
exit;
}
}
/**
* @param string $data
* @return string
*/
private function extractCurrencyCode($data)
{
$decodeData = json_decode($data);
return $decodeData->order->currencyCode;
}
}

View File

@@ -0,0 +1,271 @@
<?php
/**
* OpenPayU
*
* @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
*/
class PayUPaymentModuleFrontController extends ModuleFrontController
{
/** @var PayU */
private $payu;
public $display_column_left = false;
private $hasRetryPayment;
private $order = null;
public function postProcess()
{
$this->checkHasModuleActive();
$this->checkHasRetryPayment();
$this->payu = new PayU();
if ($this->hasRetryPayment) {
$this->postProcessRetryPayment();
} else {
$this->postProcessPayment();
}
}
public function initContent()
{
parent::initContent();
SimplePayuLogger::addLog('order', __FUNCTION__, 'payment.php entrance. PHP version: ' . phpversion(), '');
$payMethod = Tools::getValue('payMethod');
if (Configuration::get('PAYU_RETRIEVE')) {
if (Tools::getValue('payuPay')) {
$payuConditions = Tools::getValue('payuConditions');
$cardToken = Tools::getValue('cardToken');
$errors = [];
$payError = [];
if (!$payMethod) {
$errors[] = $this->module->l('Please select a method of payment', 'payment');
}
if (!$payuConditions) {
$errors[] = $this->module->l('Please accept "Terms of single PayU payment transaction"', 'payment');
}
if ($payMethod === 'card' && !$cardToken) {
$errors[] = $this->module->l('Card token is empty', 'payment');
}
if (count($errors) == 0) {
$payError = $this->pay($payMethod, ['cardToken' => $cardToken]);
if (!array_key_exists('firstPayment', $payError)) {
$errors[] = $payError['message'];
}
}
if (array_key_exists('firstPayment', $payError)) {
$this->showPaymentError();
} else {
if ($payMethod === 'card') {
$this->showSecureForm($payuConditions, $errors);
} else {
$this->showPayMethod($payMethod, $payuConditions, $errors);
}
}
} else {
if ($payMethod === 'card') {
$this->showSecureForm();
} else {
$this->showPayMethod();
}
}
} else {
$this->pay($payMethod === 'card' ? 'c' : null);
$this->showPaymentError();
}
}
private function showPayMethod($payMethod = '', $payuConditions = 1, $errors = array())
{
$this->context->smarty->assign(array(
'conditionTemplate' => _PS_MODULE_DIR_ . 'payu/views/templates/front/conditions17.tpl',
'payMethod' => $payMethod,
'image' => $this->payu->getPayuLogo(),
'conditionUrl' => $this->payu->getPayConditionUrl(),
'payuConditions' => $payuConditions,
'payByClick' => Configuration::get('PAYU_PAY_BY_ICON_CLICK') === '1',
'payuErrors' => $errors
));
$this->context->smarty->assign($this->getShowPayMethodsParameters());
$this->setTemplate($this->payu->buildTemplatePath('payMethods'));
}
private function showSecureForm($payuConditions = 1, $errors = array())
{
$this->context->smarty->assign(array(
'conditionTemplate' => _PS_MODULE_DIR_ . 'payu/views/templates/front/conditions17.tpl',
'secureFormJsTemplate' => _PS_MODULE_DIR_ . 'payu/views/templates/front/secureFormJs.tpl',
'payCardTemplate' => _PS_MODULE_DIR_ . 'payu/views/templates/front/payuCardForm.tpl',
'image' => $this->payu->getPayuLogo(),
'conditionUrl' => $this->payu->getPayConditionUrl(),
'payuConditions' => $payuConditions,
'payuErrors' => $errors,
'jsSdk' => $this->payu->getPayuUrl(Configuration::get('PAYU_SANDBOX') === '1') . 'javascript/sdk'
));
$this->context->smarty->assign($this->getShowPayMethodsParameters());
$this->setTemplate($this->payu->buildTemplatePath('secureForm'));
}
private function showPaymentError()
{
$this->context->smarty->assign(
array(
'image' => $this->payu->getPayuLogo(),
'total' => Tools::displayPrice($this->order->total_paid, (int)$this->order->id_currency),
'orderCurrency' => (int)$this->order->id_currency,
'buttonAction' => $this->context->link->getModuleLink('payu', 'payment', array('id_order' => $this->order->id, 'order_reference' => $this->order->reference)),
'payuOrderInfo' => $this->module->l('Pay for your order', 'payment') . ' ' . $this->order->reference,
'payuError' => $this->module->l('An error occurred while processing your payment.', 'payment')
)
);
$this->setTemplate($this->payu->buildTemplatePath('error'));
}
private function pay($payMethod = null, $parameters = [])
{
if (!$this->hasRetryPayment) {
$this->payu->validateOrder(
$this->context->cart->id, (int)Configuration::get('PAYU_PAYMENT_STATUS_PENDING'),
$this->context->cart->getOrderTotal(true, Cart::BOTH), $this->payu->displayName,
null, array(), (int)$this->context->cart->id_currency, false, $this->context->cart->secure_key,
Context::getContext()->shop->id ? new Shop((int)Context::getContext()->shop->id) : null
);
$this->order = new Order($this->payu->currentOrder);
}
$this->payu->generateExtOrderId($this->order->id);
$this->payu->order = $this->order;
try {
$result = $this->payu->orderCreateRequestByOrder($payMethod, $parameters);
$this->payu->payu_order_id = $result['orderId'];
$this->postOCR();
$redirectUrl = $result['redirectUri'] ? $result['redirectUri'] : $this->context->link->getModuleLink('payu', 'success', array('id' => $this->payu->getExtOrderId()));
SimplePayuLogger::addLog('order', __FUNCTION__, 'Process redirect to ' . $redirectUrl, $result['orderId']);
Tools::redirect($redirectUrl);
} catch (\Exception $e) {
SimplePayuLogger::addLog('order', __FUNCTION__, 'An error occurred while processing OCR - ' . $e->getMessage(), '');
if ($this->hasRetryPayment) {
return array('message' => $this->module->l('An error occurred while processing your payment. Please try again or contact the store.', 'payment') . ' ' . $result['error']);
}
return array(
'firstPayment' => true
);
}
}
private function postProcessPayment()
{
if ($this->context->cart->id_customer == 0 || $this->context->cart->id_address_delivery == 0 || $this->context->cart->id_address_invoice == 0 || !count($this->context->cart->getProducts())) {
Tools::redirectLink(__PS_BASE_URI__ . 'order.php?step=1');
}
$customer = new Customer($this->context->cart->id_customer);
if (!Validate::isLoadedObject($customer)) {
Tools::redirectLink(__PS_BASE_URI__ . 'order.php?step=1');
}
}
private function postProcessRetryPayment()
{
$id_order = (int)Tools::getValue('id_order');
$order_reference = Tools::getValue('order_reference');
if (!$id_order || !Validate::isUnsignedId($id_order)) {
Tools::redirect('index.php?controller=history');
}
$this->order = new Order($id_order);
if (!Validate::isLoadedObject($this->order) || $this->order->reference !== $order_reference) {
Tools::redirect('index.php?controller=history');
}
if (!$this->payu->hasRetryPayment($this->order->id, $this->order->current_state)) {
Tools::redirect('index.php?controller=history');
}
}
private function checkHasModuleActive()
{
if (!Module::isEnabled($this->module->name)) {
die($this->module->l('This payment method is not available.', 'payment'));
}
if (!$this->module->active) {
die($this->module->l('PayU module isn\'t active.', 'payment'));
}
}
private function checkHasRetryPayment()
{
$this->hasRetryPayment = Tools::getValue('id_order') !== false && Tools::getValue('order_reference') !== false;
}
private function getShowPayMethodsParameters()
{
$currency = $this->hasRetryPayment ? (int)$this->order->id_currency : (int)$this->context->cart->id_currency;
$this->payu->initializeOpenPayU(Currency::getCurrency($currency)['iso_code']);
$parameters = [
'posId' => OpenPayU_Configuration::getMerchantPosId(),
'orderCurrency' => $currency,
'payMethods' => $this->payu->getPaymethods(Currency::getCurrency($currency)),
'retryPayment' => $this->hasRetryPayment,
'lang' => Language::getIsoById($this->context->language->id)
];
if ($this->hasRetryPayment) {
return $parameters + array(
'total' => Tools::displayPrice($this->order->total_paid, $currency),
'payuPayAction' => $this->context->link->getModuleLink('payu', 'payment', array('id_order' => $this->order->id, 'order_reference' => $this->order->reference)),
'payuOrderInfo' => $this->module->l('Retry pay for your order', 'payment') . ' ' . $this->order->reference
);
} else {
return $parameters + array(
'total' => Tools::displayPrice($this->context->cart->getOrderTotal(true, Cart::BOTH)),
'payuPayAction' => $this->context->link->getModuleLink('payu', 'payment'),
'payuOrderInfo' => $this->module->l('The total amount of your order is', 'payment')
);
}
}
private function postOCR()
{
if ($this->hasRetryPayment) {
$history = new OrderHistory();
$history->id_order = $this->order->id;
$history->changeIdOrderState(Configuration::get('PAYU_PAYMENT_STATUS_PENDING'), $this->order->id);
$history->addWithemail(true);
}
$this->payu->addOrderSessionId(OpenPayuOrderStatus::STATUS_NEW, $this->order->id, 0, $this->payu->payu_order_id, $this->payu->getExtOrderId());
}
}

View File

@@ -0,0 +1,120 @@
<?php
/**
* PayU success
*
* @author PayU
* @copyright Copyright (c) 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
*/
class PayUSuccessModuleFrontController extends ModuleFrontController
{
private $order;
public function initContent()
{
parent::initContent();
$payu = new PayU();
$order_payment = $payu->getOrderPaymentByExtOrderId(Tools::getValue('id'));
if (!$order_payment) {
Tools::redirect('index.php?controller=history', __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently');
}
$payu->id_order = $order_payment['id_order'];
$payu->id_cart = $order_payment['id_cart'];
$payu->payu_order_id = $order_payment['id_session'];
$payu->updateOrderData();
$this->order = new Order($payu->id_order);
$currentState = $this->order->getCurrentStateFull($this->context->language->id);
$this->context->smarty->assign(array(
'payuLogo' => $payu->getPayuLogo('payu_logo_small.png'),
'orderPublicId' => $this->order->getUniqReference(),
'redirectUrl' => $this->getRedirectLink(),
'orderStatus' => $currentState['name'],
'HOOK_ORDER_CONFIRMATION' => $this->displayOrderConfirmation(),
'HOOK_PAYMENT_RETURN' => $this->displayPaymentReturn()
));
$this->setTemplate($payu->buildTemplatePath('status'));
}
private function getRedirectLink()
{
if (Cart::isGuestCartByCartId($this->order->id_cart)) {
$customer = new Customer((int)$this->order->id_customer);
return $this->context->link->getPageLink(
'guest-tracking',
null,
$this->context->language->id,
['order_reference' => $this->order->reference, 'email' => $customer->email]
);
}
return $this->context->link->getPageLink(
'order-detail',
null,
$this->context->language->id,
['id_order' => $this->order->id]
);
}
/**
* Execute the hook displayPaymentReturn
*/
private function displayPaymentReturn()
{
$params = $this->displayHook();
if ($params && is_array($params)) {
return Hook::exec('displayPaymentReturn', $params, $this->module->id);
}
return false;
}
/**
* Execute the hook displayOrderConfirmation
*/
private function displayOrderConfirmation()
{
$params = $this->displayHook();
if ($params && is_array($params)) {
return Hook::exec('displayOrderConfirmation', $params);
}
return false;
}
private function displayHook()
{
if (Validate::isLoadedObject($this->order)) {
$currency = new Currency((int) $this->order->id_currency);
return array(
'objOrder' => $this->order,
'order' => $this->order,
'currencyObj' => $currency,
'currency' => $currency->sign,
'total_to_pay' => $this->order->getOrdersTotalPaid()
);
}
return false;
}
}

View 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;

View 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;

384
modules/payu/css/payu.css Normal file
View File

@@ -0,0 +1,384 @@
.img-preview {
margin: 10px 0
}
.error {
color: red
}
p.payment_module a.payu {
background: #fbfbfb none;
padding: 33px 40px 34px 20px;
font-weight: bold;
}
p.payment_module a.payu_card {
background: url('../img/payu_cards.png') 15px 33px no-repeat #fbfbfb;
}
p.payment_module a.payu_card {
padding: 33px 40px 34px 170px;
}
p.payment_module a.payu:after, .payu-payment-credit-tile:after {
display: block;
content: "\f054";
position: absolute;
right: 15px;
margin-top: -11px;
top: 50%;
font-family: "FontAwesome";
font-size: 25px;
height: 22px;
width: 14px;
color: #777777;
}
.payu-payment-credit-installment-tile:after, .payu-payment-credit-later-tile:after, .payu-payment-credit-later-twisto-tile:after {
display: block;
content: "\f054";
position: absolute;
right: 31px;
margin-top: -11px;
top: 50%;
font-family: "FontAwesome";
font-size: 25px;
height: 22px;
width: 14px;
color: #777777;
}
p.payment_module a.payu:hover {
background-color: #f6f6f6;
}
.img-preview img {
max-width: 680px;
}
#payuAmountInfo {
float: left;
}
#payuLogo {
height: 60px;
float: right;
}
#payMethods {
clear: both;
overflow: auto;
margin-top: 20px;
}
.payMethod {
float: left;
overflow: hidden;
text-align: center;
margin: 3px;
height: 88px;
width: 140px;
border: 1px solid #dddddd;
border-radius: 3px;
background-color: #ffffff;
}
.payMethodEnable:hover {
background-color: #f9f9f9;
}
.payMethodActive {
border-color: #438F29;
background-color: #eeeeee;
}
.payMethod input[type="radio"] {
display: none;
}
.payMethodImage {
width: 120px;
height: 45px;
line-height: 45px;
text-align: center;
margin: 7px auto;
}
.payMethod label {
font-weight: normal;
font-size: 10px;
line-height: 120%;
padding: 0;
margin: 0 5px;
display: inline-block;
text-align: center;
}
.payMethodEnable label {
cursor: pointer;
}
.payMethodImage img {
max-width: 100%;
max-height: 100%;
}
.payuConditions {
margin: 20px 0;
font-size: 10px;
}
.payuConditions label {
font-size: 13px;
}
.payuConditions label a {
font-weight: bold;
}
p.payment_module_17 {
padding: 0;
margin: 0;
}
p.payment_module_17 a.payu {
display: block;
}
p.payment_module_17 a.payu img {
margin-right: 10px;
height: 70px;
vertical-align: middle;
}
.payu-installment-price-listing {
font-size: 12px;
}
.payu-installment-price-listing > p {
font-size: 12px;
display: inline-block;
}
.payment-option img[src*="payu_logo_small.png"],
.payment-option img[src*="payu_cards.png"]
{
margin-top: -3px;
margin-left: 3px;
}
@media only screen and (max-width: 390px) {
.payment-option img[src*="payu_logo_small.png"],
.payment-option img[src*="payu_cards.png"]
{
display: none;
}
}
.payu-pay-image-16 {
width: 50px;
height: 25px;
margin-top: 24px;
margin-bottom: 24px;
}
p.payment_module a.payu-payment-credit-tile {
padding: 33px;
background: #fbfbfb none;
}
.payu-widget-installments-mini, .payu-installment-cart-summary, .payu-widget-installments-mini-amount {
font-size: 14px;
}
.payu-widget-installments-mini-separator {
color: #777777;
}
.payu-installment-cart-summary {
margin-left: 20px;
}
.payu-payment-credit-installment-tile, .payu-payment-credit-later-tile, .payu-payment-credit-later-twisto-tile {
border: 1px solid #d6d4d4;
background: #fbfbfb none;
padding: 36px 40px 36px 31px;
border-radius: 5px;
font-weight: bold;
font-size: 17px;
color: #333;
cursor: pointer;
letter-spacing: -1px;
margin-bottom: 10px;
}
.payu-payment-credit-installment-tile:hover, .payu-payment-credit-later-tile:hover, .payu-payment-credit-later-twisto-tile:hover, p.payment_module a.payu-payment-credit-tile:hover {
background: #f6f6f6 none;
}
.payu-separator-reset {
position: absolute;
left: 0;
right: 0;
}
.payu-installment-panel {
padding-bottom: 1.25em;
}
.payu-script-tag {
display: none !important;
}
p.payment_module a.payu-widget-installments-mini {
display: inline;
border: 0px;
padding: 0px;
}
.payu-payment-fieldset-1-6 {
border: 1px solid #a6c307;
margin: 0 2px;
padding-left: 8px;
padding-right: 8px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
.payu-payment-legend-1-6 {
width: 0;
}
.payu-payment-legend-1-6 .logo {
display: inline-block;
height: 30px;
width: 70px;
background: #ffffff url('../img/payu_logo_small.png') no-repeat center;
}
.payu-payment-fieldset-1-7 {
border: 1px solid #a6c307;
margin: 0 2px;
padding-left: 8px;
padding-right: 8px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
.payu-payment-legend-1-7 {
width: 0;
}
.payu-payment-legend-1-7 .logo {
display: inline-block;
height: 30px;
width: 70px;
background: #ffffff url('../img/payu_logo_small.png') no-repeat center;
}
.payu-marker-class {
display: none;
}
body#checkout #payu-methods-grouped .additional-information {
margin:0;
}
.payu-method-description {
margin-left: 2.875rem;
margin-top: 1.25rem;
}
.payu-checkout-installment {
margin-bottom: -10px;
}
.payu-card-form-container {
width: 380px;
margin: 5px auto 15px;
}
.payu-card-container {
width: 100%;
margin: 0 auto;
color: #ffffff;
border-radius: 6px;
padding: 15px 10px;
border: 1px solid #428f29;
background: rgba(66, 143, 41, 1);
background: linear-gradient(135deg, rgba(53, 112, 33, 1) 0%, rgba(66, 143, 41, 1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#357021', endColorstr='#428f29', GradientType=1);
}
.payu-card-container div.aside {
font-size: 14px;
margin-bottom: 6px;
}
.payu-card-form {
margin: 0 auto 0 auto;
background-color: #ffffff;
padding: 5px;
border-radius: 4px;
}
.card-details .expiration {
width: 50%;
float: left;
}
.card-details .cvv {
width: 45%;
float: right;
}
.payu-card-clearfix:before, .payu-card-clearfix:after {
content: "";
display: table;
}
.payu-card-clearfix:after { clear: both; }
.payu-card-clearfix {
margin-top: 10px;
}
.payu-card-legend-container {
color: #ffffff;
font-size: 12px;
font-weight: bold;
overflow: auto
}
.payu-card-legend-container > div {
float: left;
}
.payu-card-legend-container > .payu-card-legend-number {
width: 220px;
margin-left: 45px
}
.payu-card-legend-container > .payu-card-legend-valid {
width: 85px
}
#secure-form {
background-color: #F4F9F9;
border-radius: 8px;
padding: 10px;
}
.payu-read-more {
cursor: pointer;
text-decoration: underline;
}
.payu-more-hidden {
display: none;
}
@media only screen and (max-width: 460px) {
.payu-installment-cart-summary {
display: block;
margin-left: 0px;
margin-top: 5px;
}
.payu-card-form-container {
width: 100%;
margin: 5px auto 15px;
}
}

View 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;

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 787 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 635 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

20
modules/payu/index.php Normal file
View File

@@ -0,0 +1,20 @@
<?php
/**
* PayU
*
* @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
*/
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;

66
modules/payu/js/payu.js Normal file
View File

@@ -0,0 +1,66 @@
var openpayu = openpayu || {};
openpayu.options = openpayu.options || {};
$(document).ready(function () {
$('.payMethodEnable .payMethodLabel').click(function () {
$('.payMethod').removeClass('payMethodActive');
$(this).closest('.payMethod').addClass('payMethodActive');
$(this).prev().prop('checked', true);
if ($(this).data('autosubmit')) {
$('#payuForm').submit();
}
});
$('#HOOK_PAYMENT').on('click', 'a.payu', function () {
return doubleClickPrevent(this);
});
$('#payuForm').submit(function () {
return doubleClickPrevent(this);
});
$('#payuRetryPayment17').insertBefore($('#order-history'));
if (window.payuPaymentLoaded) {
groupPayuMethod();
}
$('.payu-read-more').on('click', function () {
$(this).hide();
var elementToShow = $(this).data('more');
$('#' + elementToShow).show();
});
});
function doubleClickPrevent(object) {
if ($(object).data('clicked')) {
return false;
}
$(object).data('clicked', true);
return true;
}
function groupPayuMethod() {
var payuIndexes = [];
for (var i = 0; i < 20; ++i) {
var isFound = $("#payment-option-" + i + "-additional-information .payu-marker-class").length > 0;
if (isFound) {
payuIndexes.push(i);
}
}
if (payuIndexes.length > 0) {
$(".payment-options").append("<fieldset id='payu-methods-grouped' class='payu-payment-fieldset-1-7'>" +
" <legend class='payu-payment-legend-1-7'>" +
" <span class='logo' />" +
" </legend>" +
"</fieldset>");
}
for (var indexOfPayuElement in payuIndexes) {
var element1 = $("#payment-option-" + payuIndexes[indexOfPayuElement] + "-container").parent();
var element2 = $("#payment-option-" + payuIndexes[indexOfPayuElement] + "-additional-information");
var element3 = $("#pay-with-payment-option-" + payuIndexes[indexOfPayuElement] + "-form");
element1.detach().appendTo('#payu-methods-grouped');
element2.detach().appendTo('#payu-methods-grouped');
element3.detach().appendTo('#payu-methods-grouped');
}
}

View File

View File

View File

BIN
modules/payu/logo.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 609 B

BIN
modules/payu/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

1844
modules/payu/payu.php Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,77 @@
<?php
if (!defined('_PS_VERSION_')) {
exit;
}
include_once(_PS_MODULE_DIR_ . '/payu/tools/sdk/openpayu.php');
include_once(_PS_MODULE_DIR_ . '/payu/tools/sdk/PayUSDKInitializer.php');
include_once(_PS_MODULE_DIR_ . '/payu/tools/SimplePayuLogger/SimplePayuLogger.php');
class PayMethodsCache
{
const PAYU_PAY_METHODS_CACHE_CONFIG_PREFIX = 'PAYU_PAY_METHODS_';
public static function isDelayedPaymentTwistoAvailable($currency, $version)
{
return self::isPaytypeAvailable('dpt', $currency, $version);
}
public static function isInstallmentsAvailable($currency, $version)
{
return self::isPaytypeAvailable('ai', $currency, $version);
}
public static function isPaytypeAvailable($paytype, $currency, $version, $noCache = false)
{
try {
return self::isPayTypeEnabled($paytype, $currency, $version, $noCache);
} catch (Exception $e) {
return false;
}
}
private static function isPayTypeEnabled($payTypeStringValue, $currency, $version, $noCache)
{
$payTypeEnabled = false;
$currentTime = new DateTime();
$sdkInitializer = new PayUSDKInitializer();
$sdkInitializer->initializeOpenPayU($currency['iso_code'], $version);
$cacheKey = OpenPayU_Configuration::getMerchantPosId() . '_' . $payTypeStringValue;
$cachedValue = self::get($cacheKey);
if ($noCache !== true && $cachedValue !== null && $cachedValue['valid_to'] > $currentTime) {
$payTypeEnabled = $cachedValue['enabled'];
} else {
$payMethods = OpenPayU_Retrieve::payMethods();
foreach ($payMethods->getResponse()->payByLinks as $payType) {
if ($payType->value === $payTypeStringValue) {
$payTypeEnabled = $payType->status === "ENABLED";
}
}
$validityTime = $currentTime;
$validityTime->add(new DateInterval('PT15M')); // paymethods are cached for 15m
$toBeCached = array('enabled' => $payTypeEnabled, 'valid_to' => $validityTime);
self::set($cacheKey, $toBeCached);
}
return $payTypeEnabled;
}
private static function get($key)
{
$cache = Configuration::get(self::PAYU_PAY_METHODS_CACHE_CONFIG_PREFIX . $key);
return $cache === false ? null : unserialize($cache);
}
private static function set($key, $value)
{
return Configuration::updateValue(self::PAYU_PAY_METHODS_CACHE_CONFIG_PREFIX . $key, serialize($value));
}
}

View File

@@ -0,0 +1,23 @@
<?php
class OauthCachePresta implements OauthCacheInterface
{
const PAYU_CACHE_CONFIG_PREFIX = 'PAYU_';
public function get($key)
{
$cache = Configuration::get(self::PAYU_CACHE_CONFIG_PREFIX . $key);
return $cache === false ? null : unserialize($cache);
}
public function set($key, $value)
{
return Configuration::updateValue(self::PAYU_CACHE_CONFIG_PREFIX . $key, serialize($value));
}
public function invalidate($key)
{
return Configuration::deleteByName(self::PAYU_CACHE_CONFIG_PREFIX . $key);
}
}

View File

@@ -0,0 +1,81 @@
<?php
define('LOG_DIR', _PS_MODULE_DIR_ . 'payu/log/');
define('LOG_LEVEL', 0);
class SimplePayuLogger
{
const CUSTOM_DATE_FORMAT = 'Y-m-d G:i:s.u';
public static $logFile = 'payu.log';
public static function addLog($type, $function, $message, $order_id = '', $comment = '')
{
if (LOG_LEVEL == 1) {
set_error_handler(array('SimplePayuLogger', 'runtimeErrorHandler'));
$file = self::$logFile;
if (is_array($type)) {
foreach ($type as $t) {
$file = LOG_DIR . $type . '.log';
self::writeToLog($function, $message, $order_id, $file, $comment);
}
} else {
$file = LOG_DIR . $type . '.log';
self::writeToLog($function, $message, $order_id, $file, $comment);
}
}
}
public static function formatMessage($message, $order_id, $function, $comment)
{
return "[" . self::getTimestamp() . "]".' <' . $order_id . '> ' . ' {' . $function . '} ' . (($comment == '')?'':($comment . PHP_EOL)) . $message . PHP_EOL;
}
public static function getTimestamp()
{
$originalTime = microtime(true);
$micro = sprintf("%06d", ($originalTime - floor($originalTime)) * 1000000);
$date = new DateTime(date('Y-m-d H:i:s.' . $micro, $originalTime));
return $date->format(self::CUSTOM_DATE_FORMAT);
}
/**
* @param $function
* @param $message
* @param $order_id
*/
private static function writeToLog($function, $message, $order_id, $logFile, $comment)
{
if (!file_exists($logFile)) {
fopen($logFile, 'a');
};
if (!self::$logFile) {
throw new RuntimeException('Cannot open' . $logFile . ' file!');
}
file_put_contents($logFile, self::formatMessage($message, $order_id, $function, $comment), FILE_APPEND);
}
public static function runtimeErrorHandler($type, $message, $file, $line)
{
switch ($type) {
case E_ERROR:
self::addLog('error', $type . ' runtimeError in ' . $file, 'In line: ' . $line . ' with message: ' . $message);
break;
case E_WARNING:
self::addLog('error', $type . ' runtimeError in ' . $file, 'In line: ' . $line . ' with message: ' . $message);
break;
case E_NOTICE:
self::addLog('error', $type . ' runtimeError in ' . $file, 'In line: ' . $line . ' with message: ' . $message);
break;
default:
self::addLog('error', $type . ' runtimeError in ' . $file, 'In line: ' . $line . ' with message: ' . $message);
break;
}
return true;
}
}

View 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;

View File

@@ -0,0 +1,12 @@
<?php
interface AuthType
{
/**
* @return array
*/
public function getHeaders();
}

View File

@@ -0,0 +1,33 @@
<?php
class AuthType_Basic implements AuthType
{
/**
* @var string
*/
private $authBasicToken;
public function __construct($posId, $signatureKey)
{
if (empty($posId)) {
throw new OpenPayU_Exception_Configuration('PosId is empty');
}
if (empty($signatureKey)) {
throw new OpenPayU_Exception_Configuration('SignatureKey is empty');
}
$this->authBasicToken = base64_encode($posId . ':' . $signatureKey);
}
public function getHeaders()
{
return array(
'Content-Type: application/json',
'Accept: application/json',
'Authorization: Basic ' . $this->authBasicToken
);
}
}

View File

@@ -0,0 +1,39 @@
<?php
class AuthType_Oauth implements AuthType
{
/**
* @var OauthResultClientCredentials
*/
private $oauthResult;
public function __construct($clientId, $clientSecret)
{
if (empty($clientId)) {
throw new OpenPayU_Exception_Configuration('ClientId is empty');
}
if (empty($clientSecret)) {
throw new OpenPayU_Exception_Configuration('ClientSecret is empty');
}
try {
$this->oauthResult = OpenPayU_Oauth::getAccessToken();
} catch (OpenPayU_Exception $e) {
throw new OpenPayU_Exception('Oauth error: [code=' . $e->getCode() . '], [message=' . $e->getMessage() . ']');
}
}
public function getHeaders()
{
return array(
'Content-Type: application/json',
'Accept: */*',
'Authorization: Bearer ' . $this->oauthResult->getAccessToken()
);
}
}

View File

@@ -0,0 +1,14 @@
<?php
class AuthType_TokenRequest implements AuthType
{
public function getHeaders()
{
return array(
'Content-Type: application/x-www-form-urlencoded',
'Accept: */*'
);
}
}

View File

@@ -0,0 +1,424 @@
<?php
/**
* OpenPayU Standard Library
*
* @copyright Copyright (c) 2011-2017 PayU
* @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
* http://www.payu.com
* http://developers.payu.com
*/
class OpenPayU_Configuration
{
private static $_availableEnvironment = array('custom', 'secure', 'sandbox');
private static $_availableHashAlgorithm = array('SHA', 'SHA-256', 'SHA-384', 'SHA-512');
private static $env = 'secure';
/**
* Merchant Pos ID for Auth Basic and Notification Consume
*/
private static $merchantPosId = '';
/**
* Signature Key for Auth Basic and Notification Consume
*/
private static $signatureKey = '';
/**
* OAuth protocol - default type
*/
private static $oauthGrantType = OauthGrantType::CLIENT_CREDENTIAL;
/**
* OAuth protocol - client_id
*/
private static $oauthClientId = '';
/**
* OAuth protocol - client_secret
*/
private static $oauthClientSecret = '';
/**
* OAuth protocol - email
*/
private static $oauthEmail = '';
/**
* OAuth protocol - extCustomerId
*/
private static $oauthExtCustomerId;
/**
* OAuth protocol - endpoint address
*/
private static $oauthEndpoint = '';
/**
* OAuth protocol - methods for token cache
*/
private static $oauthTokenCache = null;
/**
* Proxy - host
*/
private static $proxyHost = null;
/**
* Proxy - port
*/
private static $proxyPort = null;
/**
* Proxy - user
*/
private static $proxyUser = null;
/**
* Proxy - password
*/
private static $proxyPassword = null;
private static $serviceUrl = '';
private static $hashAlgorithm = 'SHA-256';
private static $sender = 'Generic';
const API_VERSION = '2.1';
const COMPOSER_JSON = "/composer.json";
const DEFAULT_SDK_VERSION = 'PHP SDK 2.2.13';
const OAUTH_CONTEXT = 'pl/standard/user/oauth/authorize';
/**
* @return string
*/
public static function getApiVersion()
{
return self::API_VERSION;
}
/**
* @param string
* @throws OpenPayU_Exception_Configuration
*/
public static function setHashAlgorithm($value)
{
if (!in_array($value, self::$_availableHashAlgorithm)) {
throw new OpenPayU_Exception_Configuration('Hash algorithm "' . $value . '"" is not available');
}
self::$hashAlgorithm = $value;
}
/**
* @return string
*/
public static function getHashAlgorithm()
{
return self::$hashAlgorithm;
}
/**
* @param string $environment
* @param string $domain
* @param string $api
* @param string $version
* @throws OpenPayU_Exception_Configuration
*/
public static function setEnvironment($environment = 'secure', $domain = 'payu.com', $api = 'api/', $version = 'v2_1/')
{
$environment = strtolower($environment);
$domain = strtolower($domain) . '/';
if (!in_array($environment, self::$_availableEnvironment)) {
throw new OpenPayU_Exception_Configuration($environment . ' - is not valid environment');
}
self::$env = $environment;
if ($environment == 'secure') {
self::$serviceUrl = 'https://' . $environment . '.' . $domain . $api . $version;
self::$oauthEndpoint = 'https://' . $environment . '.' . $domain . self::OAUTH_CONTEXT;
} else if ($environment == 'sandbox') {
self::$serviceUrl = 'https://secure.snd.' . $domain . $api . $version;
self::$oauthEndpoint = 'https://secure.snd.' . $domain . self::OAUTH_CONTEXT;
} else if ($environment == 'custom') {
self::$serviceUrl = $domain . $api . $version;
self::$oauthEndpoint = $domain . self::OAUTH_CONTEXT;
}
}
/**
* @return string
*/
public static function getServiceUrl()
{
return self::$serviceUrl;
}
/**
* @return string
*/
public static function getOauthEndpoint()
{
return self::$oauthEndpoint;
}
/**
* @return string
*/
public static function getEnvironment()
{
return self::$env;
}
/**
* @param string
*/
public static function setMerchantPosId($value)
{
self::$merchantPosId = trim($value);
}
/**
* @return string
*/
public static function getMerchantPosId()
{
return self::$merchantPosId;
}
/**
* @param string
*/
public static function setSignatureKey($value)
{
self::$signatureKey = trim($value);
}
/**
* @return string
*/
public static function getSignatureKey()
{
return self::$signatureKey;
}
/**
* @return string
*/
public static function getOauthGrantType()
{
return self::$oauthGrantType;
}
/**
* @param string $oauthGrantType
* @throws OpenPayU_Exception_Configuration
*/
public static function setOauthGrantType($oauthGrantType)
{
if ($oauthGrantType !== OauthGrantType::CLIENT_CREDENTIAL && $oauthGrantType !== OauthGrantType::TRUSTED_MERCHANT) {
throw new OpenPayU_Exception_Configuration('Oauth grand type "' . $oauthGrantType . '"" is not available');
}
self::$oauthGrantType = $oauthGrantType;
}
/**
* @return string
*/
public static function getOauthClientId()
{
return self::$oauthClientId;
}
/**
* @return string
*/
public static function getOauthClientSecret()
{
return self::$oauthClientSecret;
}
/**
* @param mixed $oauthClientId
*/
public static function setOauthClientId($oauthClientId)
{
self::$oauthClientId = trim($oauthClientId);
}
/**
* @param mixed $oauthClientSecret
*/
public static function setOauthClientSecret($oauthClientSecret)
{
self::$oauthClientSecret = trim($oauthClientSecret);
}
/**
* @return mixed
*/
public static function getOauthEmail()
{
return self::$oauthEmail;
}
/**
* @param mixed $oauthEmail
*/
public static function setOauthEmail($oauthEmail)
{
self::$oauthEmail = $oauthEmail;
}
/**
* @return mixed
*/
public static function getOauthExtCustomerId()
{
return self::$oauthExtCustomerId;
}
/**
* @param mixed $oauthExtCustomerId
*/
public static function setOauthExtCustomerId($oauthExtCustomerId)
{
self::$oauthExtCustomerId = $oauthExtCustomerId;
}
/**
* @return null | OauthCacheInterface
*/
public static function getOauthTokenCache()
{
return self::$oauthTokenCache;
}
/**
* @param OauthCacheInterface $oauthTokenCache
* @throws OpenPayU_Exception_Configuration
*/
public static function setOauthTokenCache($oauthTokenCache)
{
if (!$oauthTokenCache instanceof OauthCacheInterface) {
throw new OpenPayU_Exception_Configuration('Oauth token cache class is not instance of OauthCacheInterface');
}
self::$oauthTokenCache = $oauthTokenCache;
}
/**
* @return string | null
*/
public static function getProxyHost()
{
return self::$proxyHost;
}
/**
* @param string | null $proxyHost
*/
public static function setProxyHost($proxyHost)
{
self::$proxyHost = $proxyHost;
}
/**
* @return int | null
*/
public static function getProxyPort()
{
return self::$proxyPort;
}
/**
* @param int | null $proxyPort
*/
public static function setProxyPort($proxyPort)
{
self::$proxyPort = $proxyPort;
}
/**
* @return string | null
*/
public static function getProxyUser()
{
return self::$proxyUser;
}
/**
* @param string | null $proxyUser
*/
public static function setProxyUser($proxyUser)
{
self::$proxyUser = $proxyUser;
}
/**
* @return string | null
*/
public static function getProxyPassword()
{
return self::$proxyPassword;
}
/**
* @param string | null $proxyPassword
*/
public static function setProxyPassword($proxyPassword)
{
self::$proxyPassword = $proxyPassword;
}
/**
* @param string $sender
*/
public static function setSender($sender)
{
self::$sender = $sender;
}
/**
* @return string
*/
public static function getSender()
{
return self::$sender;
}
/**
* @return string
*/
public static function getFullSenderName()
{
return sprintf("%s@%s", self::getSender(), self::getSdkVersion());
}
/**
* @return string
*/
public static function getSdkVersion()
{
$composerFilePath = self::getComposerFilePath();
if (file_exists($composerFilePath)) {
$fileContent = file_get_contents($composerFilePath);
$composerData = json_decode($fileContent);
if (isset($composerData->version) && isset($composerData->extra[0]->engine)) {
return sprintf("%s %s", $composerData->extra[0]->engine, $composerData->version);
}
}
return self::DEFAULT_SDK_VERSION;
}
/**
* @return string
*/
private static function getComposerFilePath()
{
return realpath(dirname(__FILE__)) . '/../../' . self::COMPOSER_JSON;
}
}

View File

@@ -0,0 +1,167 @@
<?php
/**
* OpenPayU Standard Library
*
* @copyright Copyright (c) 2011-2016 PayU
* @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
* http://www.payu.com
* http://developers.payu.com
*/
class OpenPayU_Http
{
/**
* @param string $pathUrl
* @param string $data
* @param AuthType $authType
* @return mixed
* @throws OpenPayU_Exception_Configuration
* @throws OpenPayU_Exception_Network
*/
public static function doPost($pathUrl, $data, $authType)
{
$response = OpenPayU_HttpCurl::doPayuRequest('POST', $pathUrl, $authType, $data);
return $response;
}
/**
* @param string $pathUrl
* @param AuthType $authType
* @return mixed
* @throws OpenPayU_Exception_Configuration
* @throws OpenPayU_Exception_Network
*/
public static function doGet($pathUrl, $authType)
{
$response = OpenPayU_HttpCurl::doPayuRequest('GET', $pathUrl, $authType);
return $response;
}
/**
* @param string $pathUrl
* @param AuthType $authType
* @return mixed
* @throws OpenPayU_Exception_Configuration
* @throws OpenPayU_Exception_Network
*/
public static function doDelete($pathUrl, $authType)
{
$response = OpenPayU_HttpCurl::doPayuRequest('DELETE', $pathUrl, $authType);
return $response;
}
/**
* @param string $pathUrl
* @param string $data
* @param AuthType $authType
* @return mixed
* @throws OpenPayU_Exception_Configuration
* @throws OpenPayU_Exception_Network
*/
public static function doPut($pathUrl, $data, $authType)
{
$response = OpenPayU_HttpCurl::doPayuRequest('PUT', $pathUrl, $authType, $data);
return $response;
}
/**
* @param $statusCode
* @param null $message
* @throws OpenPayU_Exception
* @throws OpenPayU_Exception_Request
* @throws OpenPayU_Exception_Authorization
* @throws OpenPayU_Exception_Network
* @throws OpenPayU_Exception_ServerMaintenance
* @throws OpenPayU_Exception_ServerError
*/
public static function throwHttpStatusException($statusCode, $message = null)
{
$response = $message->getResponse();
$statusDesc = isset($response->status->statusDesc) ? $response->status->statusDesc : '';
switch ($statusCode) {
case 400:
throw new OpenPayU_Exception_Request($message, $message->getStatus().' - '.$statusDesc, $statusCode);
break;
case 401:
case 403:
throw new OpenPayU_Exception_Authorization($message->getStatus().' - '.$statusDesc, $statusCode);
break;
case 404:
throw new OpenPayU_Exception_Network($message->getStatus().' - '.$statusDesc, $statusCode);
break;
case 408:
throw new OpenPayU_Exception_ServerError('Request timeout', $statusCode);
break;
case 500:
throw new OpenPayU_Exception_ServerError('PayU system is unavailable or your order is not processed.
Error:
[' . $statusDesc . ']', $statusCode);
break;
case 503:
throw new OpenPayU_Exception_ServerMaintenance('Service unavailable', $statusCode);
break;
default:
throw new OpenPayU_Exception_Network('Unexpected HTTP code response', $statusCode);
break;
}
}
/**
* @param $statusCode
* @param ResultError $resultError
* @throws OpenPayU_Exception
* @throws OpenPayU_Exception_Authorization
* @throws OpenPayU_Exception_Network
* @throws OpenPayU_Exception_ServerError
* @throws OpenPayU_Exception_ServerMaintenance
*/
public static function throwErrorHttpStatusException($statusCode, $resultError)
{
switch ($statusCode) {
case 400:
throw new OpenPayU_Exception($resultError->getError().' - '.$resultError->getErrorDescription(), $statusCode);
break;
case 401:
case 403:
throw new OpenPayU_Exception_Authorization($resultError->getError().' - '.$resultError->getErrorDescription(), $statusCode);
break;
case 404:
throw new OpenPayU_Exception_Network($resultError->getError().' - '.$resultError->getErrorDescription(), $statusCode);
break;
case 408:
throw new OpenPayU_Exception_ServerError('Request timeout', $statusCode);
break;
case 500:
throw new OpenPayU_Exception_ServerError('PayU system is unavailable. Error: [' . $resultError->getErrorDescription() . ']', $statusCode);
break;
case 503:
throw new OpenPayU_Exception_ServerMaintenance('Service unavailable', $statusCode);
break;
default:
throw new OpenPayU_Exception_Network('Unexpected HTTP code response', $statusCode);
break;
}
}
}

View File

@@ -0,0 +1,109 @@
<?php
/**
* OpenPayU Standard Library
*
* @copyright Copyright (c) 2011-2016 PayU
* @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
* http://www.payu.com
* http://developers.payu.com
*/
class OpenPayU_HttpCurl
{
/**
* @var
*/
static $headers;
/**
* @param $requestType
* @param $pathUrl
* @param $data
* @param AuthType $auth
* @return array
* @throws OpenPayU_Exception_Configuration
* @throws OpenPayU_Exception_Network
*/
public static function doPayuRequest($requestType, $pathUrl, $auth, $data = null)
{
if (empty($pathUrl)) {
throw new OpenPayU_Exception_Configuration('The endpoint is empty');
}
$ch = curl_init($pathUrl);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $requestType);
curl_setopt($ch, CURLOPT_ENCODING, 'gzip');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, $auth->getHeaders());
curl_setopt($ch, CURLOPT_HEADERFUNCTION, 'OpenPayU_HttpCurl::readHeader');
if ($data) {
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
}
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
if ($proxy = self::getProxy()) {
curl_setopt($ch, CURLOPT_PROXY, $proxy);
if ($proxyAuth = self::getProxyAuth()) {
curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxyAuth);
}
}
$response = curl_exec($ch);
$httpStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if($response === false) {
throw new OpenPayU_Exception_Network(curl_error($ch));
}
curl_close($ch);
return array('code' => $httpStatus, 'response' => trim($response));
}
/**
* @param array $headers
*
* @return mixed
*/
public static function getSignature($headers)
{
foreach($headers as $name => $value)
{
if(preg_match('/X-OpenPayU-Signature/i', $name) || preg_match('/OpenPayu-Signature/i', $name))
return $value;
}
return null;
}
/**
* @param resource $ch
* @param string $header
* @return int
*/
public static function readHeader($ch, $header)
{
if( preg_match('/([^:]+): (.+)/m', $header, $match) ) {
self::$headers[$match[1]] = trim($match[2]);
}
return strlen($header);
}
private static function getProxy()
{
return OpenPayU_Configuration::getProxyHost() != null ? OpenPayU_Configuration::getProxyHost()
. (OpenPayU_Configuration::getProxyPort() ? ':' . OpenPayU_Configuration::getProxyPort() : '') : false;
}
private static function getProxyAuth()
{
return OpenPayU_Configuration::getProxyUser() != null ? OpenPayU_Configuration::getProxyUser()
. (OpenPayU_Configuration::getProxyPassword() ? ':' . OpenPayU_Configuration::getProxyPassword() : '') : false;
}
}

View File

@@ -0,0 +1,100 @@
<?php
class Shop
{
/** @var string */
private $shopId;
/** @var string */
private $name;
/** @var string */
private $currencyCode;
/** @var Balance */
private $balance;
/**
* @return string
*/
public function getShopId()
{
return $this->shopId;
}
/**
* @param string $shopId
* @return Shop
*/
public function setShopId($shopId)
{
$this->shopId = $shopId;
return $this;
}
/**
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* @param string $name
* @return Shop
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* @return string
*/
public function getCurrencyCode()
{
return $this->currencyCode;
}
/**
* @param string $currencyCode
* @return Shop
*/
public function setCurrencyCode($currencyCode)
{
$this->currencyCode = $currencyCode;
return $this;
}
/**
* @return Balance
*/
public function getBalance()
{
return $this->balance;
}
/**
* @param Balance $balance
* @return Shop
*/
public function setBalance($balance)
{
$this->balance = $balance;
return $this;
}
/**
* @return string
*/
public function __toString()
{
return 'Shop [currencyCode=' . $this->shopId .
', name=' . $this->name .
', currencyCode=' . $this->currencyCode .
', balance=' . $this->balance .
']';
}
}

View File

@@ -0,0 +1,78 @@
<?php
class Balance
{
/** @var string */
private $currencyCode;
/** @var int */
private $total;
/** @var int */
private $available;
/**
* @return string
*/
public function getCurrencyCode()
{
return $this->currencyCode;
}
/**
* @param string $currencyCode
* @return Balance
*/
public function setCurrencyCode($currencyCode)
{
$this->currencyCode = $currencyCode;
return $this;
}
/**
* @return int
*/
public function getTotal()
{
return $this->total;
}
/**
* @param int $total
* @return Balance
*/
public function setTotal($total)
{
$this->total = $total;
return $this;
}
/**
* @return int
*/
public function getAvailable()
{
return $this->available;
}
/**
* @param int $available
* @return Balance
*/
public function setAvailable($available)
{
$this->available = $available;
return $this;
}
/**
* @return string
*/
public function __toString()
{
return 'Balance [currencyCode=' . $this->currencyCode .
', total=' . $this->total .
', available=' . $this->available .
']';
}
}

View File

@@ -0,0 +1,40 @@
<?php
class OauthCacheFile implements OauthCacheInterface
{
private $directory;
/**
* @param string $directory
* @throws OpenPayU_Exception_Configuration
*/
public function __construct($directory = null)
{
if ($directory === null) {
$directory = dirname(__FILE__).'/../../../Cache';
}
if (!is_dir($directory) || !is_writable($directory)) {
throw new OpenPayU_Exception_Configuration('Cache directory [' . $directory . '] not exist or not writable.');
}
$this->directory = $directory . (substr($directory, -1) != '/' ? '/' : '');
}
public function get($key)
{
$cache = @file_get_contents($this->directory . md5($key));
return $cache === false ? null : unserialize($cache);
}
public function set($key, $value)
{
return @file_put_contents($this->directory . md5($key), serialize($value));
}
public function invalidate($key)
{
return @unlink($this->directory . md5($key));
}
}

View File

@@ -0,0 +1,26 @@
<?php
interface OauthCacheInterface
{
/**
* @param string $key
* @return null | object
*/
public function get($key);
/**
* @param string $key
* @param object $value
* @return bool
*/
public function set($key, $value);
/**
* @param string $key
* @return bool
*/
public function invalidate($key);
}

View File

@@ -0,0 +1,43 @@
<?php
class OauthCacheMemcached implements OauthCacheInterface
{
private $memcached;
/**
* @param string $host
* @param int $port
* @param int $weight
* @throws OpenPayU_Exception_Configuration
*/
public function __construct($host = 'localhost', $port = 11211, $weight = 0)
{
if (!class_exists('Memcached')) {
throw new OpenPayU_Exception_Configuration('PHP Memcached extension not installed.');
}
$this->memcached = new Memcached('PayU');
$this->memcached->addServer($host, $port, $weight);
$stats = $this->memcached->getStats();
if ($stats[$host . ':' . $port]['pid'] == -1) {
throw new OpenPayU_Exception_Configuration('Problem with connection to memcached server [host=' . $host . '] [port=' . $port . '] [weight=' . $weight . ']');
}
}
public function get($key)
{
$cache = $this->memcached->get($key);
return $cache === false ? null : unserialize($cache);
}
public function set($key, $value)
{
return $this->memcached->set($key, serialize($value));
}
public function invalidate($key)
{
return $this->memcached->delete($key);
}
}

View File

@@ -0,0 +1,123 @@
<?php
class OpenPayU_Oauth
{
/**
* @var OauthCacheInterface
*/
private static $oauthTokenCache;
const CACHE_KEY = 'AccessToken';
/**
* @param string $clientId
* @param string $clientSecret
* @return OauthResultClientCredentials
* @throws OpenPayU_Exception_ServerError
*/
public static function getAccessToken($clientId = null, $clientSecret = null)
{
if (OpenPayU_Configuration::getOauthGrantType() === OauthGrantType::TRUSTED_MERCHANT) {
return self::retrieveAccessToken($clientId, $clientSecret);
}
$cacheKey = self::CACHE_KEY . OpenPayU_Configuration::getOauthClientId();
self::getOauthTokenCache();
$tokenCache = self::$oauthTokenCache->get($cacheKey);
if ($tokenCache instanceof OauthResultClientCredentials && !$tokenCache->hasExpire()) {
return $tokenCache;
}
self::$oauthTokenCache->invalidate($cacheKey);
$response = self::retrieveAccessToken($clientId, $clientSecret);
self::$oauthTokenCache->set($cacheKey, $response);
return $response;
}
/**
* @param $clientId
* @param $clientSecret
* @return OauthResultClientCredentials
* @throws OpenPayU_Exception_ServerError
*/
private static function retrieveAccessToken($clientId, $clientSecret)
{
$authType = new AuthType_TokenRequest();
$oauthUrl = OpenPayU_Configuration::getOauthEndpoint();
$data = array(
'grant_type' => OpenPayU_Configuration::getOauthGrantType(),
'client_id' => $clientId ? $clientId : OpenPayU_Configuration::getOauthClientId(),
'client_secret' => $clientSecret ? $clientSecret : OpenPayU_Configuration::getOauthClientSecret()
);
if (OpenPayU_Configuration::getOauthGrantType() === OauthGrantType::TRUSTED_MERCHANT) {
$data['email'] = OpenPayU_Configuration::getOauthEmail();
$data['ext_customer_id'] = OpenPayU_Configuration::getOauthExtCustomerId();
}
return self::parseResponse(OpenPayU_Http::doPost($oauthUrl, http_build_query($data, '', '&'), $authType));
}
/**
* Parse response from PayU
*
* @param array $response
* @return OauthResultClientCredentials
* @throws OpenPayU_Exception
* @throws OpenPayU_Exception_Authorization
* @throws OpenPayU_Exception_Network
* @throws OpenPayU_Exception_ServerError
* @throws OpenPayU_Exception_ServerMaintenance
*/
private static function parseResponse($response)
{
$httpStatus = $response['code'];
if ($httpStatus == 500) {
$result = new ResultError();
$result->setErrorDescription($response['response']);
OpenPayU_Http::throwErrorHttpStatusException($httpStatus, $result);
}
$message = OpenPayU_Util::convertJsonToArray($response['response'], true);
if (json_last_error() == JSON_ERROR_SYNTAX) {
throw new OpenPayU_Exception_ServerError('Incorrect json response. Response: [' . $response['response'] . ']');
}
if ($httpStatus == 200) {
$result = new OauthResultClientCredentials();
$result->setAccessToken($message['access_token'])
->setTokenType($message['token_type'])
->setExpiresIn($message['expires_in'])
->setGrantType($message['grant_type'])
->calculateExpireDate(new \DateTime());
return $result;
}
$result = new ResultError();
$result->setError($message['error'])
->setErrorDescription($message['error_description']);
OpenPayU_Http::throwErrorHttpStatusException($httpStatus, $result);
}
private static function getOauthTokenCache()
{
$oauthTokenCache = OpenPayU_Configuration::getOauthTokenCache();
if (!$oauthTokenCache instanceof OauthCacheInterface) {
$oauthTokenCache = new OauthCacheFile();
OpenPayU_Configuration::setOauthTokenCache($oauthTokenCache);
}
self::$oauthTokenCache = $oauthTokenCache;
}
}

View File

@@ -0,0 +1,7 @@
<?php
abstract class OauthGrantType
{
const CLIENT_CREDENTIAL = 'client_credentials';
const TRUSTED_MERCHANT = 'trusted_merchant';
}

View File

@@ -0,0 +1,121 @@
<?php
class OauthResultClientCredentials
{
/**
* @var string
*/
private $accessToken;
/**
* @var string
*/
private $tokenType;
/**
* @var string
*/
private $expiresIn;
/**
* @var string
*/
private $grantType;
/**
* @var DateTime
*/
private $expireDate;
/**
* @return string
*/
public function getAccessToken()
{
return $this->accessToken;
}
/**
* @param string $accessToken
* @return OauthResultClientCredentials
*/
public function setAccessToken($accessToken)
{
$this->accessToken = $accessToken;
return $this;
}
/**
* @return string
*/
public function getTokenType()
{
return $this->tokenType;
}
/**
* @param string $tokenType
* @return OauthResultClientCredentials
*/
public function setTokenType($tokenType)
{
$this->tokenType = $tokenType;
return $this;
}
/**
* @return string
*/
public function getExpiresIn()
{
return $this->expiresIn;
}
/**
* @param string $expiresIn
* @return OauthResultClientCredentials
*/
public function setExpiresIn($expiresIn)
{
$this->expiresIn = $expiresIn;
return $this;
}
/**
* @return string
*/
public function getGrantType()
{
return $this->grantType;
}
/**
* @param string $grantType
* @return OauthResultClientCredentials
*/
public function setGrantType($grantType)
{
$this->grantType = $grantType;
return $this;
}
/**
* @return DateTime
*/
public function getExpireDate()
{
return $this->expireDate;
}
/**
* @param DateTime $date
*/
public function calculateExpireDate($date)
{
$this->expireDate = $date->add(new DateInterval('PT' . ($this->expiresIn - 60) . 'S'));
}
public function hasExpire()
{
return ($this->expireDate <= new DateTime());
}
}

View File

@@ -0,0 +1,66 @@
<?php
/**
* OpenPayU Standard Library
*
* @copyright Copyright (c) 2011-2016 PayU
* @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
* http://www.payu.com
* http://developers.payu.com
*/
class OpenPayU
{
protected static function build($data)
{
$instance = new OpenPayU_Result();
if (array_key_exists('status', $data) && $data['status'] == 'WARNING_CONTINUE_REDIRECT') {
$data['status'] = 'SUCCESS';
$data['response']['status']['statusCode'] = 'SUCCESS';
}
$instance->init($data);
return $instance;
}
/**
* @param $data
* @param $incomingSignature
* @throws OpenPayU_Exception_Authorization
*/
public static function verifyDocumentSignature($data, $incomingSignature)
{
$sign = OpenPayU_Util::parseSignature($incomingSignature);
if ($sign === null || !array_key_exists('signature', $sign) || !array_key_exists('algorithm', $sign)) {
throw new OpenPayU_Exception_Authorization('Signature not found');
}
if (false === OpenPayU_Util::verifySignature(
$data,
$sign['signature'],
OpenPayU_Configuration::getSignatureKey(),
$sign['algorithm'])
) {
throw new OpenPayU_Exception_Authorization('Invalid signature - ' . $sign['signature']);
}
}
/**
* @return AuthType
* @throws OpenPayU_Exception
*/
protected static function getAuth()
{
if (OpenPayU_Configuration::getOauthClientId() && OpenPayU_Configuration::getOauthClientSecret()) {
$authType = new AuthType_Oauth(OpenPayU_Configuration::getOauthClientId(), OpenPayU_Configuration::getOauthClientSecret());
} else {
$authType = new AuthType_Basic(OpenPayU_Configuration::getMerchantPosId(), OpenPayU_Configuration::getSignatureKey());
}
return $authType;
}
}

View File

@@ -0,0 +1,58 @@
<?php
/**
* OpenPayU Standard Library
*
* @copyright Copyright (c) 2011-2016 PayU
* @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
* http://www.payu.com
* http://developers.payu.com
*/
class OpenPayU_Exception extends \Exception
{
}
class OpenPayU_Exception_Request extends OpenPayU_Exception
{
/** @var stdClass|null */
private $originalResponseMessage;
public function __construct($originalResponseMessage, $message = "", $code = 0, $previous = null)
{
$this->originalResponseMessage = $originalResponseMessage;
parent::__construct($message, $code, $previous);
}
/** @return null|stdClass */
public function getOriginalResponse()
{
return $this->originalResponseMessage;
}
}
class OpenPayU_Exception_Configuration extends OpenPayU_Exception
{
}
class OpenPayU_Exception_Network extends OpenPayU_Exception
{
}
class OpenPayU_Exception_ServerError extends OpenPayU_Exception
{
}
class OpenPayU_Exception_ServerMaintenance extends OpenPayU_Exception
{
}
class OpenPayU_Exception_Authorization extends OpenPayU_Exception
{
}

View File

@@ -0,0 +1,24 @@
<?php
/**
* OpenPayU Standard Library
*
* @copyright Copyright (c) 2011-2016 PayU
* @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
* http://www.payu.com
* http://developers.payu.com
*/
/**
* Class OpenPayuOrderStatus
*/
abstract class OpenPayuOrderStatus
{
const STATUS_NEW = 'NEW';
const STATUS_PENDING = 'PENDING';
const STATUS_CANCELED = 'CANCELED';
const STATUS_REJECTED = 'REJECTED';
const STATUS_COMPLETED = 'COMPLETED';
const STATUS_WAITING_FOR_CONFIRMATION = 'WAITING_FOR_CONFIRMATION';
}

View File

@@ -0,0 +1,225 @@
<?php
/**
* OpenPayU Standard Library
*
* @copyright Copyright (c) 2011-2016 PayU
* @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
* http://www.payu.com
* http://developers.payu.com
*/
class OpenPayU_Result
{
private $status = '';
private $error = '';
private $success = 0;
private $request = '';
/** @var object */
private $response;
private $sessionId = '';
private $message = '';
private $countryCode = '';
private $reqId = '';
/**
* @access public
* @return string
*/
public function getStatus()
{
return $this->status;
}
/**
* @access public
* @param $value
*/
public function setStatus($value)
{
$this->status = $value;
}
/**
* @access public
* @return string
*/
public function getError()
{
return $this->error;
}
/**
* @access public
* @param $value
*/
public function setError($value)
{
$this->error = $value;
}
/**
* @access public
* @return int
*/
public function getSuccess()
{
return $this->success;
}
/**
* @access public
* @param $value
*/
public function setSuccess($value)
{
$this->success = $value;
}
/**
* @access public
* @return string
*/
public function getRequest()
{
return $this->request;
}
/**
* @access public
* @param $value
*/
public function setRequest($value)
{
$this->request = $value;
}
/**
* @access public
* @return object
*/
public function getResponse()
{
return $this->response;
}
/**
* @access public
* @param $value
*/
public function setResponse($value)
{
$this->response = $value;
}
/**
* @access public
* @return string
*/
public function getSessionId()
{
return $this->sessionId;
}
/**
* @access public
* @param $value
*/
public function setSessionId($value)
{
$this->sessionId = $value;
}
/**
* @access public
* @return string
*/
public function getMessage()
{
return $this->message;
}
/**
* @access public
* @param $value
*/
public function setMessage($value)
{
$this->message = $value;
}
/**
* @access public
* @return string
*/
public function getCountryCode()
{
return $this->countryCode;
}
/**
* @access public
* @param $value
*/
public function setCountryCode($value)
{
$this->countryCode = $value;
}
/**
* @access public
* @return string
*/
public function getReqId()
{
return $this->reqId;
}
/**
* @access public
* @param $value
*/
public function setReqId($value)
{
$this->reqId = $value;
}
public function init($attributes)
{
$attributes = OpenPayU_Util::parseArrayToObject($attributes);
if (!empty($attributes)) {
foreach ($attributes as $name => $value) {
$this->set($name, $value);
}
}
}
public function set($name, $value)
{
$this->{$name} = $value;
}
public function __get($name)
{
if (isset($this->{$name}))
return $this->name;
return null;
}
public function __call($methodName, $args) {
if (preg_match('~^(set|get)([A-Z])(.*)$~', $methodName, $matches)) {
$property = strtolower($matches[2]) . $matches[3];
if (!property_exists($this, $property)) {
throw new Exception('Property ' . $property . ' not exists');
}
switch($matches[1]) {
case 'get':
$this->checkArguments($args, 0, 0, $methodName);
return $this->get($property);
case 'default':
throw new Exception('Method ' . $methodName . ' not exists');
}
}
}
}

View File

@@ -0,0 +1,59 @@
<?php
/**
* OpenPayU Standard Library
*
* @copyright Copyright (c) 2011-2016 PayU
* @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
* http://www.payu.com
* http://developers.payu.com
*/
class ResultError
{
/**
* @var string
*/
private $error;
/**
* @var string
*/
private $errorDescription;
/**
* @return string
*/
public function getError()
{
return $this->error;
}
/**
* @param string $error
* @return ResultError
*/
public function setError($error)
{
$this->error = $error;
return $this;
}
/**
* @return string
*/
public function getErrorDescription()
{
return $this->errorDescription;
}
/**
* @param string $errorDescription
* @return ResultError
*/
public function setErrorDescription($errorDescription)
{
$this->errorDescription = $errorDescription;
return $this;
}
}

View File

@@ -0,0 +1,302 @@
<?php
/**
* OpenPayU Standard Library
*
* @copyright Copyright (c) 2011-2016 PayU
* @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
* http://www.payu.com
* http://developers.payu.com
*/
class OpenPayU_Util
{
/**
* Function generate sign data
*
* @param array $data
* @param string $algorithm
* @param string $merchantPosId
* @param string $signatureKey
*
* @return string
*
* @throws OpenPayU_Exception_Configuration
*/
public static function generateSignData(array $data, $algorithm = 'SHA-256', $merchantPosId = '', $signatureKey = '')
{
if (empty($signatureKey))
throw new OpenPayU_Exception_Configuration('Merchant Signature Key should not be null or empty.');
if (empty($merchantPosId))
throw new OpenPayU_Exception_Configuration('MerchantPosId should not be null or empty.');
$contentForSign = '';
ksort($data);
foreach ($data as $key => $value) {
$contentForSign .= $key . '=' . urlencode($value) . '&';
}
if (in_array($algorithm, array('SHA-256', 'SHA'))) {
$hashAlgorithm = 'sha256';
$algorithm = 'SHA-256';
} else if ($algorithm == 'SHA-384') {
$hashAlgorithm = 'sha384';
$algorithm = 'SHA-384';
} else if ($algorithm == 'SHA-512') {
$hashAlgorithm = 'sha512';
$algorithm = 'SHA-512';
}
$signature = hash($hashAlgorithm, $contentForSign . $signatureKey);
$signData = 'sender=' . $merchantPosId . ';algorithm=' . $algorithm . ';signature=' . $signature;
return $signData;
}
/**
* Function returns signature data object
*
* @param string $data
*
* @return null|array
*/
public static function parseSignature($data)
{
if (empty($data)) {
return null;
}
$signatureData = array();
$list = explode(';', rtrim($data, ';'));
if (empty($list)) {
return null;
}
foreach ($list as $value) {
$explode = explode('=', $value);
if (count($explode) != 2) {
return null;
}
$signatureData[$explode[0]] = $explode[1];
}
return $signatureData;
}
/**
* Function returns signature validate
*
* @param string $message
* @param string $signature
* @param string $signatureKey
* @param string $algorithm
*
* @return bool
*/
public static function verifySignature($message, $signature, $signatureKey, $algorithm = 'MD5')
{
if (isset($signature)) {
if ($algorithm === 'MD5') {
$hash = md5($message . $signatureKey);
} else if (in_array($algorithm, array('SHA', 'SHA1', 'SHA-1'))) {
$hash = sha1($message . $signatureKey);
} else {
$hash = hash('sha256', $message . $signatureKey);
}
if (strcmp($signature, $hash) == 0) {
return true;
}
}
return false;
}
/**
* Function builds OpenPayU Json Document
*
* @param array $data
* @param string $rootElement
*
* @return null|string
*/
public static function buildJsonFromArray($data, $rootElement = '')
{
if (!is_array($data)) {
return null;
}
if (!empty($rootElement)) {
$data = array($rootElement => $data);
}
$data = self::setSenderProperty($data);
return json_encode($data);
}
/**
* @param string $data
* @param bool $assoc
* @return mixed|null
*/
public static function convertJsonToArray($data, $assoc = false)
{
if (empty($data)) {
return null;
}
return json_decode($data, $assoc);
}
/**
* @param array $array
* @return bool|stdClass
*/
public static function parseArrayToObject($array)
{
if (!is_array($array)) {
return $array;
}
if (self::isAssocArray($array)) {
$object = new stdClass();
} else {
$object = array();
}
if (is_array($array) && count($array) > 0) {
foreach ($array as $name => $value) {
$name = trim($name);
if (isset($name)) {
if (is_numeric($name)) {
$object[] = self::parseArrayToObject($value);
} else {
$object->$name = self::parseArrayToObject($value);
}
}
}
return $object;
}
return false;
}
/**
* @return mixed
*/
public static function getRequestHeaders()
{
if (!function_exists('apache_request_headers')) {
$headers = array();
foreach ($_SERVER as $key => $value) {
if (substr($key, 0, 5) == 'HTTP_') {
$headers[str_replace(' ', '-', ucwords(str_replace('_', ' ', strtolower(substr($key, 5)))))] = $value;
}
}
return $headers;
} else {
return apache_request_headers();
}
}
/**
* @param $array
* @param string $namespace
* @param array $outputFields
* @return string
*/
public static function convertArrayToHtmlForm($array, $namespace = '', &$outputFields = [])
{
$i = 0;
$htmlOutput = "";
$assoc = self::isAssocArray($array);
foreach ($array as $key => $value) {
if ($namespace && $assoc) {
$key = $namespace . '.' . $key;
} elseif ($namespace && !$assoc) {
$key = $namespace . '[' . $i++ . ']';
}
if (is_array($value)) {
$htmlOutput .= self::convertArrayToHtmlForm($value, $key, $outputFields);
} else {
$htmlOutput .= sprintf("<input type=\"hidden\" name=\"%s\" value=\"%s\" />\n", $key, htmlspecialchars($value));
$outputFields[$key] = $value;
}
}
return $htmlOutput;
}
/**
* @param $arr
* @return bool
*/
public static function isAssocArray($arr)
{
$arrKeys = array_keys($arr);
sort($arrKeys, SORT_NUMERIC);
return $arrKeys !== range(0, count($arr) - 1);
}
/**
* @param array $data
* @return array
*/
private static function setSenderProperty($data)
{
$data['properties'][0] = array(
'name' => 'sender',
'value' => OpenPayU_Configuration::getFullSenderName()
);
return $data;
}
public static function statusDesc($response)
{
$msg = '';
switch ($response) {
case 'SUCCESS':
$msg = 'Request has been processed correctly.';
break;
case 'DATA_NOT_FOUND':
$msg = 'Data indicated in the request is not available in the PayU system.';
break;
case 'WARNING_CONTINUE_3_DS':
$msg = '3DS authorization required.Redirect the Buyer to PayU to continue the 3DS process by calling OpenPayU.authorize3DS().';
break;
case 'WARNING_CONTINUE_CVV':
$msg = 'CVV/CVC authorization required. Call OpenPayU.authorizeCVV() method.';
break;
case 'ERROR_SYNTAX':
$msg = 'BIncorrect request syntax. Supported formats are JSON or XML.';
break;
case 'ERROR_VALUE_INVALID':
$msg = 'One or more required values are incorrect.';
break;
case 'ERROR_VALUE_MISSING':
$msg = 'One or more required values are missing.';
break;
case 'BUSINESS_ERROR':
$msg = 'PayU system is unavailable. Try again later.';
break;
case 'ERROR_INTERNAL':
$msg = 'PayU system is unavailable. Try again later.';
break;
case 'GENERAL_ERROR':
$msg = 'Unexpected error. Try again later.';
break;
}
return $msg;
}
}

View File

@@ -0,0 +1,266 @@
<?php
/**
* OpenPayU Standard Library
*
* @copyright Copyright (c) 2011-2018 PayU
* @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
* http://www.payu.com
* http://developers.payu.com
*/
/**
* Class OpenPayU_Order
*/
class OpenPayU_Order extends OpenPayU
{
const ORDER_SERVICE = 'orders/';
const ORDER_TRANSACTION_SERVICE = 'transactions';
const SUCCESS = 'SUCCESS';
/**
* @var array Default form parameters
*/
protected static $defaultFormParams = array(
'formClass' => '',
'formId' => 'payu-payment-form',
'submitClass' => '',
'submitId' => '',
'submitContent' => '',
'submitTarget' => '_blank'
);
/**
* Creates new Order
* - Sends to PayU OrderCreateRequest
*
* @param array $order A array containing full Order
* @return object $result Response array with OrderCreateResponse
* @throws OpenPayU_Exception
*/
public static function create($order)
{
$data = OpenPayU_Util::buildJsonFromArray($order);
if (empty($data)) {
throw new OpenPayU_Exception('Empty message OrderCreateRequest');
}
try {
$authType = self::getAuth();
} catch (OpenPayU_Exception $e) {
throw new OpenPayU_Exception($e->getMessage(), $e->getCode());
}
$pathUrl = OpenPayU_Configuration::getServiceUrl() . self::ORDER_SERVICE;
$result = self::verifyResponse(OpenPayU_Http::doPost($pathUrl, $data, $authType), 'OrderCreateResponse');
return $result;
}
/**
* Retrieves information about the order
* - Sends to PayU OrderRetrieveRequest
*
* @param string $orderId PayU OrderId sent back in OrderCreateResponse
* @return OpenPayU_Result $result Response array with OrderRetrieveResponse
* @throws OpenPayU_Exception
*/
public static function retrieve($orderId)
{
if (empty($orderId)) {
throw new OpenPayU_Exception('Empty value of orderId');
}
try {
$authType = self::getAuth();
} catch (OpenPayU_Exception $e) {
throw new OpenPayU_Exception($e->getMessage(), $e->getCode());
}
$pathUrl = OpenPayU_Configuration::getServiceUrl() . self::ORDER_SERVICE . $orderId;
$result = self::verifyResponse(OpenPayU_Http::doGet($pathUrl, $authType), 'OrderRetrieveResponse');
return $result;
}
/**
* Retrieves information about the order transaction
* - Sends to PayU TransactionRetrieveRequest
*
* @param string $orderId PayU OrderId sent back in OrderCreateResponse
* @return OpenPayU_Result $result Response array with TransactionRetrieveResponse
* @throws OpenPayU_Exception
*/
public static function retrieveTransaction($orderId)
{
if (empty($orderId)) {
throw new OpenPayU_Exception('Empty value of orderId');
}
try {
$authType = self::getAuth();
} catch (OpenPayU_Exception $e) {
throw new OpenPayU_Exception($e->getMessage(), $e->getCode());
}
$pathUrl = OpenPayU_Configuration::getServiceUrl() . self::ORDER_SERVICE . $orderId . '/' . self::ORDER_TRANSACTION_SERVICE;
$result = self::verifyResponse(OpenPayU_Http::doGet($pathUrl, $authType), 'TransactionRetrieveResponse');
return $result;
}
/**
* Cancels Order
* - Sends to PayU OrderCancelRequest
*
* @param string $orderId PayU OrderId sent back in OrderCreateResponse
* @return OpenPayU_Result $result Response array with OrderCancelResponse
* @throws OpenPayU_Exception
*/
public static function cancel($orderId)
{
if (empty($orderId)) {
throw new OpenPayU_Exception('Empty value of orderId');
}
try {
$authType = self::getAuth();
} catch (OpenPayU_Exception $e) {
throw new OpenPayU_Exception($e->getMessage(), $e->getCode());
}
$pathUrl = OpenPayU_Configuration::getServiceUrl() . self::ORDER_SERVICE . $orderId;
$result = self::verifyResponse(OpenPayU_Http::doDelete($pathUrl, $authType), 'OrderCancelResponse');
return $result;
}
/**
* Updates Order status
* - Sends to PayU OrderStatusUpdateRequest
*
* @param array $orderStatusUpdate A array containing full OrderStatus
* @return OpenPayU_Result $result Response array with OrderStatusUpdateResponse
* @throws OpenPayU_Exception
*/
public static function statusUpdate($orderStatusUpdate)
{
if (empty($orderStatusUpdate)) {
throw new OpenPayU_Exception('Empty order status data');
}
try {
$authType = self::getAuth();
} catch (OpenPayU_Exception $e) {
throw new OpenPayU_Exception($e->getMessage(), $e->getCode());
}
$data = OpenPayU_Util::buildJsonFromArray($orderStatusUpdate);
$pathUrl = OpenPayU_Configuration::getServiceUrl() . self::ORDER_SERVICE . $orderStatusUpdate['orderId'] . '/status';
$result = self::verifyResponse(OpenPayU_Http::doPut($pathUrl, $data, $authType), 'OrderStatusUpdateResponse');
return $result;
}
/**
* Consume notification message
*
* @access public
* @param $data string Request array received from with PayU OrderNotifyRequest
* @return null|OpenPayU_Result Response array with OrderNotifyRequest
* @throws OpenPayU_Exception
*/
public static function consumeNotification($data)
{
if (empty($data)) {
throw new OpenPayU_Exception('Empty value of data');
}
$headers = OpenPayU_Util::getRequestHeaders();
$incomingSignature = OpenPayU_HttpCurl::getSignature($headers);
self::verifyDocumentSignature($data, $incomingSignature);
return OpenPayU_Order::verifyResponse(array('response' => $data, 'code' => 200), 'OrderNotifyRequest');
}
/**
* Verify response from PayU
*
* @param array $response
* @param string $messageName
* @return null|OpenPayU_Result
* @throws OpenPayU_Exception
* @throws OpenPayU_Exception_Authorization
* @throws OpenPayU_Exception_Network
* @throws OpenPayU_Exception_ServerError
* @throws OpenPayU_Exception_ServerMaintenance
*/
public static function verifyResponse($response, $messageName)
{
$data = array();
$httpStatus = $response['code'];
$message = OpenPayU_Util::convertJsonToArray($response['response'], true);
$data['status'] = isset($message['status']['statusCode']) ? $message['status']['statusCode'] : null;
if (json_last_error() == JSON_ERROR_SYNTAX) {
$data['response'] = $response['response'];
} elseif (isset($message[$messageName])) {
unset($message[$messageName]['Status']);
$data['response'] = $message[$messageName];
} elseif (isset($message)) {
$data['response'] = $message;
unset($message['status']);
}
$result = self::build($data);
if ($httpStatus == 200 || $httpStatus == 201 || $httpStatus == 422 || $httpStatus == 301 || $httpStatus == 302) {
return $result;
}
OpenPayU_Http::throwHttpStatusException($httpStatus, $result);
}
/**
* Generate a form body for hosted order
*
* @access public
* @param array $order an array containing full Order
* @param array $params an optional array with form elements' params
* @return string Response html form
* @throws OpenPayU_Exception_Configuration
*/
public static function hostedOrderForm($order, $params = array())
{
$orderFormUrl = OpenPayU_Configuration::getServiceUrl() . 'orders';
$formFieldValuesAsArray = array();
$htmlFormFields = OpenPayU_Util::convertArrayToHtmlForm($order, '', $formFieldValuesAsArray);
$signature = OpenPayU_Util::generateSignData(
$formFieldValuesAsArray,
OpenPayU_Configuration::getHashAlgorithm(),
OpenPayU_Configuration::getMerchantPosId(),
OpenPayU_Configuration::getSignatureKey()
);
$formParams = array_merge(self::$defaultFormParams, $params);
$htmlOutput = sprintf("<form method=\"POST\" action=\"%s\" id=\"%s\" class=\"%s\">\n", $orderFormUrl, $formParams['formId'], $formParams['formClass']);
$htmlOutput .= $htmlFormFields;
$htmlOutput .= sprintf("<input type=\"hidden\" name=\"OpenPayu-Signature\" value=\"%s\" />", $signature);
$htmlOutput .= sprintf("<button type=\"submit\" formtarget=\"%s\" id=\"%s\" class=\"%s\">%s</button>", $formParams['submitTarget'], $formParams['submitId'], $formParams['submitClass'], $formParams['submitContent']);
$htmlOutput .= "</form>\n";
return $htmlOutput;
}
}

View File

@@ -0,0 +1,97 @@
<?php
/**
* OpenPayU Standard Library
*
* @copyright Copyright (c) 2011-2016 PayU
* @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
* http://www.payu.com
* http://developers.payu.com
*/
class OpenPayU_Refund extends OpenPayU
{
/**
* Function make refund for order
* @param $orderId
* @param $description
* @param null|int $amount Amount of refund in pennies
* @param null|string $extCustomerId Marketplace external customer ID
* @param null|string $extRefundId Marketplace external refund ID
* @return null|OpenPayU_Result
* @throws OpenPayU_Exception
*/
public static function create($orderId, $description, $amount = null, $extCustomerId = null, $extRefundId = null)
{
if (empty($orderId)) {
throw new OpenPayU_Exception('Invalid orderId value for refund');
}
if (empty($description)) {
throw new OpenPayU_Exception('Invalid description of refund');
}
$refund = array(
'orderId' => $orderId,
'refund' => array('description' => $description)
);
if (!empty($amount)) {
$refund['refund']['amount'] = (int) $amount;
}
if (!empty($extCustomerId)) {
$refund['refund']['extCustomerId'] = $extCustomerId;
}
if (!empty($extRefundId)) {
$refund['refund']['extRefundId'] = $extRefundId;
}
try {
$authType = self::getAuth();
} catch (OpenPayU_Exception $e) {
throw new OpenPayU_Exception($e->getMessage(), $e->getCode());
}
$pathUrl = OpenPayU_Configuration::getServiceUrl().'orders/'. $refund['orderId'] . '/refund';
$data = OpenPayU_Util::buildJsonFromArray($refund);
$result = self::verifyResponse(OpenPayU_Http::doPost($pathUrl, $data, $authType), 'RefundCreateResponse');
return $result;
}
/**
* @param string $response
* @param string $messageName
* @return OpenPayU_Result
*/
public static function verifyResponse($response, $messageName='')
{
$data = array();
$httpStatus = $response['code'];
$message = OpenPayU_Util::convertJsonToArray($response['response'], true);
$data['status'] = isset($message['status']['statusCode']) ? $message['status']['statusCode'] : null;
if (json_last_error() == JSON_ERROR_SYNTAX) {
$data['response'] = $response['response'];
} elseif (isset($message[$messageName])) {
unset($message[$messageName]['Status']);
$data['response'] = $message[$messageName];
} elseif (isset($message)) {
$data['response'] = $message;
unset($message['status']);
}
$result = self::build($data);
if ($httpStatus == 200 || $httpStatus == 201 || $httpStatus == 422 || $httpStatus == 302) {
return $result;
} else {
OpenPayU_Http::throwHttpStatusException($httpStatus, $result);
}
}
}

View File

@@ -0,0 +1,75 @@
<?php
/**
* OpenPayU Standard Library
*
* @copyright Copyright (c) 2011-2016 PayU
* @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
* http://www.payu.com
* http://developers.payu.com
*/
class OpenPayU_Retrieve extends OpenPayU
{
const PAYMETHODS_SERVICE = 'paymethods';
/**
* Get Pay Methods from POS
* @param string $lang
* @return null|OpenPayU_Result
* @throws OpenPayU_Exception
* @throws OpenPayU_Exception_Configuration
*/
public static function payMethods($lang = null)
{
try {
$authType = self::getAuth();
} catch (OpenPayU_Exception $e) {
throw new OpenPayU_Exception($e->getMessage(), $e->getCode());
}
if (!$authType instanceof AuthType_Oauth) {
throw new OpenPayU_Exception_Configuration('Retrieve works only with OAuth');
}
$pathUrl = OpenPayU_Configuration::getServiceUrl() . self::PAYMETHODS_SERVICE;
if ($lang !== null) {
$pathUrl .= '?lang=' . $lang;
}
$response = self::verifyResponse(OpenPayU_Http::doGet($pathUrl, $authType));
return $response;
}
/**
* @param string $response
* @return null|OpenPayU_Result
*/
public static function verifyResponse($response)
{
$data = array();
$httpStatus = $response['code'];
$message = OpenPayU_Util::convertJsonToArray($response['response'], true);
$data['status'] = isset($message['status']['statusCode']) ? $message['status']['statusCode'] : null;
if (json_last_error() == JSON_ERROR_SYNTAX) {
$data['response'] = $response['response'];
} elseif (isset($message)) {
$data['response'] = $message;
unset($message['status']);
}
$result = self::build($data);
if ($httpStatus == 200 || $httpStatus == 201 || $httpStatus == 422 || $httpStatus == 302 || $httpStatus == 400 || $httpStatus == 404) {
return $result;
} else {
OpenPayU_Http::throwHttpStatusException($httpStatus, $result);
}
}
}

View File

@@ -0,0 +1,79 @@
<?php
/**
* OpenPayU Standard Library
*
* @copyright Copyright (c) PayU
* @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
* http://www.payu.com
* http://developers.payu.com
*/
class OpenPayU_Shop extends OpenPayU
{
const SHOPS_SERVICE = 'shops';
/**
* Retrieving shop data
* @param string $publicShopId
* @return Shop
* @throws OpenPayU_Exception
* @throws OpenPayU_Exception_Configuration
*/
public static function get($publicShopId)
{
try {
$authType = self::getAuth();
} catch (OpenPayU_Exception $e) {
throw new OpenPayU_Exception($e->getMessage(), $e->getCode());
}
if (!$authType instanceof AuthType_Oauth) {
throw new OpenPayU_Exception_Configuration('Get shop works only with OAuth');
}
$pathUrl = OpenPayU_Configuration::getServiceUrl() . self::SHOPS_SERVICE . '/' . $publicShopId;
return self::verifyResponse(OpenPayU_Http::doGet($pathUrl, $authType));
}
/**
* @param array $response
* @return Shop
* @throws OpenPayU_Exception
*/
public static function verifyResponse($response)
{
$httpStatus = $response['code'];
if ($httpStatus == 500) {
$result = (new ResultError())
->setErrorDescription($response['response']);
OpenPayU_Http::throwErrorHttpStatusException($httpStatus, $result);
}
$message = json_decode($response['response'], true);
if (json_last_error() === JSON_ERROR_SYNTAX) {
throw new OpenPayU_Exception_ServerError('Incorrect json response. Response: [' . $response['response'] . ']');
}
if ($httpStatus == 200) {
return (new Shop())
->setShopId($message['shopId'])
->setName($message['name'])
->setCurrencyCode($message['currencyCode'])
->setBalance(
(new Balance())
->setCurrencyCode($message['balance']['currencyCode'])
->setTotal($message['balance']['total'])
->setAvailable($message['balance']['available'])
);
}
$result = (new ResultError())
->setError($message['error'])
->setErrorDescription($message['error_description']);
OpenPayU_Http::throwErrorHttpStatusException($httpStatus, $result);
}
}

View File

@@ -0,0 +1,75 @@
<?php
/**
* OpenPayU Standard Library
*
* @copyright Copyright (c) 2011-2017 PayU
* @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
* http://www.payu.com
* http://developers.payu.com
*/
class OpenPayU_Token extends OpenPayU
{
const TOKENS_SERVICE = 'tokens';
/**
* Deleting a payment token
* @param string $token
* @return null|OpenPayU_Result
* @throws OpenPayU_Exception
* @throws OpenPayU_Exception_Configuration
*/
public static function delete($token)
{
try {
$authType = self::getAuth();
} catch (OpenPayU_Exception $e) {
throw new OpenPayU_Exception($e->getMessage(), $e->getCode());
}
if (!$authType instanceof AuthType_Oauth) {
throw new OpenPayU_Exception_Configuration('Delete token works only with OAuth');
}
if (OpenPayU_Configuration::getOauthGrantType() !== OauthGrantType::TRUSTED_MERCHANT) {
throw new OpenPayU_Exception_Configuration('Token delete request is available only for trusted_merchant');
}
$pathUrl = OpenPayU_Configuration::getServiceUrl() . self::TOKENS_SERVICE . '/' . $token;
$response = self::verifyResponse(OpenPayU_Http::doDelete($pathUrl, $authType));
return $response;
}
/**
* @param string $response
* @return null|OpenPayU_Result
*/
public static function verifyResponse($response)
{
$data = array();
$httpStatus = $response['code'];
$message = OpenPayU_Util::convertJsonToArray($response['response'], true);
$data['status'] = isset($message['status']['statusCode']) ? $message['status']['statusCode'] : null;
if (json_last_error() == JSON_ERROR_SYNTAX) {
$data['response'] = $response['response'];
} elseif (isset($message)) {
$data['response'] = $message;
unset($message['status']);
}
$result = self::build($data);
if ($httpStatus == 204) {
return $result;
} else {
OpenPayU_Http::throwHttpStatusException($httpStatus, $result);
}
}
}

View File

@@ -0,0 +1,48 @@
<?php
/**
*
* @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
*/
if (!defined('_PS_VERSION_')) {
exit;
}
include_once(_PS_MODULE_DIR_ . '/payu/tools/sdk/openpayu.php');
include_once(_PS_MODULE_DIR_ . '/payu/tools/PayuOauthCache/OauthCachePresta.php');
class PayUSDKInitializer
{
public function initializeOpenPayU($currencyIsoCode, $version)
{
$prefix = Configuration::get('PAYU_SANDBOX') ? 'SANDBOX_' : '';
$payuPosId = Tools::unSerialize(Configuration::get($prefix . 'PAYU_MC_POS_ID'));
$payuSignatureKey = Tools::unSerialize(Configuration::get($prefix . 'PAYU_MC_SIGNATURE_KEY'));
$payuOauthClientId = Tools::unSerialize(Configuration::get($prefix . 'PAYU_MC_OAUTH_CLIENT_ID'));
$payuOauthClientSecret = Tools::unSerialize(Configuration::get($prefix . 'PAYU_MC_OAUTH_CLIENT_SECRET'));
if (!is_array($payuPosId) ||
!is_array($payuSignatureKey) ||
!$payuPosId[$currencyIsoCode] ||
!$payuSignatureKey[$currencyIsoCode]
) {
return false;
}
OpenPayU_Configuration::setEnvironment( Configuration::get('PAYU_SANDBOX') ? 'sandbox' : 'secure');
OpenPayU_Configuration::setMerchantPosId($payuPosId[$currencyIsoCode]);
OpenPayU_Configuration::setSignatureKey($payuSignatureKey[$currencyIsoCode]);
if ($payuOauthClientId[$currencyIsoCode] && $payuOauthClientSecret[$currencyIsoCode]) {
OpenPayU_Configuration::setOauthClientId($payuOauthClientId[$currencyIsoCode]);
OpenPayU_Configuration::setOauthClientSecret($payuOauthClientSecret[$currencyIsoCode]);
OpenPayU_Configuration::setOauthTokenCache(new OauthCachePresta());
}
OpenPayU_Configuration::setSender($version);
return true;
}
}

View 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;

View File

@@ -0,0 +1,42 @@
<?php
/**
* OpenPayU Standard Library
* ver. 2.1.3
*
* @copyright Copyright (c) 2011-2016 PayU
* @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
* http://www.payu.com
* http://developers.payu.com
*/
include_once('OpenPayU/Configuration.php');
include_once('OpenPayU/OpenPayUException.php');
include_once('OpenPayU/Util.php');
include_once('OpenPayU/OpenPayU.php');
include_once('OpenPayU/OpenPayuOrderStatus.php');
include_once('OpenPayU/Result.php');
require_once('OpenPayU/Http.php');
require_once('OpenPayU/HttpCurl.php');
require_once('OpenPayU/Oauth/Oauth.php');
require_once('OpenPayU/Oauth/OauthGrantType.php');
require_once('OpenPayU/Oauth/OauthResultClientCredentials.php');
require_once('OpenPayU/Oauth/Cache/OauthCacheInterface.php');
require_once('OpenPayU/Oauth/Cache/OauthCacheFile.php');
require_once('OpenPayU/Oauth/Cache/OauthCacheMemcached.php');
require_once('OpenPayU/ResultError.php');
require_once('OpenPayU/AuthType/AuthType.php');
require_once('OpenPayU/AuthType/Basic.php');
require_once('OpenPayU/AuthType/TokenRequest.php');
require_once('OpenPayU/AuthType/Oauth.php');
include_once('OpenPayU/v2/Refund.php');
include_once('OpenPayU/v2/Order.php');
include_once('OpenPayU/v2/Retrieve.php');
include_once('OpenPayU/v2/Token.php');
include_once('OpenPayU/v2/Shop.php');

View File

@@ -0,0 +1,100 @@
<?php
global $_MODULE;
$_MODULE = array();
$_MODULE['<{payu}prestashop>payu_6a90d0ab04a2cd28919bee487736cdeb'] = 'PayU';
$_MODULE['<{payu}prestashop>payu_41290081ccb73a4961e5e450ada4d13b'] = 'Přijímá platby přes PayU';
$_MODULE['<{payu}prestashop>payu_533937acf0e84c92e787614bbb16a7a0'] = 'Opravdu chcete odinstalovat modul? Po této operaci ztratíte veškerá nastavení!';
$_MODULE['<{payu}prestashop>payu_77d1b273077dd163c5f9e5fed3a21152'] = 'Není možné uložení konfigurace';
$_MODULE['<{payu}prestashop>payu_c888438d14855d7d96a2724ee9c306bd'] = 'Nastavení aktualizováno';
$_MODULE['<{payu}prestashop>payu_fa84fbded2a02deeb191c6f5208a9ce5'] = 'Jak integrovat';
$_MODULE['<{payu}prestashop>payu_a5f555f0e168487b5c9a76b0229b7c1c'] = 'Ukaž platební metody';
$_MODULE['<{payu}prestashop>payu_c3895de7f3a59421939d83ba76d2c532'] = 'Ukaž platební metody ve shrnutí objednávky v Prestashop';
$_MODULE['<{payu}prestashop>payu_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Ano';
$_MODULE['<{payu}prestashop>payu_b9f5c797ebbf55adccdd8539a65a0241'] = 'No';
$_MODULE['<{payu}prestashop>payu_c9cc8cce247e49bae79f15173ce97354'] = 'Uložit';
$_MODULE['<{payu}prestashop>payu_deae7d0459da98d05a517d9d45329c51'] = 'Konfigurace POS dle měny: ';
$_MODULE['<{payu}prestashop>payu_e9adbbd1cd7eff7e1a588c31f79521d5'] = 'POS ID';
$_MODULE['<{payu}prestashop>payu_dbf679af91c0dcb70d6f4903907753a4'] = 'Klíč MD5';
$_MODULE['<{payu}prestashop>payu_4aec2383501f7dab31d609ca02c01843'] = 'OAuth - client_id';
$_MODULE['<{payu}prestashop>payu_bd561f60c843a8f02b7e3f622ae8bc31'] = 'OAuth - client_secret';
$_MODULE['<{payu}prestashop>payu_8203e405b5bef2cd8b9a5bb38a410fc6'] = 'Statusy platby';
$_MODULE['<{payu}prestashop>payu_194dae160a9dcdd91313d481201102c7'] = 'Zahájena';
$_MODULE['<{payu}prestashop>payu_81c6a1fe50f50e7564c9e8777819e39a'] = 'Pro přijetí';
$_MODULE['<{payu}prestashop>payu_685b00adf082646c586862b1b892e294'] = 'Dokončena';
$_MODULE['<{payu}prestashop>payu_fe28437b788c1b7c11ba9be7081d23cf'] = 'Zrušena';
$_MODULE['<{payu}prestashop>payu_2f8798acbb31ddfb6709697e67b6dcba'] = 'Částka refundace je vyšší než přijatá úhrada.';
$_MODULE['<{payu}prestashop>payu_454c1fb47a376e178981c01304cf9341'] = 'Chyba refundace';
$_MODULE['<{payu}prestashop>payu_d0027d2c207817773a2016676cbe350d'] = 'Platba kartou nebo bankovním převodem prostřednictvím PayU';
$_MODULE['<{payu}prestashop>payu_a3c8cfa81d897fc55a71606e1381f5a4'] = 'Požadavek na změnu stavu byl odeslán.';
$_MODULE['<{payu}prestashop>payu_48f1a4001bf4a5ba591d24f70e01b098'] = 'Vložit objednávku do košíku:';
$_MODULE['<{payu}prestashop>payu_504036bd3c4764f64b76fabb2b15260f'] = 'z eshopu';
$_MODULE['<{payu}prestashop>payu_484f5a79672cebe198ebdde45a1d672f'] = 'Balení dárků';
$_MODULE['<{payu}prestashop>payu_db4ee5e4de60968ed345209a0b51a17d'] = 'Potvrďte platbu';
$_MODULE['<{payu}prestashop>payu_1ed3dcc1be1ccdfd6b2daf7b866d3ffd'] = 'Pdmítnout platbu';
$_MODULE['<{payu}prestashop>payu_1a4bf0dd59a290f55a88831c7626c4b1'] = 'Požadavek na změnu stavu nebyl proveden úspěšně';
$_MODULE['<{payu}prestashop>payment_2b6ad338c35b2cb1996471ff24a0b739'] = 'Vyberte prosím způsob platby';
$_MODULE['<{payu}prestashop>payment_07ce6a9764922eb889028436bbf6a758'] = 'Akceptujte prosím \"Podmínky jednorázové platební transakce PayU\"';
$_MODULE['<{payu}prestashop>payment_5d5cb8e8a16c652f3ef9ffdec0d4674a'] = 'Došlo k chybě při zpracování objednávky';
$_MODULE['<{payu}prestashop>payment_e2867a925cba382f1436d1834bb52a1c'] = 'Celková výše Vaši objednávky';
$_MODULE['<{payu}prestashop>payment_e2b7dec8fa4b498156dfee6e4c84b156'] = 'Způsob platby \"PayU\" je nedostupný';
$_MODULE['<{payu}prestashop>payment_8457277a28307ffccf7dbe86f93ffdcc'] = 'PayU modul není aktivní.';
$_MODULE['<{payu}prestashop>payment_dab89c1873bc1fce69e6b0f497d72279'] = 'Zopakujte platbu za objednávku';
$_MODULE['<{payu}prestashop>header_13084240f86569077d00a1f438c53654'] = 'Vrátit celou a nebo část platby';
$_MODULE['<{payu}prestashop>header_31dc088ceb59687e1422e1ee02a1ba22'] = 'Jste si jisti, že chcete platbu vrátit?';
$_MODULE['<{payu}prestashop>header_c0a3c3e9b5fbd21c505e082644b2220c'] = 'Vrácení celé platby';
$_MODULE['<{payu}prestashop>header_77fd2b4393b379bedd30efcd5df02090'] = 'Vrácení části platby';
$_MODULE['<{payu}prestashop>header_e9f40e1f1d1658681dad2dac4ae0971e'] = 'částka';
$_MODULE['<{payu}prestashop>header_4f2f7683e451402d38f2db9eff63a6d5'] = 'Vrátit platbu';
$_MODULE['<{payu}prestashop>header16_13084240f86569077d00a1f438c53654'] = 'vrátit celou a nebo část platby';
$_MODULE['<{payu}prestashop>header16_31dc088ceb59687e1422e1ee02a1ba22'] = 'Jste si jisti, že chcete platbu vrátit?';
$_MODULE['<{payu}prestashop>header16_c0a3c3e9b5fbd21c505e082644b2220c'] = 'Vrácení celé platby';
$_MODULE['<{payu}prestashop>header16_77fd2b4393b379bedd30efcd5df02090'] = 'Vrácení části platby';
$_MODULE['<{payu}prestashop>header16_e9f40e1f1d1658681dad2dac4ae0971e'] = 'částka';
$_MODULE['<{payu}prestashop>header16_4f2f7683e451402d38f2db9eff63a6d5'] = 'Provést refundaci';
$_MODULE['<{payu}prestashop>status_54577b37d6aac51a99697804caa2660d'] = 'Potvrzení platby PayU';
$_MODULE['<{payu}prestashop>status_9b9cf9f8778f69b4c6cf37e66f886be8'] = 'Zvolit status';
$_MODULE['<{payu}prestashop>status_f4ec5f57bd4d31b803312d873be40da9'] = 'Změnit';
$_MODULE['<{payu}prestashop>status_fa377a7a4e549f5201c24512e1f56466'] = 'Dostupné pouze v případě, že transakce PayU je ve statusu WAITING_FOR_CONFIRMATION nebo REJECTED';
$_MODULE['<{payu}prestashop>status_68a2ace2fa4faf43789b43a05614b5a6'] = 'Zamówienia w PayU';
$_MODULE['<{payu}prestashop>status_e7439b5ca1f88bed2622be1ba9e317d5'] = 'Datum vytvoření';
$_MODULE['<{payu}prestashop>status_6c4528510842f314f32ce40a6d43b391'] = 'Datum aktualizace';
$_MODULE['<{payu}prestashop>status_ec53a8c4f07baed5d8825072c89799be'] = 'Status';
$_MODULE['<{payu}prestashop>status_004bf6c9a40003140292e97330236c53'] = 'Akce';
$_MODULE['<{payu}prestashop>status_ea4788705e6873b424c65e91c2846b19'] = 'Stornovat';
$_MODULE['<{payu}prestashop>error_a40cab5994f36d4c48103a22ca082e8f'] = 'Váš košík';
$_MODULE['<{payu}prestashop>error_6a90d0ab04a2cd28919bee487736cdeb'] = 'PayU';
$_MODULE['<{payu}prestashop>error_f1d3b424cd68795ecaa552883759aceb'] = 'Shrnutí objednávky';
$_MODULE['<{payu}prestashop>error_0557fa923dcee4d0f86b1409f5c2167f'] = 'Zpět';
$_MODULE['<{payu}prestashop>error17_1f87346a16cf80c372065de3c54c86d9'] = '(z podatkiem)';
$_MODULE['<{payu}prestashop>error17_569fd05bdafa1712c4f6be5b153b8418'] = 'Inne metody płatności';
$_MODULE['<{payu}prestashop>paymethods_90c5249ee3db06a18dd9fbf98269a094'] = 'Zaplatit přes PayU';
$_MODULE['<{payu}prestashop>paymethods_1f87346a16cf80c372065de3c54c86d9'] = '(Včetně DPH)';
$_MODULE['<{payu}prestashop>paymethods_974bdf69fdcf46ae701c90f279a73065'] = 'Došlo k chybě';
$_MODULE['<{payu}prestashop>paymethods_982055a7202584cfd44e22b209bd36dc'] = 'Platební přikaz PayU SA';
$_MODULE['<{payu}prestashop>paymethods_29500aa43ba55f3f95e84d8795b1f238'] = '1) službu poskytuje PayU SA, 2) data příjemce, titul platby a sumu poskytuje PayU SA příjemce, 3) přikaz je odeslán ke zapracování, když PayU SA obdrží platbu, 4) platba je k dispozici příjemci během 1 holdiny, nejpozději do konce dalšího pracovního dne, 5) PayU SA si neúčtuje žádný související poplatek za služby.';
$_MODULE['<{payu}prestashop>paymethods_320620f678cb15ebf7a577abd04427f3'] = 'Souhlasím';
$_MODULE['<{payu}prestashop>paymethods_0ba1d602f5da2738f0e8a182ea649419'] = 'Podmínky jednorázové platební transakce PayU';
$_MODULE['<{payu}prestashop>paymethods_31ed48afbb350274001ddcce3e1f8758'] = 'Správcem vašich osobních údajů ve smyslu Zákona o ochraně osobních údajů ze dne 29. srpna 1997 (Sbírka zákonů 2002, č. 101, položka 926, ve znění pozdějších úprav) je PayU SA se sídlem registrovaným na adrese Grunwaldzka 182, Poznaň (60-166), Polsko. Vaše osobní údaje budou zpracovány a archivovány v souladu s příslušnými ustanoveními uvedeného zákona. Vaše údaje nebudou zpřístupněny třetím osobám, s výjimkou osob k tomu autorizovaných zákonem. Máte právo k vašim údajům přistupovat a upravovat je. Poskytnutí údajů je dobrovolné, ale je požadováno k účelům uvedeným výše.';
$_MODULE['<{payu}prestashop>paymethods_569fd05bdafa1712c4f6be5b153b8418'] = 'Jiné platební metody';
$_MODULE['<{payu}prestashop>paymethods_46b9e3665f187c739c55983f757ccda0'] = 'Potvrzuji objednávku a chci zaplatit';
$_MODULE['<{payu}prestashop>paymethods17_1f87346a16cf80c372065de3c54c86d9'] = '(Včetně DPH)';
$_MODULE['<{payu}prestashop>paymethods17_974bdf69fdcf46ae701c90f279a73065'] = 'Došlo k chybě';
$_MODULE['<{payu}prestashop>paymethods17_982055a7202584cfd44e22b209bd36dc'] = 'Platební přikaz PayU SA';
$_MODULE['<{payu}prestashop>paymethods17_29500aa43ba55f3f95e84d8795b1f238'] = '1) službu poskytuje PayU SA, 2) data příjemce, titul platby a sumu poskytuje PayU SA příjemce, 3) přikaz je odeslán ke zapracování, když PayU SA obdrží platbu, 4) platba je k dispozici příjemci během 1 holdiny, nejpozději do konce dalšího pracovního dne, 5) PayU SA si neúčtuje žádný související poplatek za služby.';
$_MODULE['<{payu}prestashop>paymethods17_320620f678cb15ebf7a577abd04427f3'] = 'Souhlasím';
$_MODULE['<{payu}prestashop>paymethods17_0ba1d602f5da2738f0e8a182ea649419'] = 'Podmínky jednorázové platební transakce PayU';
$_MODULE['<{payu}prestashop>paymethods17_31ed48afbb350274001ddcce3e1f8758'] = 'Správcem vašich osobních údajů ve smyslu Zákona o ochraně osobních údajů ze dne 29. srpna 1997 (Sbírka zákonů 2002, č. 101, položka 926, ve znění pozdějších úprav) je PayU SA se sídlem registrovaným na adrese Grunwaldzka 182, Poznaň (60-166), Polsko. Vaše osobní údaje budou zpracovány a archivovány v souladu s příslušnými ustanoveními uvedeného zákona. Vaše údaje nebudou zpřístupněny třetím osobám, s výjimkou osob k tomu autorizovaných zákonem. Máte právo k vašim údajům přistupovat a upravovat je. Poskytnutí údajů je dobrovolné, ale je požadováno k účelům uvedeným výše.';
$_MODULE['<{payu}prestashop>paymethods17_569fd05bdafa1712c4f6be5b153b8418'] = 'Jiné platební metody';
$_MODULE['<{payu}prestashop>paymethods17_46b9e3665f187c739c55983f757ccda0'] = 'Potvrzuji objednávku a chci zaplatit';
$_MODULE['<{payu}prestashop>status_90c5249ee3db06a18dd9fbf98269a094'] = 'Zaplatit přes PayU';
$_MODULE['<{payu}prestashop>status_b7ee249a10dc1f93b28fcb3b111257e1'] = 'Dziękujemy za wybranie płaności PayU';
$_MODULE['<{payu}prestashop>status_57297718fdb439175177cf6b196172d1'] = 'Stav objednávky';
$_MODULE['<{payu}prestashop>status_f5d74ea75357b5e139854c14f8e24fe3'] = 'Podrobnosti objednávky';
$_MODULE['<{payu}prestashop>status17_b7ee249a10dc1f93b28fcb3b111257e1'] = 'Děkujeme, že jste si vybrali platbu PayU';
$_MODULE['<{payu}prestashop>status17_57297718fdb439175177cf6b196172d1'] = 'Stav objednávky';
$_MODULE['<{payu}prestashop>status17_f5d74ea75357b5e139854c14f8e24fe3'] = 'Podrobnosti objednávky';
$_MODULE['<{payu}prestashop>payment_90c5249ee3db06a18dd9fbf98269a094'] = 'Zaplatit přes PayU';
$_MODULE['<{payu}prestashop>payment16_90c5249ee3db06a18dd9fbf98269a094'] = 'Zaplatit přes PayU';
$_MODULE['<{payu}prestashop>retrypayment_df3174e578ddd719d3642fece154ee5b'] = 'Zopakovat transakci přes PayU';
$_MODULE['<{payu}prestashop>retrypayment17_df3174e578ddd719d3642fece154ee5b'] = 'Zopakovat transakci přes PayU';

View 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;

View File

@@ -0,0 +1,153 @@
<?php
global $_MODULE;
$_MODULE = array();
$_MODULE['<{payu}prestashop>payu_6a90d0ab04a2cd28919bee487736cdeb'] = 'PayU';
$_MODULE['<{payu}prestashop>payu_41290081ccb73a4961e5e450ada4d13b'] = 'Akceptuje płatności przez PayU';
$_MODULE['<{payu}prestashop>payu_533937acf0e84c92e787614bbb16a7a0'] = 'Czy na pewno chcesz odinstalować moduł? Po tej operacji stracisz wszystkie ustawienia!';
$_MODULE['<{payu}prestashop>payu_77d1b273077dd163c5f9e5fed3a21152'] = 'Nie można zapisać konfiguracji';
$_MODULE['<{payu}prestashop>payu_c888438d14855d7d96a2724ee9c306bd'] = 'Ustawienia zaktualizowane';
$_MODULE['<{payu}prestashop>payu_fa84fbded2a02deeb191c6f5208a9ce5'] = 'Sposób integracji';
$_MODULE['<{payu}prestashop>payu_a5f555f0e168487b5c9a76b0229b7c1c'] = 'Wyświetlaj metody płatności';
$_MODULE['<{payu}prestashop>payu_c3895de7f3a59421939d83ba76d2c532'] = 'Wyświetlaj metody płatności na stronie podsumowania zamówienia Prestashop';
$_MODULE['<{payu}prestashop>payu_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Tak';
$_MODULE['<{payu}prestashop>payu_b9f5c797ebbf55adccdd8539a65a0241'] = 'Nie';
$_MODULE['<{payu}prestashop>payu_7fa4ddfc8c9860f996d09cf987e0b00e'] = 'Płatność po kliknięciu w przycisk ikony banku';
$_MODULE['<{payu}prestashop>payu_cdb0a7e412c5fba0a399104401d0dc79'] = 'Płatność kartą jako osobna metoda płatności';
$_MODULE['<{payu}prestashop>payu_700d10d23d7d7a558bd7e8b83ee99a9c'] = 'Płatność kartą w widżecie';
$_MODULE['<{payu}prestashop>payu_c9ef586b30f20b59e688cbdbf960b89b'] = 'Musi być włączona tokenizacja kart - https://github.com/PayU-EMEA/plugin_prestashop#widżet-do-płatności-kartą';
$_MODULE['<{payu}prestashop>payu_0ef02be13c1c539bb76a4ad10a4a6de1'] = 'Kolejność metod płatności';
$_MODULE['<{payu}prestashop>payu_5168bcc0a0473d4baf8c980dc9acb6bc'] = 'Podawaj symbole metod płatności oddzielając je przecinkiem. Lista metod płatności - http://developers.payu.com/pl/overview.html#paymethods';
$_MODULE['<{payu}prestashop>payu_99f72642d9fc5617cf2de9b67b0baf15'] = 'Tryb testowy (Sandbox)';
$_MODULE['<{payu}prestashop>payu_c9cc8cce247e49bae79f15173ce97354'] = 'Zapisz';
$_MODULE['<{payu}prestashop>payu_ba5376b5ba3216a7a51eabb18265d921'] = 'Raty';
$_MODULE['<{payu}prestashop>payu_a1f6309d520783d4d0163d5a9ff26cda'] = 'Promuj płatności ratalne';
$_MODULE['<{payu}prestashop>payu_ba9cce7b6b5c225fbd3d11a555030435'] = 'Włącza płatności ratalne na wyborze metod płatności i pozwala na promowanie rat';
$_MODULE['<{payu}prestashop>payu_a9ba633160b4732c06848c8ec792e7bb'] = 'Wyświetl Twisto jako osobną metoda płatności';
$_MODULE['<{payu}prestashop>payu_58c031a7bd41986ec989d13d559b570d'] = 'Wydziela Twisto ze wszystkich metod płatności';
$_MODULE['<{payu}prestashop>payu_f22e2e3d4a09b23efdd495ffe80ebb8e'] = 'Wyświetl raty w koszyku';
$_MODULE['<{payu}prestashop>payu_1a731c98ab99a867c6b7f9ea212c6e3c'] = 'Promuje raty w widoku koszyka';
$_MODULE['<{payu}prestashop>payu_352d40b8f691e22c5bacd2e5d63258d8'] = 'Wyświetl raty na podsumowaniu';
$_MODULE['<{payu}prestashop>payu_b4cecf82a20e31796a538ea5fd9b2540'] = 'Promuje raty na podsumowaniu';
$_MODULE['<{payu}prestashop>payu_4e8bd828eb6803d4fd731ab6f0afdca4'] = 'Wyświetl raty przy produktach';
$_MODULE['<{payu}prestashop>payu_e33d611fff50b1f2f4c612919201fd60'] = 'Promuje raty przy produkcie i na listingu';
$_MODULE['<{payu}prestashop>payu_deae7d0459da98d05a517d9d45329c51'] = 'Konfiguracja POS-a - dla waluty: ';
$_MODULE['<{payu}prestashop>payu_e9adbbd1cd7eff7e1a588c31f79521d5'] = 'Id punktu płatności';
$_MODULE['<{payu}prestashop>payu_dbf679af91c0dcb70d6f4903907753a4'] = 'Drugi klucz MD5';
$_MODULE['<{payu}prestashop>payu_4aec2383501f7dab31d609ca02c01843'] = 'OAuth - client_id';
$_MODULE['<{payu}prestashop>payu_bd561f60c843a8f02b7e3f622ae8bc31'] = 'OAuth - client_secret';
$_MODULE['<{payu}prestashop>payu_1808eed21687dabff9816096176234ab'] = 'SANDBOX - ';
$_MODULE['<{payu}prestashop>payu_8203e405b5bef2cd8b9a5bb38a410fc6'] = 'Statusy płatności';
$_MODULE['<{payu}prestashop>payu_194dae160a9dcdd91313d481201102c7'] = 'Rozpoczęta';
$_MODULE['<{payu}prestashop>payu_81c6a1fe50f50e7564c9e8777819e39a'] = 'Oczekuje na odbiór';
$_MODULE['<{payu}prestashop>payu_685b00adf082646c586862b1b892e294'] = 'Zakończona';
$_MODULE['<{payu}prestashop>payu_fe28437b788c1b7c11ba9be7081d23cf'] = 'Anulowana';
$_MODULE['<{payu}prestashop>payu_ef6532d4d523354a11a7c4ec0b574900'] = 'Kontrola zmiany statusów';
$_MODULE['<{payu}prestashop>payu_1b342df7ce0b74a56179d48f4c430f05'] = 'Dla statusów \"Zakończona\" i \"Anulowana\" możliwe jest przejście tylko ze statusów \"Rozpoczęta\" i \"Oczekuje na odbiór\"';
$_MODULE['<{payu}prestashop>payu_cc21116ce900f38c0691823ab193b9a3'] = 'Zapłać kartą';
$_MODULE['<{payu}prestashop>payu_3a236fb1c82cd58579049b70a46fcdc5'] = 'Zapłać przelewem online lub kartą';
$_MODULE['<{payu}prestashop>payu_961d23fcb6c49cee1150dba52beb04ca'] = 'Zapłać przelewem online';
$_MODULE['<{payu}prestashop>payu_57244cabdfb29fd0983891b6f0381af1'] = 'Zapłać później';
$_MODULE['<{payu}prestashop>payu_8b30b72eb751e7549e99b8e2753098df'] = 'Zapłać na raty';
$_MODULE['<{payu}prestashop>payu_d0027d2c207817773a2016676cbe350d'] = 'Płatność kartą lub przelewem przez PayU';
$_MODULE['<{payu}prestashop>payu_a3c8cfa81d897fc55a71606e1381f5a4'] = 'Żądanie zmiany statusu zostało wysłane.';
$_MODULE['<{payu}prestashop>payu_2f8798acbb31ddfb6709697e67b6dcba'] = 'Kwota zwrotu jest wyższa niż zapłacona.';
$_MODULE['<{payu}prestashop>payu_5096e3af2ad62eedf3f680f71af6ac1e'] = 'Błąd zwrotu: ';
$_MODULE['<{payu}prestashop>payu_454c1fb47a376e178981c01304cf9341'] = 'Błąd zwrotu...';
$_MODULE['<{payu}prestashop>payu_350a9513d90bf0075bf8515ee6ba212f'] = 'Update status request has not been completed correctly.\' . \' \' . $updateOrderStatus[\'message\'])); } } $this->context->smarty->assign(array( \'PAYU_PAYMENT_STATUS_OPTIONS\' => $this->getPaymentAcceptanceStatusesList(), \'PAYU_PAYMENT_STATUS\' => $order_payment[\'status\'], \'PAYU_PAYMENT_ACCEPT\' => $isConfirmable )); } return $output . $this->fetchTemplate(\'/views/templates/admin/status.tpl';
$_MODULE['<{payu}prestashop>payu_1852891df77140cc48a3fa6e48b9ac68'] = 'Zamówienie:';
$_MODULE['<{payu}prestashop>payu_72608e100b98e6041c7f43ab0ead2e37'] = 'Sklep:';
$_MODULE['<{payu}prestashop>payu_db4ee5e4de60968ed345209a0b51a17d'] = 'Zaakceptuj płatność';
$_MODULE['<{payu}prestashop>payu_1ed3dcc1be1ccdfd6b2daf7b866d3ffd'] = 'Odrzuć płatność';
$_MODULE['<{payu}prestashop>payu_1a4bf0dd59a290f55a88831c7626c4b1'] = 'Aktualizacja statusu zamówienia nie może być wysłana';
$_MODULE['<{payu}prestashop>retrypayment17_df3174e578ddd719d3642fece154ee5b'] = 'Zapłać ponownie przez PayU';
$_MODULE['<{payu}prestashop>retrypayment_df3174e578ddd719d3642fece154ee5b'] = 'Zapłać ponownie przez PayU';
$_MODULE['<{payu}prestashop>payment16_cc21116ce900f38c0691823ab193b9a3'] = 'Zapłać kartą';
$_MODULE['<{payu}prestashop>payment16_22811d85a0f85861e285232e81c5b239'] = 'Zapłać później z Twisto';
$_MODULE['<{payu}prestashop>payment16_961d23fcb6c49cee1150dba52beb04ca'] = 'Zapłać przelewem online';
$_MODULE['<{payu}prestashop>payment16_3a236fb1c82cd58579049b70a46fcdc5'] = 'Zapłać przelewem online lub kartą';
$_MODULE['<{payu}prestashop>payment16_8b30b72eb751e7549e99b8e2753098df'] = 'Zapłać na raty online z PayU';
$_MODULE['<{payu}prestashop>checkout_installment_49c3ff437ddc797faa0448e26043b2c9'] = 'Zamówienie z obowiązkiem zapłaty dojdzie do skutku po pozytywnej decyzji pożyczkodawcy.';
$_MODULE['<{payu}prestashop>status_54577b37d6aac51a99697804caa2660d'] = 'Akceptacja płatności PayU';
$_MODULE['<{payu}prestashop>status_9b9cf9f8778f69b4c6cf37e66f886be8'] = 'Wybierz status';
$_MODULE['<{payu}prestashop>status_f4ec5f57bd4d31b803312d873be40da9'] = 'Zmień';
$_MODULE['<{payu}prestashop>status_fa377a7a4e549f5201c24512e1f56466'] = 'Dostępne tylko wtedy gdy status zamówienia w PayU jest WAITING_FOR_CONFIRMATION lub REJECTED';
$_MODULE['<{payu}prestashop>status_68a2ace2fa4faf43789b43a05614b5a6'] = 'Zamówienia w PayU';
$_MODULE['<{payu}prestashop>status_e7439b5ca1f88bed2622be1ba9e317d5'] = 'Data utworzenia';
$_MODULE['<{payu}prestashop>status_6c4528510842f314f32ce40a6d43b391'] = 'Data aktualizacji';
$_MODULE['<{payu}prestashop>status_ec53a8c4f07baed5d8825072c89799be'] = 'Status';
$_MODULE['<{payu}prestashop>status_004bf6c9a40003140292e97330236c53'] = 'Akcja';
$_MODULE['<{payu}prestashop>status_ea4788705e6873b424c65e91c2846b19'] = 'Anuluj';
$_MODULE['<{payu}prestashop>status_31dc088ceb59687e1422e1ee02a1ba22'] = 'Czy na pewno chcesz wysłać zlecenie zwrotu?';
$_MODULE['<{payu}prestashop>status_c0a3c3e9b5fbd21c505e082644b2220c'] = 'Zwrot pełny';
$_MODULE['<{payu}prestashop>status_77fd2b4393b379bedd30efcd5df02090'] = 'Zwrot częściowy';
$_MODULE['<{payu}prestashop>status_e9f40e1f1d1658681dad2dac4ae0971e'] = 'kwota';
$_MODULE['<{payu}prestashop>status_4f2f7683e451402d38f2db9eff63a6d5'] = 'Wykonaj zwrot';
$_MODULE['<{payu}prestashop>info_a82be0f551b8708bc08eb33cd9ded0cf'] = 'Informacje';
$_MODULE['<{payu}prestashop>info_6aa28325dd9b997c48f62e5b9e96825d'] = 'Ważne: Moduł ta działa tylko z punktem płatności typu \"REST API\" (Checkout).';
$_MODULE['<{payu}prestashop>info_26f3271bfe0049df9803a18384703f8f'] = 'Jeżeli nie posiadasz jeszcze konta w systemie PayU';
$_MODULE['<{payu}prestashop>info_83ce274383e5997dd3863c94de53b975'] = 'zarejestruj się w systemie produkcyjnym';
$_MODULE['<{payu}prestashop>info_6899336ad02d327ac9b4d1670f72a18c'] = 'lub';
$_MODULE['<{payu}prestashop>info_58831c758a5f02aba234268220eb840d'] = 'zarejestruj się w systemie sandbox';
$_MODULE['<{payu}prestashop>status17_b7ee249a10dc1f93b28fcb3b111257e1'] = 'Dziękujemy za wybranie płaności PayU';
$_MODULE['<{payu}prestashop>status17_57297718fdb439175177cf6b196172d1'] = 'Status zamówienia';
$_MODULE['<{payu}prestashop>status17_f5d74ea75357b5e139854c14f8e24fe3'] = 'Szczegóły zamówienia';
$_MODULE['<{payu}prestashop>paymethods17_1f87346a16cf80c372065de3c54c86d9'] = '(z podatkiem)';
$_MODULE['<{payu}prestashop>paymethods17_974bdf69fdcf46ae701c90f279a73065'] = 'Wystąpił błąd';
$_MODULE['<{payu}prestashop>paymethods17_569fd05bdafa1712c4f6be5b153b8418'] = 'Inne metody płatności';
$_MODULE['<{payu}prestashop>paymethods17_46b9e3665f187c739c55983f757ccda0'] = 'Potwierdzam zamówienie i płacę';
$_MODULE['<{payu}prestashop>paymethods17_99938b17c91170dfb0c2f3f8bc9f2a85'] = 'Zapłać';
$_MODULE['<{payu}prestashop>secureformjs_07ce6a9764922eb889028436bbf6a758'] = 'Proszę zaakceptuj \"Regulamin pojedynczej transakcji płatniczej PayU\"';
$_MODULE['<{payu}prestashop>secureformjs_d425d2ed80e40301dfa55849a1253bd2'] = 'Wystąpił płąd podczas próby użycia karty';
$_MODULE['<{payu}prestashop>paymethods_90c5249ee3db06a18dd9fbf98269a094'] = 'Zapłać przez payU';
$_MODULE['<{payu}prestashop>paymethods_1f87346a16cf80c372065de3c54c86d9'] = '(z podatkiem)';
$_MODULE['<{payu}prestashop>paymethods_974bdf69fdcf46ae701c90f279a73065'] = 'Wystąpił błąd';
$_MODULE['<{payu}prestashop>paymethods_569fd05bdafa1712c4f6be5b153b8418'] = 'Inne metody płatności';
$_MODULE['<{payu}prestashop>paymethods_46b9e3665f187c739c55983f757ccda0'] = 'Potwierdzam zamówienie i płacę';
$_MODULE['<{payu}prestashop>paymethods_99938b17c91170dfb0c2f3f8bc9f2a85'] = 'Zapłać';
$_MODULE['<{payu}prestashop>secureform_90c5249ee3db06a18dd9fbf98269a094'] = 'Zapłać przez payU';
$_MODULE['<{payu}prestashop>secureform_1f87346a16cf80c372065de3c54c86d9'] = '(z podatkiem)';
$_MODULE['<{payu}prestashop>secureform_974bdf69fdcf46ae701c90f279a73065'] = 'Wystąpił błąd';
$_MODULE['<{payu}prestashop>secureform_569fd05bdafa1712c4f6be5b153b8418'] = 'Inne metody płatności';
$_MODULE['<{payu}prestashop>secureform_46b9e3665f187c739c55983f757ccda0'] = 'Potwierdzam zamówienie i płacę';
$_MODULE['<{payu}prestashop>secureform_99938b17c91170dfb0c2f3f8bc9f2a85'] = 'Zapłać';
$_MODULE['<{payu}prestashop>secureform_c360639f51cb2625a9439974e865a683'] = 'Proszę czekać';
$_MODULE['<{payu}prestashop>error17_1f87346a16cf80c372065de3c54c86d9'] = '(z podatkiem)';
$_MODULE['<{payu}prestashop>error17_df3174e578ddd719d3642fece154ee5b'] = 'Zapłać ponownie przez PayU';
$_MODULE['<{payu}prestashop>error_90c5249ee3db06a18dd9fbf98269a094'] = 'Zapłać przez PayU';
$_MODULE['<{payu}prestashop>error_1f87346a16cf80c372065de3c54c86d9'] = '(z podatkiem)';
$_MODULE['<{payu}prestashop>error_df3174e578ddd719d3642fece154ee5b'] = 'Zapłać ponownie przez PayU';
$_MODULE['<{payu}prestashop>conditions17_320620f678cb15ebf7a577abd04427f3'] = 'Akceptuję';
$_MODULE['<{payu}prestashop>conditions17_0ba1d602f5da2738f0e8a182ea649419'] = 'Regulamin pojedynczej transakcji płatniczej PayU';
$_MODULE['<{payu}prestashop>conditions17_85313cd7b9119225ebbe925eb788ea40'] = 'Zlecenie realizacji płatności: Zlecenie wykonuje PayU SA; Dane odbiorcy, tytuł oraz kwota płatności dostarczane są PayU SA przez odbiorcę;';
$_MODULE['<{payu}prestashop>conditions17_d959bbe25cc020e2db5276cb42927c7c'] = 'czytaj więcej';
$_MODULE['<{payu}prestashop>conditions17_cf0fa11a34b65ca7db62bd4f5647b119'] = 'Zlecenie jest przekazywane do realizacji po otrzymaniu przez PayU SA Państwa wpłaty. Płatność udostępniana jest odbiorcy w ciągu 1 godziny, nie później niż do końca następnego dnia roboczego; PayU SA nie pobiera opłaty od realizacji usługi.';
$_MODULE['<{payu}prestashop>conditions17_07f9d5043bb1486440542b71c2c28c7f'] = 'Administratorem Twoich danych osobowych jest PayU S.A. z siedzibą w Poznaniu (60-166), przy ul. Grunwaldzkiej 186.';
$_MODULE['<{payu}prestashop>conditions17_c7b806aa4c0e517774019bceb0ddfcc8'] = ' Twoje dane osobowe będą przetwarzane w celu realizacji transakcji płatniczej, powiadamiania Cię o statusie realizacji Twojej płatności, rozpatrywania reklamacji, a także w celu wypełnienia obowiązków prawnych ciążących na PayU.';
$_MODULE['<{payu}prestashop>conditions17_ca5a3a94620165a0169f0a7910170d27'] = 'Odbiorcami Twoich danych osobowych mogą być podmioty współpracujące z PayU w procesie realizacji płatności. W zależności od wybranej przez Ciebie metody płatności mogą to być: banki, instytucje płatnicze, instytucje pożyczkowe, organizacje kart płatniczych, schematy płatnicze), ponadto podmioty wspierające działalność PayU tj. dostawcy infrastruktury IT, dostawcy narzędzi do analizy ryzyka płatności a także podmiotom uprawnionym do ich otrzymania na mocy obowiązujących przepisów prawa, w tym właściwym organom wymiaru sprawiedliwości. Twoje dane mogą zostać udostępnione akceptantom celem poinformowania ich o statusie realizacji płatności.';
$_MODULE['<{payu}prestashop>conditions17_c2ee2e62e72c3340d028bc5cb6d5e6a0'] = 'Przysługuje Tobie prawo dostępu do danych, a także do ich sprostowania, ograniczenia ich przetwarzania, zgłoszenia sprzeciwu wobec ich przetwarzania, niepodlegania zautomatyzowanemu podejmowaniu decyzji w tym profilowania oraz do przenoszenia i usunięcia danych. Podanie danych jest dobrowolne jednak niezbędne do realizacji płatności, a brak podania danych może skutkować odrzuceniem płatności. Więcej informacji o zasadach przetwarzania Twoich danych osobowych przez PayU znajdziesz w ';
$_MODULE['<{payu}prestashop>conditions17_48c85d60e249e5176d4aba1491154ed8'] = 'https://static.payu.com/sites/terms/files/payu_privacy_policy_pl_pl.pdf';
$_MODULE['<{payu}prestashop>conditions17_c4a11d9e2fc72c306231560f7ae5eea6'] = 'Polityce Prywatności';
$_MODULE['<{payu}prestashop>status_90c5249ee3db06a18dd9fbf98269a094'] = 'Płacę przez PayU';
$_MODULE['<{payu}prestashop>status_b7ee249a10dc1f93b28fcb3b111257e1'] = 'Dziękujemy za wybranie płaności PayU';
$_MODULE['<{payu}prestashop>status_57297718fdb439175177cf6b196172d1'] = 'Status zamówienia';
$_MODULE['<{payu}prestashop>status_f5d74ea75357b5e139854c14f8e24fe3'] = 'Szczegóły zamówienia';
$_MODULE['<{payu}prestashop>payucardform_a44217022190f5734b2f72ba1e4f8a79'] = 'Numer karty';
$_MODULE['<{payu}prestashop>payucardform_3bd235b6dee5bd991cef41dafa0d904b'] = 'Ważna do';
$_MODULE['<{payu}prestashop>payucardform_60a104dc50579d60cbc90158fada1dcf'] = 'CVV';
$_MODULE['<{payu}prestashop>secureform17_1f87346a16cf80c372065de3c54c86d9'] = '(z podatkiem)';
$_MODULE['<{payu}prestashop>secureform17_974bdf69fdcf46ae701c90f279a73065'] = 'Wystąpił błąd';
$_MODULE['<{payu}prestashop>secureform17_569fd05bdafa1712c4f6be5b153b8418'] = 'Inne metody płatności';
$_MODULE['<{payu}prestashop>secureform17_46b9e3665f187c739c55983f757ccda0'] = 'Potwierdzam zamówienie i płacę';
$_MODULE['<{payu}prestashop>secureform17_99938b17c91170dfb0c2f3f8bc9f2a85'] = 'Zapłać';
$_MODULE['<{payu}prestashop>secureform17_c360639f51cb2625a9439974e865a683'] = 'Proszę czekać';
$_MODULE['<{payu}prestashop>payment_2b6ad338c35b2cb1996471ff24a0b739'] = 'Proszę wybrać metodę płatności';
$_MODULE['<{payu}prestashop>payment_07ce6a9764922eb889028436bbf6a758'] = 'Proszę zaakceptować \"Regulamin pojedynczej transakcji płatniczej PayU\"';
$_MODULE['<{payu}prestashop>payment_30a8150f4551a03ddf806471b3f9dcb2'] = 'Brak tokena kartowego';
$_MODULE['<{payu}prestashop>payment_1e2a75e709cadff2cf957168c56fda54'] = 'Zapłać za swoje zamówienie';
$_MODULE['<{payu}prestashop>payment_b48be21602cfe26c1385f2cdfaa6b675'] = 'Wystąpił błąd podczas procesowania płatności.';
$_MODULE['<{payu}prestashop>payment_1f6434ac894e727cc0f158c5ec119d24'] = 'Wystąpił błąd podczas procesowania płatności. Proszę spróbować ponownie lub skontaktować się ze sklepem.';
$_MODULE['<{payu}prestashop>payment_e2b7dec8fa4b498156dfee6e4c84b156'] = 'Metoda płatności \"PayU\" jest niedostępna';
$_MODULE['<{payu}prestashop>payment_8457277a28307ffccf7dbe86f93ffdcc'] = 'Moduł PayU jest nieaktywny.';
$_MODULE['<{payu}prestashop>payment_dab89c1873bc1fce69e6b0f497d72279'] = 'Zapłać ponownie za zamówienie';
$_MODULE['<{payu}prestashop>payment_e2867a925cba382f1436d1834bb52a1c'] = 'Całkowita wartość zamówienia wynosi';

View File

@@ -0,0 +1,21 @@
<?php
/**
* PayU
*
* @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
*/
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;

View File

@@ -0,0 +1,28 @@
<?php
/**
* PayU
*
* @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
*/
if (!defined('_PS_VERSION_')) {
exit;
}
function upgrade_module_2_5_0($module)
{
$module->registerHook('displayOrderDetail');
if (Db::getInstance()->ExecuteS('SHOW COLUMNS FROM ' . _DB_PREFIX_ . 'order_payu_payments LIKE "ext_order_id"') == false) {
Db::getInstance()->Execute('ALTER TABLE ' . _DB_PREFIX_ . 'order_payu_payments ADD ext_order_id VARCHAR(64) NOT NULL AFTER id_session');
}
Configuration::updateValue('PAYU_PAYMENT_STATUS_CANCELED', $module->addNewOrderState('PAYU_PAYMENT_STATUS_CANCELED',
array('en' => 'PayU payment canceled', 'pl' => 'Płatność PayU anulowana'), true));
return true;
}

View File

@@ -0,0 +1,26 @@
<?php
/**
* PayU
*
* @author PayU
* @copyright Copyright (c) 2018 PayU
* @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
*
* http://www.payu.com
*/
if (!defined('_PS_VERSION_')) {
exit;
}
function upgrade_module_3_0_10($module)
{
return Configuration::updateValue('PAYU_PROMOTE_CREDIT', 1) &&
Configuration::updateValue('PAYU_PROMOTE_CREDIT_CART', 1) &&
Configuration::updateValue('PAYU_PROMOTE_CREDIT_SUMMARY', 1) &&
Configuration::updateValue('PAYU_PROMOTE_CREDIT_PRODUCT', 1) &&
$module->registerHook('displayOrderDetail') &&
$module->registerHook('displayProductPriceBlock') &&
$module->registerHook('displayCheckoutSubtotalDetails') &&
$module->registerHook('displayCheckoutSummaryTop');
}

View File

@@ -0,0 +1,20 @@
<?php
/**
* PayU
*
* @author PayU
* @copyright Copyright (c) 2018 PayU
* @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
*
* http://www.payu.com
*/
if (!defined('_PS_VERSION_')) {
exit;
}
function upgrade_module_3_1_0($module)
{
return Configuration::updateValue('PAYU_SEPARATE_CARD_PAYMENT', 0) &&
Configuration::updateValue('PAYU_CARD_PAYMENT_WIDGET', 0);
}

View 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;

View 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;

View File

@@ -0,0 +1,15 @@
{*
* PayU
*
* @author PayU
* @copyright Copyright (c) 2017 PayU
* @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
*
* http://www.payu.com
*}
<div class="panel">
<div class="panel-heading">{l s='Information' mod='payu'}</div>
<p>{l s='Important: This plugin works only with "REST API" (Checkout) points of sales (POS).' mod='payu'}<br />
{l s='If you do not already have PayU merchant account, ' mod='payu'} <a href="https://secure.payu.com/boarding/?pk_campaign=Github&pk_kwd=Prestashop#/form" target="_blank">{l s='please register in Production' mod='payu'}</a> {l s='or ' mod='payu'} <a href="https://secure.snd.payu.com/boarding/?pk_campaign=Plugin&pk_kwd=Prestashop#/form" target="_blank">{l s='please register in Sandbox' mod='payu'}.</a>
</div>

View File

@@ -0,0 +1,145 @@
{*
* PayU
*
* @author PayU
* @copyright Copyright (c) 2017 PayU
* @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
*
* http://www.payu.com
*}
{if $PAYU_PAYMENT_ACCEPT}
{if $IS_17}
<div class="row"><div class="col-lg-12">
{/if}
<br />
<div id="payu-status-wrapper" class="panel">
<form id="_form" class="form-horizontal hidden-print" action="{$smarty.server.REQUEST_URI|escape:'htmlall':'UTF-8'}" method="post" enctype="multipart/form-data">
<fieldset>
<legend><img src="{$module_dir|escape:'htmlall':'UTF-8'}logo.gif" alt="" /> {l s='PayU payment acceptance' mod='payu'}</legend>
<label>{l s='Choose status' mod='payu'}</label>
<div class="form-group">
<div class="col-lg-9">
<select name="PAYU_PAYMENT_STATUS" id="PAYU_PAYMENT_STATUS">
{foreach from=$PAYU_PAYMENT_STATUS_OPTIONS item=option}
<option value="{$option.id|escape:'htmlall':'UTF-8'}" {if $option.id == $PAYU_PAYMENT_STATUS}selected="selected"{/if}>{$option.name|escape:'htmlall':'UTF-8'}</option>
{/foreach}
</select>
</div>
<div class="col-lg-3">
<button class="btn btn-primary" name="submitpayustatus" type="submit">{l s='Change' mod='payu'}</button>
</div>
</div>
<p class="preference_description">
{l s='Works only when the PayU order status is WAITING_FOR_CONFIRMATION or REJECTED' mod='payu'}
</p>
</fieldset>
</form>
</div>
{if $IS_17}
</div></div>
{/if}
{/if}
{if $IS_17}
<div class="row"><div class="col-lg-12">
{/if}
<div id="payuOrders" class="panel card">
<div class="panel-heading card-header">
<i class="icon-money"></i>
{l s='PayU Orders' mod='payu'}
</div>
{$PAYU_CANCEL_ORDER_MESSAGE}
<div class="card-body">
<table class="table">
<thead>
<tr>
<th><span class="title_box ">{l s='Create date' mod='payu'}</span></th>
<th><span class="title_box ">{l s='Update date' mod='payu'}</span></th>
<th><span class="title_box ">PayU - OrderId</span></th>
<th><span class="title_box ">PayU - ExtOrderId</span></th>
<th><span class="title_box ">Payu - {l s='Status' mod='payu'}</span></th>
<th><span class="title_box ">{l s='Action' mod='payu'}</span></th>
</tr>
</thead>
{if $PAYU_ORDERS}
<tbody>
{foreach from=$PAYU_ORDERS item=payuOrder}
<tr>
<td>{dateFormat date=$payuOrder.create_at full=true}</td>
<td>{dateFormat date=$payuOrder.update_at full=true}</td>
<td>{$payuOrder.id_session}</td>
<td>{$payuOrder.ext_order_id}</td>
<td>{$payuOrder.status}</td>
<td>{if $payuOrder.status == 'NEW' || $payuOrder.status == 'PENDING'}<a class="btn btn-primary" href="{$link->getAdminLink('AdminOrders')|escape:'html':'UTF-8'}&amp;vieworder&amp;id_order={$PAYU_ORDER_ID|intval}&amp;cancelPayuOrder={$payuOrder.id_session}">{l s='Cancel' mod='payu'}</a>{/if}</td>
</tr>
{/foreach}
</tbody>
{/if}
</table>
{if $SHOW_REFUND}
<div class="row">
<div class="col-sm-6">
<form action="" method="post" onsubmit="return confirm('{l s='Do you really want to submit the refund request?' mod='payu'}');">
<input type="hidden" name="submitPayuRefund" value="1">
<table class="table-sm table-condensed">
<tr>
<td>
<select id="payu_refund_type" name="payu_refund_type" class="custom-select">
<option value="full"{if $REFUND_TYPE eq "full"} selected="selected"{/if}>{l s='Full refund' mod='payu'}</option>
<option value="partial"{if $REFUND_TYPE eq "partial"} selected="selected"{/if}>{l s='Partial refund' mod='payu'}</option>
</select>
</td>
<td>
{l s='amount' mod='payu'}
</td>
<td>
<input type="text" class="form-control" id="payu_refund_amount" name="payu_refund_amount" value="{$REFUND_AMOUNT|escape:'htmlall':'UTF-8'}"/>
</td>
<td>
<button class="btn btn-primary btn-sm">
{l s='Perform refund' mod='payu'}
</button>
</td>
</tr>
</table>
</form>
</div>
</div>
{if $REFUND_ERRORS|count}
<div role="alert" class="alert alert-danger">
<p class="alert-text">
{foreach from = $REFUND_ERRORS item = error}
<div>{$error}</div>
{/foreach}
</p>
</div>
{/if}
<script>
{literal}
$(document).ready(function() {
var refund_type_select = $('#payu_refund_type');
var set_type = function(type) {
if ('full' === type) {
$('#payu_refund_amount').attr('readonly', true).val('{/literal}{$REFUND_FULL_AMOUNT|escape:'htmlall':'UTF-8'}{literal}');
} else {
$('#payu_refund_amount').attr('readonly', false);
}
};
set_type(refund_type_select.val());
refund_type_select.on('change', function(){
set_type(refund_type_select.val());
});
});
{/literal}
</script>
{/if}
</div>
</div>
{if $IS_17}
</div></div>
{/if}

View 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 PayUs 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>

View 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>

View 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}

View 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;

View 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>

View 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}

View 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>

View 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"}

View 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}

View 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>

View 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>

View 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}

View File

@@ -0,0 +1,28 @@
{*
* PayU
*
* @author PayU
* @copyright Copyright (c) 2018 PayU
* @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
*
* http://www.payu.com
*}
<span style="display: block; margin-top: 10px;">
<span id="payu-installment-cart-summary"></span>
</span>
<script type="text/javascript" class="payu-script-tag">
document.addEventListener("DOMContentLoaded", function (event) {
openpayu.options.creditAmount ={$cart_total_amount|floatval};
openpayu.options.showLongDescription = true;
openpayu.options.lang = 'pl';
OpenPayU.Installments.miniInstallment('#payu-installment-cart-summary');
});
if (document.getElementById("payu-installment-cart-summary").childNodes.length == 0 &&
typeof openpayu !== 'undefined' &&
openpayu != null) {
openpayu.options.creditAmount ={$cart_total_amount|floatval};
openpayu.options.showLongDescription = true;
openpayu.options.lang = 'pl';
OpenPayU.Installments.miniInstallment('#payu-installment-cart-summary');
}
</script>

View File

@@ -0,0 +1,23 @@
{*
* PayU
*
* @author PayU
* @copyright Copyright (c) 2018 PayU
* @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
*
* http://www.payu.com
*}
<div class="payu-installment-panel">
<span id="payu-installment-cart-total"></span>
<script type="text/javascript" class="payu-script-tag">
document.addEventListener("DOMContentLoaded", function (event) {
openpayu.options.creditAmount ={$cart_total_amount|floatval};
openpayu.options.showLongDescription = true;
openpayu.options.lang = 'pl';
OpenPayU.Installments.miniInstallment('#payu-installment-cart-total');
});
</script>
</div>
<hr class="separator payu-separator-reset">
<p></p>

View File

@@ -0,0 +1,22 @@
<div class="payu-marker-class payu-method-description payu-checkout-installment">
<img style="width: 121px; margin-top:-20px;" src="{$payu_installment_img}" />
<p>
<span id='payu-installments-mini-cart'></span>
<script type='text/javascript' class="payu-script-tag" >
document.addEventListener("DOMContentLoaded", function(event) {
openpayu.options.creditAmount ={$total_price};
openpayu.options.showLongDescription = true;
openpayu.options.lang = 'pl';
OpenPayU.Installments.miniInstallment('#payu-installments-mini-cart');
});
</script>
</p>
<p>
{l s='Order will be done after positive decision' mod='payu'}
</p>
</div>
<script type="text/javascript">
(function () {
window.payuPaymentLoaded = true;
})();
</script>

View 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;

View File

@@ -0,0 +1,80 @@
{*
* PayU
*
* @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
*}
<fieldset class="payu-payment-fieldset-1-6">
<legend class="payu-payment-legend-1-6">
<span class='logo' />
</legend>
{if $showCardPayment == true}
<div class="row">
<div class="col-xs-12">
<p class="payment_module">
<a class="payu payu_card" href="{$cardActionUrl|escape:'htmlall':'UTF-8'}"
title="{l s='Pay by card' mod='payu'}">
{l s='Pay by card' mod='payu'}
</a>
</p>
</div>
</div>
{/if}
{if $payu_later_twisto_available == true}
<div class="row">
<div class="col-xs-12">
<div class="payu-payment-credit-later-twisto-tile" onclick="location.href='{$creditPayLaterTwistoActionUrl|escape:'htmlall':'UTF-8'}'"
title="{l s='Pay later with Twisto' mod='payu'}">
{l s='Pay later with Twisto' mod='payu'}
</div>
</div>
</div>
{/if}
<div class="row">
<div class="col-xs-12">
<p class="payment_module payment_payu">
{if $showCardPayment == true}
<a class="payu" href="{$actionUrl|escape:'htmlall':'UTF-8'}"
title="{l s='Pay by online transfer' mod='payu'}">
{l s='Pay by online transfer' mod='payu'}
</a>
{else}
<a class="payu" href="{$actionUrl|escape:'htmlall':'UTF-8'}"
title="{l s='Pay by online transfer or card' mod='payu'}">
{l s='Pay by online transfer or card' mod='payu'}
</a>
{/if}
</p>
</div>
</div>
{if $credit_available == true}
<div class="row">
<div class="col-xs-12">
<div class="payu-payment-credit-installment-tile" onclick="location.href='{$creditActionUrl|escape:'htmlall':'UTF-8'}'"
title="{l s='Pay online in installments' mod='payu'}">
{l s='Pay online in installments' mod='payu'}
<span id="payu-installment-cart-summary" class="payu-installment-cart-summary"></span>
<script type="text/javascript" class="payu-script-tag" >
document.addEventListener("DOMContentLoaded", function (event) {
openpayu.options.creditAmount ={$cart_total_amount|floatval};
openpayu.options.showLongDescription = true;
openpayu.options.lang = 'pl';
OpenPayU.Installments.miniInstallment('#payu-installment-cart-summary');
});
if (document.getElementById("payu-installment-cart-summary").childNodes.length == 0 &&
typeof openpayu !== 'undefined' &&
openpayu != null) {
openpayu.options.creditAmount ={$cart_total_amount|floatval};
openpayu.options.showLongDescription = true;
openpayu.options.lang = 'pl';
OpenPayU.Installments.miniInstallment('#payu-installment-cart-summary');
}
</script>
</div>
</div>
</div>
{/if}
</fieldset>

View File

@@ -0,0 +1,30 @@
{*
* PayU
*
* @author PayU
* @copyright Copyright (c) 2018 PayU
* @license http://opensource.org/licenses/LGPL-3.0 Open Software License (LGPL 3.0)
*
* http://www.payu.com
*}
<span class="payu-installment-price-listing">
<span style="display: block;" class="payu-installment-mini-{$product_id|md5}"></span>
</span>
<script type="text/javascript" class="payu-script-tag">
document.addEventListener("DOMContentLoaded", function (event) {
$(".products").find(".payu-installment-price-listing").parent().css("margin-top", "-7px");
$(".products").find(".payu-installment-price-listing").parent().prev().css("margin-top", "7px");
$(".products").find(".payu-installment-price-listing > span").css("margin-top", "-2px");
openpayu.options.creditAmount ={$product_price|floatval};
openpayu.options.showLongDescription = true;
openpayu.options.lang = 'pl';
OpenPayU.Installments.miniInstallment('.payu-installment-mini-{$product_id|md5}');
});
if (typeof openpayu !== 'undefined') {
openpayu.options.creditAmount ={$product_price|floatval};
openpayu.options.showLongDescription = true;
openpayu.options.lang = 'pl';
OpenPayU.Installments.miniInstallment('.payu-installment-mini-{$product_id|md5}');
}
</script>

View File

@@ -0,0 +1,25 @@
{*
* PayU
*
* @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
*}
<div class="row" id="payuRetryPayment">
<div class="col-xs-12">
<p class="payment_module">
<a class="payu" href="{$payuActionUrl|escape:'htmlall':'UTF-8'}" title="{l s='Retry pay with PayU' mod='payu'}">
<img src="{$payuImage|escape:'htmlall':'UTF-8'}" alt="{l s='Retry pay with PayU' mod='payu'}" />
{l s='Retry pay with PayU' mod='payu'}
</a>
</p>
</div>
</div>
<script>
$(document).ready(function() {
$('#payuRetryPayment').insertAfter($('.info-order').first());
});
</script>

View File

@@ -0,0 +1,18 @@
{*
* PayU
*
* @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
*}
<div class="box" id="payuRetryPayment17">
<p class="payment_module_17">
<a class="payu" href="{$payuActionUrl|escape:'htmlall':'UTF-8'}" title="{l s='Retry pay with PayU' mod='payu'}">
<img src="{$payuImage|escape:'htmlall':'UTF-8'}" alt="{l s='Retry pay with PayU' mod='payu'}" />
{l s='Retry pay with PayU' mod='payu'}
</a>
</p>
</div>

View 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;