public function test_convertLegacyOption_converts_two_options_specified_as_one()
 {
     $newOption = new PaymentOption();
     $newOption->setCallToActionText('Pay by bankwire')->setLogo('http://example.com/logo.png')->setAction('http://example.com/submit')->setForm(null)->setInputs(array('key' => 42));
     $singleLegacyOption = array('cta_text' => 'Pay by bankwire', 'logo' => 'http://example.com/logo.png', 'action' => 'http://example.com/submit', 'form' => null, 'inputs' => array('key' => 42));
     $legacyOption = array($singleLegacyOption, $singleLegacyOption);
     $this->assertEquals(array($newOption, $newOption), PaymentOption::convertLegacyOption($legacyOption));
 }
Пример #2
0
 public function hookPaymentOptions($params)
 {
     if (!$this->active) {
         return;
     }
     if (!$this->checkCurrency($params['cart'])) {
         return;
     }
     $this->context->smarty->assign($this->getTemplateVarInfos());
     $newOption = new PaymentOption();
     $newOption->setCallToActionText($this->trans('Pay by Bank BNI', array(), 'Modules.BankBNI.Shop'))->setAction($this->context->link->getModuleLink($this->name, 'validation', array(), true))->setAdditionalInformation($this->context->smarty->fetch('module:bankbni/views/templates/hook/intro.tpl'));
     $payment_options = [$newOption];
     return $payment_options;
 }
 public function hookPaymentOptions($params)
 {
     if (!$this->active) {
         return;
     }
     if (!$this->checkCurrency($params['cart'])) {
         return;
     }
     $this->smarty->assign($this->getTemplateVars());
     $newOption = new PaymentOption();
     $newOption->setCallToActionText($this->trans('Pay by Check', array(), 'Modules.CheckPayment.Admin'))->setAction($this->context->link->getModuleLink($this->name, 'validation', array(), true))->setAdditionalInformation($this->fetch('module:ps_checkpayment/views/templates/front/payment_infos.tpl'));
     return [$newOption];
 }
Пример #4
0
 public function getIframePaymentOption()
 {
     $iframeOption = new PaymentOption();
     $iframeOption->setCallToActionText($this->l('Pay iframe'))->setAdditionalInformation($this->context->smarty->fetch('module:paymentexample/views/templates/front/payment_infos.tpl'))->setLogo(Media::getMediaPath(_PS_MODULE_DIR_ . $this->name . '/payment.jpg'));
     return $iframeOption;
 }