Louies89/react-native-upi-payment

null is not an object (evaluating 'UpiModule.intializePayment')

Opened this issue · 0 comments

when I run my 'react native' project in 'expo go' app, I receive below error.

null is not an object (evaluating 'UpiModule.intializePayment'). below is the code.

 import React, {useState} from 'react';
 import { SafeAreaView, Text, View, Button, TextInput, StyleSheet } from 'react-native';
 import RNUpiPayment from 'react-native-upi-payment';

function Checkout(){
const text = 'Please enter a value';
const [status, setStatus] = useState('');
function initialize(){
    RNUpiPayment.initializePayment({
        vpa: '9033049648@ybl', // or can be john@ybl or mobileNo@upi
        payeeName: 'Amit Leuva',
        amount: '1',
        transactionRef: '123'
    },successCallback,failureCallback);
}

function successCallback(data){
    setStatus(status='success');
}
function failureCallback(data){
    setStatus(status='success');
}
return(
    <SafeAreaView>
    <View>
        <Button title='Pay now' onPress={() => initialize()} />
    </View>
    </SafeAreaView>
 );
}

export default Checkout;

Do you have alternate way to make this package work with my project?