Web Payment Collections - Inline Integration
To utilize this approach, you'll need to incorporate a basic HTML form on your website. Once the form is submitted with all the necessary parameters, a transaction is initaited and the user is directed to the checkout page to complete the payment.
How to integrate
This integration can be completed in 3 easy steps:
1. Copy the code from the code example section below and paste in a html page on your website
2. Get your public_key from your Marasoft Pay dashboard and use it as the value of the public_key input
3. Input other required data such as Email, phone number, amount, currency etc
4. Set the value of the request_type input to "test" for testing and "live" for making real transactions that would reflect on your dashboard
5. Submit the form and make a payment
Usage
Required Parameters
Parameter | 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 | Use test for test mode and live for live mode |
merchant_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. This is where the customer is redirected to after the transaction is completed. |
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 skip this when creating subscriptions. |
currency | Yes | Currency charge should be performed in. Allowed values are: NGN and KSH It defaults to NGN. |
user_bear_charge | No | "yes" if you want the user to pay the charges or "no" if you want the charges to be deducted from the amount paid |
description | No | Field containing the description you want recorded with the transaction. |
webhook_url | No | Field containing the custom webhook url to send notification for this transaction to. |
preferred_payment_option | No | Field containing the default payment option to be offered to your users. |
Code Sample
< form action="https://checkout.marasoftpay.live/" method="POST" >
< input type="hidden" name="public_key" value="MSFT_********************" >
< input type="hidden" name="merchant_ref" value="****************" >
< input type="hidden" name="email_address" value="emailaddress@gmail.com" >
< input type="hidden" name="name" value="John Doe" >
< input type="hidden" name="phone_number" value="+234*********" >
< input type="hidden" name="request_type" value="test" >
< input type="hidden" name="description" value="Money for Toys" >
< input type="hidden" name="currency" value="NGN" >
< input type="hidden" name="redirect_url" value="https://www.google.com" >
< input type="hidden" name="user_bear_charge" value="yes" >
</form>
Handling Webhooks
After a payment has been successfully processed, Marasoft Pay will send a webhook notification to the URL that you specify. For more information on how to utilize webhooks, please refer Webhooks section of this documentation