Search for Resources and Solutions

save_complete_transaction - saves the complete transaction

save_complete_transaction is an important function in Midrub Payments, which marks as complete a transaction. This function should be present in your payments gateway.

How the function save_complete_transaction works?

  • First a theme's, app's or component's page will use the function generate_incomplete_transaction to generate an incomplete transaction.
  • In your payment gateway you have to use the function the_incomplete_transaction to register the incomplete transaction and to get the transaction with transaction's id.
  • And finally the save_complete_transaction function will use the transaction's id to mark it as complete.

The save_complete_transaction has these parameters:

  • $transaction_id - has the transaction's ID returned by the function the_incomplete_transaction.
  • $user_id - contains the current user's ID.
  • $args has 3 keys: net_id(if transaction is success, contains the transaction's ID provided by Gateway), gateway(could be slug or name of your gateway) and status(should be 1 or 2).



Was this article helpful?