Dynamic Accounts
Dynamic accounts are accounts are temporary accounts that are used for one time payments. The accounts are tied to a specific amount to be paid and an account name. Transactions also have a unique payment reference which can be used for tracking.
How to integrate
This integration requires you to send a post request with the required data to the endpoint https://api.marasoftpay.live/generate_dynamic_account/ the response will be a data object with account details to make the payment to.
Usage
Required Parameters
Parameter | Required? | Description |
---|---|---|
enc_key | Yes | Your encryption key from MarasoftPay. Get it from your dashboard |
amount | Yes | Amount to be paid |
transaction_ref | Yes | A unique reference code to identify the transfer. |
Request Sample
<?php
$enc_key = "your encryption key";
$transaction_ref = $_POST['transactionRef'];
$amount = $_POST['amount'];
$url = "https://api.marasoftpay.live/generate_dynamic_account/";
$curl = curl_init($url);
curl_setopt($curl,CURLOPT_URL,$url);
curl_setopt($curl,CURLOPT_POST,true);
curl_setopt($curl,CURLOPT_RETURNTRANSFER,true);
$headers = array (
"Content-Type: application/x-www-form-urlencoded",
);
curl_setopt($curl,CURLOPT_HTTPHEADER,$headers);
$data = "amount=$amount&transactionRef=$transaction_ref&enc_key=$enc_key";
curl_setopt($curl,CURLOPT_POSTFIELDS,$data);
echo $resp = curl_exec($curl);
curl_close($curl);
router.get("/generate-dynamic-account", (req,res) => {
const enc_key = "your encryption key";
const amount = "amount";
const transaction_ref = "transaction reference";
const data = { enc_key, amount, transaction_ref };
const url = "https://api.marasoftpay.live/generate_dynamic_account/";
axios
.post(url,data)
.then((response) => {
console.log(response);
})
.catch((error)=>{
console.log(error);
})
})
Response Sample
{
"status":true,
"amount_to_pay": 1150,
"account_number":"8021353735",
"account_name":"Owolana Ayomide",
"bank_name":"Wema Bank"
}
Important notes
1. Once payment is confirmed for a dynamic account it can no longer be used.
Webhooks for dynamic account transactions are sent to your collections webhook url.
2. Dynamic account transactions can be viewed from the dashboard