Split Payment

This shows you how to split a payment into multiple quidpay subaccounts.

Quidpay's split payment feature allows you split a transaction between two (2) or more accounts and collect fees on the transaction. This feature is great for marketplace owners who help facilitate services for merchants and collect a commission as revenue.

Quidpay can automatically split the settlement such that the vendor's account is credited and the platform owner gets his own commission credited as well.

When using this feature the marketplace owner is responsible for vetting the merchant's signed up under their marketplace, this means that disputes and chargebacks would be logged against the marketplace owner.

We would show you how to create subaccounts on the quidpay dashboard and how you can collect payments on behalf of these subaccounts.

πŸ“˜

Subaccount Account Numbers on Test environment

When setting up a subaccount, you would need to use test account numbers in the test environment.

Make use of account numbers within the range 0690000021 - 0690000041
Bank: 044 (Access bank).

How to create subaccounts

On quidpay you can create subaccounts using two methods a.) create the subaccount on the dashboard b.) create the subaccount using our APIs.

We would show you how to use the first option below, to see how to create subaccounts via APIs visit the API documentation section.

Create a subaccount

1873 1876 1874

When you create a subaccount you would be using the subaccount ID to help the subaccount collect payments.

See how to do that via the quidpay inline JS below.

<form>
    <script src="https://api.ravepay.co/flwv3-pug/getpaidx/api/flwpbf-inline.js"></script>
    <button type="button" onClick="payWithRave()">Pay Now</button>
</form>

<script>
    const API_publicKey = "<ADD YOUR PUBLIC KEY HERE>";

    function payWithRave() {
        var x = getpaidSetup({
            PBFPubKey: API_publicKey,
            customer_email: "[email protected]",
            amount: 2000,
            currency: "NGN",
            txref: "quidpay-123456",
            subaccounts: [
              {
                id: "RS_D87A9EE339AE28BFA2AE86041C6DE70E",
		            transaction_split_ratio:"2"
              },
              
              {
                id: "RS_344DD49DB5D471EF565C897ECD67CD95",
                transaction_split_ratio:"3"
              },
              
              {
                id: "RS_839AC07C3450A65004A0E11B83E22CA9",
                transaction_split_ratio:"5"
              }
            ],
            meta: [{
                metaname: "flightID",
                metavalue: "AP1234"
            }],
            onclose: function() {},
            callback: function(response) {
                var txref = response.tx.txRef; // collect flwRef returned and pass to a 					server page to complete status check.
                console.log("This is the response returned after a charge", response);
                if (
                    response.tx.chargeResponseCode == "00" ||
                    response.tx.chargeResponseCode == "0"
                ) {
                    // redirect to a success page
                } else {
                    // redirect to a failure page.
                }

                x.close(); // use this to close the modal immediately after payment.
            }
        });
    }
</script>

The subaccounts are passed to the inline as an array of objects. This means you can split payment between more than one vendor and determine the split ratio e.g. if you are splitting the money between 3 vendors and you don't want them to all get equal amounts you can apply a split ratio e.g. 2:3:5 this split example also means you are splitting the money as 20%, 30%, 50% accordingly. This means the first vendor would get (2/(2+3+5) x (total amount - quidpay fees + merchant commission)) and vice versa for the other vendors.

The subaccounts are created under your account and funds collected for them would be settled into the provided settlement account based on the settlement cycle.

🚧

Using percentages as transaction charges

When setting up your transaction_charge_type value as a percentage, you would need to add the percentage value i.e. transaction_charge in decimal. e.g. transaction_charge: 0.09 is equal to a 9% commission on transactions.

<form>
    <script src="https://api.ravepay.co/flwv3-pug/getpaidx/api/flwpbf-inline.js"></script>
    <button type="button" onClick="payWithRave()">Pay Now</button>
</form>

<script>
    const API_publicKey = "<ADD YOUR PUBLIC KEY HERE>";

    function payWithRave() {
        var x = getpaidSetup({
            PBFPubKey: API_publicKey,
            customer_email: "[email protected]",
            amount: 20000,
            currency: "NGN",
            txref: "quidpay-123456",
            subaccounts: [
              {
                id: "RS_D87A9EE339AE28BFA2AE86041C6DE70E",
		            transaction_split_ratio:"2",
                transaction_charge_type: "flat",
                transaction_charge: "100"
              },
              
              {
                id: "RS_344DD49DB5D471EF565C897ECD67CD95",
                transaction_split_ratio:"3",
                transaction_charge_type: "flat",
                transaction_charge: "100"
              },
              
              {
                id: "RS_839AC07C3450A65004A0E11B83E22CA9",
                transaction_split_ratio:"5",
                transaction_charge_type: "flat",
                transaction_charge: "100"
              }
            ],
            meta: [{
                metaname: "flightID",
                metavalue: "AP1234"
            }],
            onclose: function() {},
            callback: function(response) {
                var txref = response.tx.txRef; // collect flwRef returned and pass to a 					server page to complete status check.
                console.log("This is the response returned after a charge", response);
                if (
                    response.tx.chargeResponseCode == "00" ||
                    response.tx.chargeResponseCode == "0"
                ) {
                    // redirect to a success page
                } else {
                    // redirect to a failure page.
                }

                x.close(); // use this to close the modal immediately after payment.
            }
        });
    }
</script>

From the example above, the marketplace owner would earn an N300 commission, quidpay would take it's configured fee then the remaining amount would be split between the 3 vendors.