International Payments

How to accept payments in multi currencies on rave

Rave allows merchants and businesses accept payments globally. The table below shows the countries to be passed when collecting different currencies:

CurrencyCountry
GHSGH
KES (Card & Mpesa payments)KE
ZARZA
TZSTZ
All other currenciesNG
switch (currency) {
            case 'KES':
             country = 'KE';
              break;
            case 'GHS':
              country = 'GH';
              break;
            case 'ZAR':
              country = 'ZA';
              break;
            case 'TZS':
              country = 'TZ';
              break;
            
            default:
              country = 'NG';
              break;
        }

📘

Changing currency on the getpaidSetup

to accept payments in the available currency on the getpaidSetup function you would need to pass the currency and respective country you want to accept in, e.g. currency: "KES", country: "KE". If currency & country is not passed it defaults to NGN and NG respectively.

Using the rave inline to accept payments in other available currencies

<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",// An Mpesa mobile number is required when collecting Mpesa payment.
            currency: "KES",
            country: "KE",
            txref: "rave-123456",
            meta: [{
                metaname: "flightID",
                metavalue: "AP1234"
            }],
            onclose: function() {},
            callback: function(response) {
                var txref = response.data.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.data.chargeResponseCode == "00" ||
                    response.data.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>
<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",// A Ghana mobile number is required when collecting mobile money payment.
            currency: "GHS",
            country: "GH",
            txref: "rave-123456",
            meta: [{
                metaname: "flightID",
                metavalue: "AP1234"
            }],
            onclose: function() {},
            callback: function(response) {
                var txref = response.data.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.data.chargeResponseCode == "00" ||
                    response.data.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>
<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: "USD",
            country: "NG", // GH can also be passed as country, only country options to pass are NG and GH.
            txref: "rave-123456",
            meta: [{
                metaname: "flightID",
                metavalue: "AP1234"
            }],
            onclose: function() {},
            callback: function(response) {
                var txref = response.data.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.data.chargeResponseCode == "00" ||
                    response.data.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>
<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: "GBP",
            country: "NG",
            txref: "rave-123456",
            meta: [{
                metaname: "flightID",
                metavalue: "AP1234"
            }],
            onclose: function() {},
            callback: function(response) {
                var txref = response.data.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.data.chargeResponseCode == "00" ||
                    response.data.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>
<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: "EUR",
            country: "NG",
            txref: "rave-123456",
            meta: [{
                metaname: "flightID",
                metavalue: "AP1234"
            }],
            onclose: function() {},
            callback: function(response) {
                var txref = response.data.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.data.chargeResponseCode == "00" ||
                    response.data.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>
<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: "ZAR",
            country: "ZA",
            txref: "rave-123456",
            meta: [{
                metaname: "flightID",
                metavalue: "AP1234"
            }],
            onclose: function() {},
            callback: function(response) {
                var txref = response.data.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.data.chargeResponseCode == "00" ||
                    response.data.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>
<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",// An Mpesa mobile number is required when collecting Mpesa payment.
            currency: "UGX",
            country: "NG",
            txref: "rave-123456",
            meta: [{
                metaname: "flightID",
                metavalue: "AP1234"
            }],
            onclose: function() {},
            callback: function(response) {
                var txref = response.data.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.data.chargeResponseCode == "00" ||
                    response.data.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>
<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",// An Mpesa mobile number is required when collecting Mpesa payment.
            currency: "TZS",
            country: "TZ",
            txref: "rave-123456",
            meta: [{
                metaname: "flightID",
                metavalue: "AP1234"
            }],
            onclose: function() {},
            callback: function(response) {
                var txref = response.data.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.data.chargeResponseCode == "00" ||
                    response.data.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>

Using the rave inline quick setup (embed code) to accept payments in other available currencies

<form>
  <a class="flwpug_getpaid" 
  data-PBFPubKey="FLWPUBK-24b72aebb821aea177483039677df9d3-X" 
  data-txref="rave-123456" 
  data-amount="2000" 
  data-customer_email="[email protected]" 
  data-customer_phonenumber="2549803039939" 
  data-currency="KES" 
  data-country="KE" 
  data-redirect_url="https://your-website.com/urlredirect"></a>

  <script type="text/javascript" src="https://api.ravepay.co/flwv3-pug/getpaidx/api/flwpbf-inline.js"></script>
</form>
<form>
  <a class="flwpug_getpaid" 
  data-PBFPubKey="FLWPUBK-24b72aebb821aea177483039677df9d3-X" 
  data-txref="rave-123456" 
  data-amount="2000" 
  data-customer_email="[email protected]" 
  data-customer_phonenumber="057982829" 
  data-currency="GHS" 
  data-country="GH" 
  data-redirect_url="https://your-website.com/urlredirect"></a>

  <script type="text/javascript" src="https://api.ravepay.co/flwv3-pug/getpaidx/api/flwpbf-inline.js"></script>
</form>
<form>
  <a class="flwpug_getpaid" 
  data-PBFPubKey="FLWPUBK-24b72aebb821aea177483039677df9d3-X" 
  data-txref="rave-123456" 
  data-amount="2000" 
  data-customer_email="[email protected]" 
  data-customer_phonenumber="2549803039939"
  data-currency="USD" 
  data-country="NG" 
  data-redirect_url="https://your-website.com/urlredirect"></a>

  <script type="text/javascript" src="https://api.ravepay.co/flwv3-pug/getpaidx/api/flwpbf-inline.js"></script>
</form>
<form>
  <a class="flwpug_getpaid" 
  data-PBFPubKey="FLWPUBK-24b72aebb821aea177483039677df9d3-X" 
  data-txref="rave-123456" 
  data-amount="2000" 
  data-customer_email="[email protected]" 
  data-customer_phonenumber="2549803039939"
  data-currency="GBP" 
  data-country="NG" 
  data-redirect_url="https://your-website.com/urlredirect"></a>

  <script type="text/javascript" src="https://api.ravepay.co/flwv3-pug/getpaidx/api/flwpbf-inline.js"></script>
</form>
<form>
  <a class="flwpug_getpaid" 
  data-PBFPubKey="FLWPUBK-24b72aebb821aea177483039677df9d3-X" 
  data-txref="rave-123456" 
  data-amount="2000" 
  data-customer_email="[email protected]" 
  data-customer_phonenumber="2549803039939"
  data-currency="EUR" 
  data-country="NG" 
  data-redirect_url="https://your-website.com/urlredirect"></a>

  <script type="text/javascript" src="https://api.ravepay.co/flwv3-pug/getpaidx/api/flwpbf-inline.js"></script>
</form>
<form>
  <a class="flwpug_getpaid" 
  data-PBFPubKey="FLWPUBK-24b72aebb821aea177483039677df9d3-X" 
  data-txref="rave-123456" 
  data-amount="2000" 
  data-customer_email="[email protected]" 
  data-customer_phonenumber="2549803039939"
  data-currency="ZAR" 
  data-country="ZA" 
  data-redirect_url="https://your-website.com/urlredirect"></a>

  <script type="text/javascript" src="https://api.ravepay.co/flwv3-pug/getpaidx/api/flwpbf-inline.js"></script>
</form>

Next Steps

Congratulations! you can now accept payments internationally, you would need to verify the transaction before giving value to your customer.