0.2.0 • Published 5 months ago

karla-react-native v0.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

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

0.2.0

5 months ago

0.1.9

5 months ago

0.1.8

6 months ago

0.1.7

6 months ago

0.1.6

6 months ago

0.1.5

6 months ago

0.1.4

6 months ago

0.1.3

6 months ago

0.1.2

6 months ago

0.1.1

6 months ago

0.1.0

6 months ago

0.0.4

6 months ago

0.0.3

6 months ago

0.0.2

6 months ago

0.0.1

6 months ago