Benefit Pay

The popular mobile application in Bahrain that allows users to pay for various services and products using their smartphones. It's a convenient and secure way to make payments without cash or physical cards. BenefitPay can be used to pay bills, groceries, fuel and more at participating merchants in Bahrain.

This guide streamlines the process of accepting transactions on your website in Bahrain. In this guide, we will walk through the steps to implement, configure, and use Tap Payment’s BenefitPay effectively in React & Vanilla JS.

🚧

BenefitPay payment method accepts the BHD currency only. As of now, it doesn't support authorization.

Pre-requisites:

  • Download the updated tap's BenefitPay Package from our NPM repository. BenefitPay Package
  • Node.js and npm must be installed on your deployment environment.
  • You are subscribed with Tap Payments.
  • API credentials, including a public test key.

Have a Quick Demo to see the expected outcomes of BenefitPay SDK.


📘

Bear in mind, the implementation of Benefit Pay results as a front kit on the host solution. Remember to refer to the recommended integration flow to fully initiate a transaction using Benefit Pay.

How to initiate a charge API

Install

This is a React module available through the npm registry. Installation is done using the npm install command:

npm install @tap-payments/benefit-pay-button

OR

yarn add @tap-payments/benefit-pay-button

Configurations

NameTypeR/ODescription
operatorobjectRequiredThe operator object that contains the public key + hashString
operator.publicKeystringRequiredThe public key provided by Tap
operator.hashStringstringOptionalThe hash string can be set it to secure your transaction
environmentstringRequiredThe environment of the SDK and it can be one of these environments: [Development, Live]
debugboolOptionalTo enable the debug mode
merchantobjectRequiredThe merchant object that contains the merchant identifier
merchant.idstringRequiredThe merchant identifier provided by Tap
transactionobjectRequiredThe transaction object that contains the amount and currency
transaction.amountstringRequiredThe amount to be charged
transaction.currencystringRequiredThe currency of the amount
customerobjectOptionalThe customer object that contains the customer details
customer.idobjectOptionalThe customer ID
customer.namesarrayOptionalThe customer names and it can be one of these values: [EN, AR]
customer.names[idx].langstringRequiredThe customer name language and it can be one of these values: [EN, AR]
customer.names[idx].firststringRequiredThe customer first name
customer.names[idx].laststringRequiredThe customer last name
customer.names[idx].middlestringOptionalThe customer middle name
customer.contactobjectOptionalThe customer contact object that contains the email and phone number
customer.contact.emailstringOptionalThe customer email
customer.contact.phoneobjectOptionalThe customer phone object that contains the country code and number
customer.contact.phone.countryCodestringRequiredThe customer country code
customer.contact.phone.numberstringRequiredThe customer phone number
interfaceobjectOptionalThe interface object that contains the locale and edges
interface.localestringOptionalThe locale of the Apple Pay button and it can be one of these locales: [EN, AR]
interface.edgesstringOptionalThe border of the button and it can be one of these values: [CURVED, STRAIGHT]
onReadyfuncOptionalA callback function that will be called when the button becomes ready
onClickfuncOptionalA callback function that will be called when the button is clicked
onCancelfuncOptionalA callback function that will be called when you cancel the payment
onErrorfuncOptionalA callback function that will be called when you encounter an error
onSuccessfuncOptionalA callback function that will be called after successfully completing the payment