Files
grzanieplus.pl/plugins/stSantanderRatyPlugin/modules/stSantanderRatyFrontend/actions/actions.class.php
2025-03-12 17:06:23 +01:00

45 lines
1.8 KiB
PHP

<?php
class stSantanderRatyFrontendActions extends stActions
{
public function executeAccepted()
{
$this->smarty = new stSmarty('stSantanderRatyFrontend');
$this->smarty->assign('id_wniosku', $this->getRequestParameter('id_wniosku'));
}
public function executeCanceled()
{
$this->smarty = new stSmarty('stSantanderRatyFrontend');
}
public function executePay()
{
$smarty = new stSmarty('stSantanderRatyFrontend');
$paymentType = stPaymentType::get($this->getRequestParameter('type'));
$order = OrderPeer::retrieveByIdAndHashCode($this->getRequestParameter('order_id'), $this->getRequestParameter('order_hash'));
$totalQuantity = count($order->getOrderProducts());
if ($order->getOrderDelivery()->getCostBrutto(true) > 0)
{
$totalQuantity += 1;
}
$smarty->assign('order', $order);
$smarty->assign('order_total_amount', $order->getTotalAmountWithDelivery(true, true));
$smarty->assign('order_total_quantity', $totalQuantity);
$smarty->assign('payment_type', $order->getOrderPayment()->getPaymentType());
$smarty->assign('shop_number', stConfig::getInstance('stSantanderRatyBackend')->get('shop_number'));
$smarty->assign('order_delivery', $order->getOrderDelivery()->getName());
$smarty->assign('client', array(
'name' => $order->getOrderUserDataBilling()->getName(),
'surname' => $order->getOrderUserDataBilling()->getSurname(),
'email' => $order->getOptClientEmail(),
));
$smarty->assign('url_accepted', $paymentType->getReturnUrl($order).'?id=');
$smarty->assign('url_canceled', $paymentType->getReturnUrl($order).'?canceled=1&id=');
$this->smarty = $smarty;
}
}