Pay with barter

Adding barter as a payment method to provide one-click payment to customers

Barter helps you set up one-click payments for your customers. This drives your payment conversion rates up and improves the speed with your customer's checkout and purchase items.

See how to embed the pay with barter option on your site or e-commerce store using the Rave InlineJS.

1. Pay with barter using Rave Inline JS

You can embed the pay with barter option on your store using the Rave Inline JS Script as shown 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 = "FLWPUBK-24b72aebb821aea177483039677df9d3-X";

    function payWithRave() {
        var x = getpaidSetup({
            PBFPubKey: API_publicKey,
            customer_email: "[email protected]",
            amount: 2000,
            customer_phone: "234099940409",
            currency: "NGN",
            redirect_url: "https://your-website.com/",
            payment_options: "barter",
            txref: "rave-123456",
            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>

When your customer completes a payment with this method, they get an instant cashback reward powered by Flutterwave, this helps drive conversion, and the checkout flow only requires they input their number and barter PIN for existing users.