64 lines
1.6 KiB
PHP
64 lines
1.6 KiB
PHP
<?php
|
|
|
|
class cvIngImojeFrontendComponents extends sfComponents
|
|
{
|
|
|
|
public function executeShowPayment()
|
|
{
|
|
$this->smarty = new stSmarty('cvIngImojeFrontend');
|
|
|
|
$ing = new cvIngService();
|
|
$plugin = new cvIngPlugin();
|
|
|
|
$tl = new cvIngTranslationCfg();
|
|
$txt = $tl->getArray();
|
|
|
|
if(!isset($this->order)) {
|
|
$this->order = OrderPeer::retrieveByIdAndHashCode($this->getRequestParameter('id'), $this->getRequestParameter('hash_code'));
|
|
}
|
|
|
|
$this->smarty->assign('url', $ing->paymentUrl);
|
|
$this->smarty->assign('txt', $txt);
|
|
$this->smarty->assign('data', $ing->getTransactionData($this->order));
|
|
$this->smarty->assign('check_configuration', $plugin->checkPaymentConfiguration(1));
|
|
}
|
|
|
|
public function executeOrderSummary()
|
|
{
|
|
$id = $this->getRequestParameter('id');
|
|
$hash_code = $this->getRequestParameter('hash_code');
|
|
|
|
$order = OrderPeer::retrieveByIdAndHashCode($id, $hash_code);
|
|
if(!$order) {
|
|
return sfView::NONE;
|
|
}
|
|
|
|
$payment = $order->getOrderPayment();
|
|
if(!$payment) {
|
|
return sfView::NONE;
|
|
}
|
|
|
|
$typeModule = $payment->getPaymentType()->getModulename();
|
|
|
|
if(!in_array($typeModule, array(
|
|
'cvIngTwisto',
|
|
'cvIngImoje',
|
|
))) {
|
|
return sfView::NONE;
|
|
}
|
|
|
|
$this->smarty = new stSmarty('cvIngImojeFrontend');
|
|
$ing = new cvIngService();
|
|
$plugin = new cvIngPlugin();
|
|
$tl = new cvIngTranslationCfg();
|
|
$txt = $tl->getArray();
|
|
|
|
$this->smarty->assign('url', $ing->paymentUrl);
|
|
$this->smarty->assign('txt', $txt);
|
|
$this->smarty->assign('data', $ing->getTransactionData($order, $typeModule == 'cvIngTwisto'
|
|
? 1
|
|
: 0));
|
|
$this->smarty->assign('check_configuration', $plugin->checkPaymentConfiguration(1));
|
|
}
|
|
}
|