karla-react-native
v0.2.0
Published
Karla React Native SDK allows you to build smooth payment experiences with NFC and QR technology. With UI screens out-of-the-box to ensure the user has a pleasant experience while paying.
Downloads
7
Readme
Karla React Native SDK
The Karla React Native SDK allows you to build smooth payment experiences with NFC and QR technology. With UI screens out-of-the-box to ensure the user has a pleasant experience while paying.
Installation
npm install karla-react-native
Usage
// App.ts
import { KarlaUI } from 'karla-rn';
<KarlaUI
authToken="<YOUR_AUTH_TOKEN>" // Auth token would be provided by your application's backend to access Karla services as a partner
amount={AMOUNT_TO_BE_CHARGED}
merchantId="<YOUR_MERCHANT_ID>"
merchantName="<YOUR_MERCHANT_NAME>"
reference="<PAYMENT_REFERENCE>" // not required
extraData={EXTRA_DATA_TRANSMITTABLE_VIA_NFC} // JS Native Object prop
isNFCOnly="" // Boolean Prop to use only NFC payment option - other option is QR codes
isMerchant="" // Boolean to specify user type as merchant or customer - helps to specify who the data broadcaster is and who the data receiver is, among others
onPaymentSuccessful={(data: Object) => {
/**
* Callback is invoked if payment is successful,
* [data] card data is sent as a parameter
*/
}}
onCancelPayment={(reason: string) => {
/**
* Callback is invoked if payment is cancelled,
* Payment can be cancelled by a user or by system failure,
* [reason] tells why the payment was cancelled,
* "USER_CANCELLED" means cancellation was intended by user
*/
}}
/>;
License
MIT