xpresspayonline-react-native

xpresspayonline react native plugin

Usage no npm install needed!

<script type="module">
  import xpresspayonlineReactNative from 'https://cdn.skypack.dev/xpresspayonline-react-native';
</script>

README

README

Requirements
Nodejs React-native React-native-webview

What is this repository for?

How do I get set up?

  • npm install xpresspayonline-react-native
  • Or
  • yarn add xpresspayonline-react-native

run

Who do I talk to?

  • applicationsupport@xpresspayments.com

  • Example ussage

import { StatusBar } from 'expo-status-bar'; import React from 'react'; import { StyleSheet, Text, View } from 'react-native'; import * as PayWithXpresspayOnline from 'xpresspayonline-react-native';

export default function App() {

const options = { "publicKey": “Your public key” here, "logoURL": "", "transactionId": “Your Transaction Id here”, "amount": 100, "currency": "NGN", "country": "NG", "email": “aminu.kabunu@gmail.com”, "phoneNumber": "07063703099", "firstName": "Aminu", "lastName": "Cincin", "hash": "", "meta": [{ "metaName": "DSTV NUMBER", "metaValue": "075632145555” }], "callbackUrl”:”www.example.com/callback“, "env": "LIVE" }

function handleOnRedirect(data) { if(data['status-code'] === '11') { alert('payment cancelled'); } if(data['status-code'] === '08') { alert('payment processing'); //requery the transaction with the requery endpoins as in the docs. https://docs.xpresspayonline.com/docs/re-query-payment } if(data['status-code'] === '099' || data['status-code'] === '098') { alert('payment failed'); //requery the transaction with the requery endpoins as in the docs. https://docs.xpresspayonline.com/docs/re-query-payment }

} return ( Should load the xpresspayonline payment gatewat shortly ... ); } const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: '#fff', alignItems: 'center', justifyContent: 'center', }, });