Online Payment Module Architecture: Difference between revisions

Jump to navigation Jump to search
m
Tag: 2017 source edit
Tag: 2017 source edit
Line 46: Line 46:




The parameter are used by the page to find the amount to ask for the payment from the object retrieved in URL. Then the page search the list of all available payment mode and suggest them as a different button "Pay using MyPaymentMode".
The parameter are used by the page to find the amount to ask for the payment from the object retrieved in URL.  


To include your own payment method in this list, your module must implement the hook '''doAddButton''' for the context "newpayment". Your hook must return an  
Then the page search the list of all available payment mode by calling getValidOnlinePaymentMethods(). To complete this list to add your own module, you must implement the hook '''getValidPayment''' of the context '''nexpayment'''.
array('yourpaymentcode' => 'MyPaymentMode')
<syntaxHighlight>
$hookmanager->resarray = array('mypaymentcode => 'valid');
</syntaxHighlight>
 
Then for each entry found the page suggest the payment mode as a different button "Pay using MyPaymentMode". To output HTML code of your button, you must use the hook '''doAddButton''' for the context "newpayment". Your hook must return an  
<syntaxHighlight>
array('mypaymentcode' => 'MyPaymentMode')
</syntaxHighlight>


If you want you can also implement the hook '''checkStatus''' to retrieve information from your payment platform to show information on the payment page.
If you want you can also implement the hook '''checkStatus''' to retrieve information from your payment platform to show information on the payment page.

Navigation menu