Payment Hook

public function hookPaymentOptions($params)
{
if (!$this->active) {
return;
}

$newOption = new PaymentOption();
$paymentForm = $this->fetch(‘module:’.$this->name.’/views/templates/hook/payment.tpl’);
$newOption->setCallToActionText($this->trans(‘ PAY ‘, array(), ‘Modules.MyModule.Shop’))
->setModuleName($this->name)
->setForm($paymentForm)
->setAdditionalInformation($paymentForm)
->setAction($this->context->link->getModuleLink($this->name, ‘xyz’,array(“confirmation”=>”1”), true));
return [$newOption];
}

 

Validation Process add in js or tpl file

<script type=”text/javascript”>
$( document ).ready(function() {

$(‘#payment-confirmation > .ps-shown-by-js > button’).click(function(e) {

var myPaymentMethodSelected = $(‘.payment-options’).find(“input[data-module-name=’xyz’]”).is(‘:checked’);

if (myPaymentMethodSelected)
{
//Validation Process
}

});

});
</script>

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...