Recurring billing
This shows you how to accept payments recurrently using rave.
Rave helps merchants collect payments recurringly, you can get started with a recurring payment following these steps:
-
Login into your rave dashboard, navigate to Collect payments.
-
Click on the create payment page button.
-
Select
recurringcharge in the modal that pops up. -
Configure the other required information. And share your recurring payment link to accept recurring charges.
Recurring charge using the javascript payment modal
-
Log into your dashboard, navigate to Collect payments.
-
Click on payment plan, and create a new payment plan.
-
Fill in the payment plan details and proceed.
-
Once the payment plan is created click on it to retrieve the
plan ID. -
Once you retrieve the plan ID see how to add it to your javascript snippet to accept recurring payments.
<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",
payment_method: "both",
txref: "rave-123456",
payment_plan: 13,
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>
payment_plan: You need to pass the ID of the payment plan using the steps described above.
Using the rave inline quick setup (embed code)
<form>
<a class="flwpug_getpaid"
data-PBFPubKey="FLWPUBK-24b72aebb821aea177483039677df9d3-X"
data-txref="rave-123456"
data-amount="2000"
data-customer_email="[email protected]"
data-currency="NGN"
data-pay_button_text="Pay Now"
data-country="NG"
data-redirect_url="https://your-website.com/urlredirect"
data-payment_plan="13"></a>
<script type="text/javascript" src="https://api.ravepay.co/flwv3-pug/getpaidx/api/flwpbf-inline.js"></script>
</form>
Recurring charge using rave's API
If you would like to make use of our APIs instead you can see how to get started on the Create Payment Plan page.
