Using BoltPay Inline

Find out how to add BoltPay Inline to your website

Base URLs

BoltPay Inline Example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<button type="button" onclick="getpaid();">Pay Now</button>
<script type="text/javascript" src="{{base_url}}/bp-inline.js"></script>
<script type="text/javascript">
function getpaid(){
const public_key = "XXXXX";
const reference = "BP_PB_TRANSACTIONS_" + Math.random();
boltpaySetup({
bp_public_key: public_key,
txref: reference,
customer_email: "example@domain.com",
customer_phone: "15551234567",
customer_firstname: "Example",
customer_lastname: "User",
amount: 100, //amount in cents, ergo 100 equals 1 USD
currency: "USD",
callback: function(response) {
const transaction_reference = response.transaction_information.data.transaction_reference;
const transaction_response_code = response.transaction_information.data.responsecode;
if (transaction_response_code == "00") {
// Redirect to success page
} else {
// Redirect to failure page
}
}
});
}
</script>

After the end user has entered their card details, their card would get validated and a reponse object would be returned.

Parameter Reference

Parameter NameRequiredDescription
bp_public_keyYesYour public key as visible on your dashboard
txrefYesA unique transaction reference
amountYesAmount to charge in cents e.g. to charge 10 USD, enter 1000
customer_emailYesCustomer email address
customer_phoneYesCustomer phone number with "+" and country code
customer_firstnameYesCustomer first name
customer_lastnameYesCustomer last name
currencyYesCurrency to charge
callback: function(response)No. Recommended.A function to be called on successful card charge. Users can be redirected to the appropriate page supplied by the merchant here based on response object.
onclose: function()No. Recommended.A function to be called when the pay modal is closed.
custom_titleNo. Recommended.Text to be displayed as the title of the payment modal.
custom_descriptionNo. Recommended.A custom description to be displayed on the popup modal
custom_logoNo.An image URL, usually a logo so customers know who they are paying.
billing_address_lineoneNo. Recommended for better fraud screening checks.Billing address line one
billing_address_linetwoNo.Billing address line two, if any
billing_cityNo. Recommended for better fraud screening checks.Billing city
billing_stateNo. Recommended for better fraud screening checks.Billing state, province or county
billing_zipNo. Recommended for better fraud screening checks.Billing ZIP or Post code
cycleNo.For recurrent payments. Accepted values are daily, weekly, monthly, quarterly, and yearly. This can and should be used for recurrent billing and / or subscriptions.

Content

  • Getting started
  • Base URLs
  • BoltPay Inline Example
  • Parameter Reference
  • Still questions?