@tap-payments/benefit-pay-button-element
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

@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

Dependencies (3)

Dev Dependencies (41)

Package Sidebar

Install

npm i @tap-payments/benefit-pay-button-element

Weekly Downloads

78

Version

0.0.2

License

ISC

Unpacked Size

11.9 kB

Total Files

15

Last publish

Collaborators

  • a.safwat-tap
  • sherifashraftap
  • mostafaabobakr.tap
  • i.mousa
  • mahmoudallam
  • aya_tap
  • mud_fahmi
  • ahmedkaram-tap
  • haitham-tap
  • muhammadazhar007
  • elsharkawy
  • waqast
  • hala.q
  • reham_alsabbagh
  • kalpanatap
  • sadbarkhattak