1.0.0 • Published 5 months ago

globalpay-react-native v1.0.0

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

GlobalPay React-Native SDK 🛫

This sdk allows you to receive payment from your react-native mobile app using globalpay.

Please follow the instructions below.

Restore packages

npm install

### **Installation**

```typescript
npm install globalpay-react-native

Usage

Import the library and pass in the props.
Check below this document for more details on the props.

import GlobalPayRnSdk from 'globalpay-react-native';

<GlobalPayRnSdk
      apiKey=""
      Amount={300}
      MerchantTransactionReference="BGSDGHDKD637839"
      RedirectUrl="https://samuel-olu.web.app"
      FirstName="Lisa"
      LastName="Jerry"
      Currency="NGN"
      Enviroment="live"
      Address="string"
      EmailAddress="precious@gmail.com"
      PhoneNumber="0812346677"
      onSuccess={() => {
        console.log('Successful');
      }}
      onFailure={() => {
        console.log('Failed');
      }}
    />

Props

PropTypeDescriptionRequired
**apiKey**stringYour api key.true
AmountnumberThe debit amount.true
MerchantTransactionReferencestringThe merchant transaction reference.true
RedirectUrlstringA redirect URL where we redirect your customers to after payment.false
FirstNamestringThe customer's first nametrue
LastNamestringThe customer's first nametrue
CurrencystringThe currency e.g “NGN”true
EnviromentstringThe work mode or enviroment e.g “test” or “live”. Change it based on the enviromenttrue
AddressstringThe customer's addressfalse
EmailAddressstringThe customer's email addresstrue
PhoneNumberstringThe customer's phone numbertrue
onSuccessfunction  () => voidThe onSuccess function will be invoked when a transaction is successfultrue
onFailurefunction  () => voidThe onFailure function will be invoked when a transaction is failed or cancelledtrue