1.0.0 • Published 5 months ago
globalpay-react-native v1.0.0
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
Prop | Type | Description | Required |
---|---|---|---|
**apiKey** | string | Your api key. | true |
Amount | number | The debit amount. | true |
MerchantTransactionReference | string | The merchant transaction reference. | true |
RedirectUrl | string | A redirect URL where we redirect your customers to after payment. | false |
FirstName | string | The customer's first name | true |
LastName | string | The customer's first name | true |
Currency | string | The currency e.g “NGN” | true |
Enviroment | string | The work mode or enviroment e.g “test” or “live”. Change it based on the enviroment | true |
Address | string | The customer's address | false |
EmailAddress | string | The customer's email address | true |
PhoneNumber | string | The customer's phone number | true |
onSuccess | function () => void | The onSuccess function will be invoked when a transaction is successful | true |
onFailure | function () => void | The onFailure function will be invoked when a transaction is failed or cancelled | true |
1.0.0
5 months ago