Search code examples
phpapipayment-gatewayflutterwave

Integrate rave flutterwave api in php


hello I am using core PHP in client Project, I need to integrate rave flutter wave API, I have searched a lot of links now I am checking this URL here but not getting a good result, so please help me in rave flutter wave "Nigeria payment gateway" API in PHP


Solution

  • Our Product for collections is called Rave, please follow the steps below to get started:

    1. Sign up https://ravepay.co/ , for a sanbox account sign up on http://rave.frontendpwc.com

    2. Add a settlement account on sign up

    3. Select a settlement preference by navigating to Account settings > Settlement preference (Find documentation attached for more detailed instruction).

    4. Documentation for developers: https://flutterwavedevelopers.readme.io/v1.0

    Pay Now
    
    document.addEventListener("DOMContentLoaded", function(event) {
        document.getElementById("submit").addEventListener("click", function() {
         
        var chargeResponse = "",
            trxref = "FDKHGK" + Math.random(),// add your transaction ref here
            pubkey = "XXXX"; // Add public keys generated on your dashboard here
          getpaidSetup({
            customer_email: "xxxxx",// 
            amount: 1000,
            currency: "NGN",
            country: "NG",
            custom_logo: "http://imgur.com/uuRnkV9",
            custom_description:"",
            custom_title: "The Start",
            txref: trxref,
            PBFPubKey: pubkey,
            onclose: function(response) {},
            callback: function(response) {
              //flw_ref = response.tx.flwRef;
              console.log("This is the response returned after a charge", response);
              if(response.tx.chargeResponse =='00' || response.tx.chargeResponse == '0') {
                // redirect to a success page
              } else {
                // redirect to a failure page.
              }
            }
          });
        });
      });

    If you have any issues at any point, please let us know and we will help sort you out.