Handling careem pay button
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
import React from 'react'
import { createRoot } from 'react-dom/client'
import { CareemPay } from '@tap-payments/careem-pay-button-element'
const App = () => {
return (
<CareemPay
environment='sandbox'
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 />)
name | description |
---|---|
environment required - enum
|
add CareemPay environment and could be sandbox or production
|
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 |