public function renderCheckoutForm(Payment $payment, Order $order, $return = false) { $payler = new Payler($payment); $sessionId = $payler->getSessionId($order); if (!$sessionId) { Yii::app()->getUser()->setFlash(YFlashMessages::ERROR_MESSAGE, Yii::t('PaylerModule.payler', 'Payment by "{name}" is impossible', ['{name}' => $payment->name])); return false; } return Yii::app()->getController()->renderPartial('application.modules.payler.views.form', ['action' => $payler->getUrl('Pay'), 'sessionId' => $sessionId], $return); }
public function renderCheckoutForm(Payment $payment, Order $order, $return = false) { $payler = new Payler($payment); $sessionId = $payler->getSessionId($order); if (!$sessionId) { //Customer should know that something gone wrong return Yii::app()->getController()->renderPartial('application.modules.payler.views.form', ['action' => $payler->showError('Start Payment Session Fail'), 'sessionId' => $sessionId], $return); } return Yii::app()->getController()->renderPartial('application.modules.payler.views.form', ['action' => $payler->getUrl('Pay'), 'sessionId' => $sessionId], $return); }