How works the fields and options in the Midrub Payments system
I had to invent a new payment system in Midrub which is original and can be used for any purposes. This was important for Midrub, which is a CMS for business and you will decide what kind of business you will start with it.
My original idea is based one 4 functions:
- generate_incomplete_transaction - https://www.midrub.com/articles/generate-incomplete-transaction-get-the-redirects-url-for-a-payment-gateway
- the_incomplete_transaction - https://www.midrub.com/articles/the-incomplete-transaction-get-the-transactions-information
- save_complete_transaction - https://www.midrub.com/articles/save-complete-transaction-saves-the-complete-transaction
- the_complete_transaction - https://www.midrub.com/articles/the-complete-transaction-provides-a-completed-transaction
The function generate_incomplete_transaction has optional keys: fields and options(which has as value an array). The fields were invented to be used in invoices and other locations where will be displayed the text information. Both fields and options can be seen in the Admin Panel -> Transaction -> Any Transaction. A field could be for example the user's address.
The options are more important because them will allow to decide what to display in your Payments Gateway. For example you want to show recurring option, or save the cred card data or other kind of option. But i will use them to allow you to create different kind of periods per plan: 60 days, 90 days, 6 months, etc.
The fields and options added as parameter in the function generate_incomplete_transaction will be possible to use even in the_incomplete_transaction, save_complete_transaction and the_complete_transaction.
Suggested Articles
- How works the plans subscriptions in Midrub
- How to create new placeholders for an invoice's template
- Please don't ask me to add new payments gateways
- How works the fields and options in the Midrub Payments system
- How to custom or change the payments gateway's icon
- How and where to use a payments gateway library
- Add a view file to your Payments gateway
- set_js_urls - add js links for payment gateways
- set_css_urls - add styles links in a payment gateway
- set_the_title for payments gateway