Ambruni
Ambruni

Reputation: 31

Razorpay integration in react native expo

I am developing an application in expo and used react-native-razorpay-expo for razorpay integration but I found out that it doesnot support expo. The code

var options = {
            description: 'Credits towards consultation',
            image: 'https://i.imgur.com/3g7nmJC.png',
            currency: 'INR',
            key: 'test key',
            amount: '20',
            name: 'foo',
            prefill: {
                email: '[email protected]',
                contact: '9191919191',
                name: 'Razorpay Software'
            },
            theme: { color: '#F37254' }
        }
        // console.log("fh",options);
        RazorpayCheckout.open(options).then((data) => {
            // console.log("fh",data,options);
            // handle success
            alert(`Success: ${data.razorpay_payment_id}`);
        }).catch((error) => {
            // handle failure
            alert(`Error: ${error.code} | ${error.description}`);
        });

I am getting undefined | undefined. Can I get a solution of how to do this in android studio or an alternative to do in expo only?

Upvotes: 2

Views: 1365

Answers (1)

HexaCrop
HexaCrop

Reputation: 4263

In the internal expo forum I am seeing a reply, that says that you cannot do this unless and until you eject.

This is from November 2019, and I think they have a github feature request

Please find the links here:

https://forums.expo.io/t/expo-payment-gateway-with-razorpay/30239

https://expo.canny.io/feature-requests/p/support-for-razorpay

Upvotes: 1

Related Questions