@tap-payments/careem-pay-button-element
v0.0.4
Published
just for wrapping careem pay button to be used in react
Downloads
54
Maintainers
Keywords
Readme
@tap-payments/careem-pay-button-element
Handling careem 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/careem-pay-button-element
---------------------------- OR -------------------------
yarn add @tap-payments/careem-pay-button-element
Examples
ES6
import React from 'react'
import { createRoot } from 'react-dom/client'
import { CareemPay } from '@tap-payments/careem-pay-button-element'
const App = () => {
return (
<CareemPay
className='class'
style={{ color: 'inherit' }}
onPrepareRequestData={()=>({ inoviceId:'0000', orderId:'0000' })}
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 |
| --------------------------------------- | ----------------------------------------------------------------------------------------- |
| hideHint optional
- boolean
| flag to hide the hint that appear under CareemPay button |
| className optional
- string
| styling CareemPay button with classname |
| style optional
- CSSProperties
| styling careem pay button with style |
| onSuccess optional
- fun
| callback fun will run after getting a success response |
| onPrepareRequestData required
- fun
| callback fun will run after click pay button and getting careem pay configurations object |
| 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 careem pay popup |