generate_incomplete_transaction - get the redirects url for a payment gateway
As i written many times, Midrub is a CMS for business and my goal is to cover any kind of businesses. Any kind of businesses could have any kind of payments. For example someone wants a store, someone wants to rent something, someone wants to have subscribtions, someone wants to have a live platform where users in the chat will send money, someone wants a new payments gateway like PayPal or other kind, someone wants to have a classifieds website where clients will pay to promote their ads, etc. For all these purposes Midrub needs to provide a universal solution to help the businesses.
My way to solve this is the method generate_incomplete_transaction. This method is cool and could cover any situation and needs. In this method you will enter your parameters and it will provide a redirect link to wanted gateway. The parameters will allow to cover any kind of needs.
So let's take a look to the method generate_incomplete_transaction:
generate_incomplete_transaction(array( 'pay' => array(), 'options' => array(), 'fields' => array() ));
What means these parameters?
- pay - contains the amount with currency to pay.
- options - contains the options like if the user will be subscribed for recurring payments, if is one time payment, if the subscribe payment checkbox will be displayed, etc.
- fields - contains the transaction's details. In the administrator's panel you have the page with all transactions. You can see the details and with the fields you will show additional information in the transaction's details.
Each fields in the fields parameters have 3 sub-fields: label, slug and value. Another interesting use of the fields will for invoices. You will be able to create your invoices models and just add [field_slug] which will be replaced automatically. For example you want to show in invoices the user's address, you will create a field with user's address and just will add in your invoice the text [user_address].
I have idea how to use the generate_incomplete_transaction to cover all situations described above.
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
- delete_subscription - delete payments subscriptions
- How works the fields and options in the Midrub Payments system
- the_complete_transaction - provides a completed transaction
- save_complete_transaction - saves the complete transaction
- the_incomplete_transaction - get the transaction's information
- How to custom or change the payments gateway's icon
- set_gateway - register your payments gateway in the list