API Flow


In SecretPay you are interacting with Transaction and Collection.

A Collection is a set of Transactions. The relationship is, Collection has many Transactions. You can choose to create a Collection either from API or within your SecretPay's dashboard. An example of Collection would be something like Tuition Fee for June 2015, Donation for Earthquake, Ticket Payment, and many more.

A Transaction represents the promise made to you by your customer. It's an invoice for your customer. A Transaction must belong to a Collection. To start using the API, you would have to create a Collection. Then the payment flow will kick in as per below:

Normal Completion Flow

  1. Customer visits your site.
  2. Customer chooses to make payment.
  3. Your site creates a Transaction via API call.
  4. SecretPay API returns Transaction's URL.
  5. Your site redirects the customer to Transaction's URL
  6. The customer makes payment via payment option of choice.
  7. SecretPay sends a server-side update to your site upon payment failure or success(Basic Callback URL / X Signature Callback URL depending on your configuration) [your backend server should capture the transaction update at this point] refer to X Signature Callback Url.
  8. SecretPay redirects (Payment Completion) the customer back to your site if redirect_url is not empty (Basic Redirect URL / X Signature Redirect URL depending on your configuration) [your server should capture the transaction update at this point and give your user an instant reflection on the page loaded] refer to X Signature Redirect Url or, The customer will see SecretPay receipt if redirect_url is not present.

Updated over 0 months Ago