@tap-payments/benefit-pay-button-element
v0.0.2
Published
just for wrapping benefit pay button to be used in react
Downloads
528
Maintainers
Keywords
Readme
@tap-payments/benefit-pay-button-element
Handling benefit pay button
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-element
---------------------------- OR -------------------------
yarn add @tap-payments/benefit-pay-button-element
Examples
ES6
import React from 'react'
import { createRoot } from 'react-dom/client'
import { BenefitPay } from '@tap-payments/benefit-pay-button-element'
const App = () => {
return (
<BenefitPay
className='class'
style={{ color: 'inherit' }}
requestData={{
merchantId: '00000101',
transactionAmount: '10.000',
transactionCurrency: 'BHD',
hashedString: 'xxxxxxxxxxxxxxxxxx',
appId: '4530082749',
referenceNumber: '20191723',
showResult: '0',
hideMobileQR: '0'
}}
onSuccess={(response) => {
console.log('onSuccess', response)
}}
onError={(error) => {
console.log('onError', error)
}}
onClosed={() => {
console.log('onClosed')
}}
/>
)
}
const root = createRoot(document.getElementById('root')!)
root.render(<App />)
Properties
| name | description |
| ---------------------------------- | ------------------------------------------------------ |
| className optional
- string
| styling BenefitPay button with classname |
| style optional
- CSSProperties
| styling benefit pay button with style |
| requestData required
- object
| request info that required by benefit pay library |
| onSuccess optional
- fun
| callback fun will run after getting a success response |
| onError optional
- fun
| callback fun will run after getting an error |
| onClosed optional
- fun
| callback fun will run after closing benefit pay popup |