Standard Integration For Collecting Payment
Learn how to use Json to make payment to Marasoft Pay https://checkout.marasoftpay.com/initiate_transaction
API
1. Collect Customer Information
To initialize the transaction, you'll need to pass information such as email, first name, last name amount, transaction reference, etc. Email and amount are required. You can also pass any other additional information in the metadata object field.
The customer information can be retrieved from your database, session or cookie if you already have it stored, or from a form like in the example below.
Param | Required? | Description |
---|---|---|
public_key | Yes | Your public key from MarasoftPay. Use test key for test mode and live key for live mode |
request_type | Yes | Your public key type from MarasoftPay. Use test for test mode and live for live mode |
merchant_tx_ref | Yes | The Merchant Transaction Reference is a unique reference generated by the merchant that enables them identify & track transactions internally. |
redirect_url | Yes | Setting it in the code allows you to be flexible with the redirect URL if you need to, where the redirected to after trasaction. |
name | No | Customer name |
email_address | Yes | Email address of customer |
phone_number | Yes | Phone number of customer |
amount | Yes | Amount (in the lowest currency value - kobo, pesewas or cent) you are debiting customer. Do not pass this if creating subscriptions. |
currency | Yes | Currency charge should be performed in. Allowed values are: NGN . It defaults to NGN. |
user_bear_charge | No | Set this to 'no' if you do not want the user to bear any charge on the transaction. Defaults to yes. |
preferred_payment_option | No | Use this to set a preferred payment option you want your customers to use. Values: transfer, card, ussd. |
description | No | Field containing the description you want recorded with the transaction. Fields within this key will show up on merchant receipt and within the transaction information on the Marasoft Dashboard. |
2. Post Data to API
To initialize the transaction, you'll need to pass information such as email, first name, last name amount, transaction reference, etc. Email and amount are required. You can also pass any other additional information in the metadata object field and post in the json format below.
POST
request to https://checkout.marasoftpay.com/initiate_transaction
from your server using your transaction reference.
3. Url Response
You will get a response with a url to be redirected to, preview the sample below.
4. Redirected to Check out Page
When the url is triggered, will redirect you to marasoft Pay Checkout Page.
Handling Webhooks
-
When a payment is successful, Marasoftpay sends a webhook event to webhook URL that
you provide. Learn more about using webhooks.