Files
kupshop/web/common/templates/payment.PayU.tpl
2025-08-02 16:30:27 +02:00

105 lines
4.1 KiB
Smarty

{extends "index.tpl"}
{block content}
{if $payment.order}
<h1>Objednávka č. {$payment.order.order_no} - <a href="{$payment->order->getDetailUrl()}">detail objednávky</a></h1>
{/if}
<div class="objednavka-kosik">
<div class="form_group">
{if $body.step >= 0 }
{* OK *}
{if $body.step == 1}
{* Submit script *}
<form action="https://secure.payu.com/paygw/UTF/NewPayment" method="POST" name="payform" class="le-validate order">
<div>
<input type="hidden" name="pos_id" value="{$payment.config.pos}"/>
<input type="hidden" name="pos_auth_key" value="{$payment.config.auth_key}"/>
<input type="hidden" name="session_id" value="{$payment.session_id}"/>
{capture name="total_price"}{($payment->order->getRemainingPayment()*100)|round}{/capture}
<input type="hidden" name="amount" value="{$smarty.capture.total_price}"/>
<input type="hidden" name="desc" value="Platba objednavky {$payment.order.id}"/>
<input type="hidden" name="order_id" value="{$payment.order.id}"/>
<input type="hidden" name="first_name" value="{$payment.order.invoice_name}"/>
<input type="hidden" name="last_name" value="{$payment.order.invoice_surname}"/>
<input type="hidden" name="email" value="{$payment.order.invoice_email}"/>
<input type="hidden" name="language" value="cs"></input>
{capture name="signature"}{$payment.config.pos}{$payment.session_id}{$payment.config.auth_key}{$smarty.capture.total_price}Platba objednavky {$payment.order.id}{$payment.order.id}{$payment.order.invoice_name}{$payment.order.invoice_surname}{$payment.order.invoice_email}cs{$ctrl.ip}{$payment.ts}{$payment.config.key1}{/capture}
<input type="hidden" name="sig" value="{$smarty.capture.signature|md5}"/>
<input type="hidden" name="ts" value="{$payment.ts}"/>
<input type="hidden" name="client_ip" value="{$ctrl.ip}"/>
<input type="hidden" name="js" value="0"/>
</div>
{if not $payment.method}
<script type="text/javascript" src='https://secure.payu.com/paygw/UTF/js/{$payment.config.pos}/{$payment.config.key1|string_format:"%2s"}/template:3/ext_calc:0/paytype.js'></script>
<h3>Krok {$body.step}</h3>
<h3 class="payu_price">Platba: {$payment->order->getRemainingPayment()|format_price}</h3>
<div class="cleaner"></div>
<div id="payu"></div>
<script type='text/javascript'>
{literal}
$(function(){
var buff = "";
var old = document.write;
document.write = function()
{
for (i in arguments)
buff += arguments[i];
}
PlnPrintTemplate();
document.write = old;
$("#payu").html(buff);
$("input[name=js]").val("1");
});
{/literal}
</script>
<div class="block-submit" style="width:450px;margin-left:10px;">
<input type="submit" value="Zaplatit přes PayU.cz" class="button_red" style="float:left"/>
<p style="float:right">{*Message:*} {$body.message}</p>
</div>
{else}
<input type="hidden" name="pay_type_{$payment.method}" value="" />
<div>Přesměrovávám na platební bránu ...</div>
<noscript>
<div class="block-submit" style="width:450px;margin-left:10px;">
<input type="submit" value="Zaplatit přes PayU.cz" class="button_red" style="float:left"/>
</div>
</noscript>
{/if}
</form>
{if $payment.method}
{literal}
<script>
$("input[name=js]").val("1");
$("form[name=payform]").submit();
</script>
{/literal}
{/if}
<div class="cleaner"></div>
{else}
{* Other step, print message *}
{$body.message} <br>
{/if}
{else}
{* Error *}
Error: {$body.message} <br>
{/if}
{*
Payment: {$payment}*}
</div>
</div>
{/block}