Support for RazorPay
bamne123
hi Team,
It will be grate addition of Razorpay as payment gateway implemented in expo.
Regards,
Nilesh
Projects Cloud
As of Expo SDK 46, and react-native-razorpay version 2.2.9, just installing the SDK with:
yarn add react-native-razorpay
and creating a dev client seems sufficient. There is no need to modify any .gradle or .java files. It all works automatically due to react native autolinking.
Projects Cloud
As of Expo SDK 46, and react-native-razorpay version 2.2.9, just installing the SDK with:
yarn add react-native-razorpay
and creating a dev client seems sufficient. There is no need to modify any .gradle or .java files. It all works automatically due to react native autolinking.
devcoder buzz
Projects Cloud: so you mean to say without ejecting and doing any plugin etc, it can be implemented ??
Projects Cloud
devcoder buzz: You will need to create a development build of your project. It won't work in Expo Go if that's what you mean by "without ejecting". Please refer: https://docs.expo.dev/development/introduction/
What you don't need to do is perform the steps mentioned here: https://razorpay.com/docs/payments/payment-gateway/react-native-integration/standard/build-integration-android
All of those steps would happen automatically due to react native autolinking and so there is no need for a Config Plugin.
Also look here: https://github.com/razorpay/react-native-razorpay/issues/379
Hope that helps.
devcoder buzz
Has any one implemented razor pay using Expo?? please some one guide me?
Michael Wood
As far as I can see, Razorpay should work fine with EAS Build. It should work out of the box on iOS. On Android a Config Plugin will be needed to make the necessary updates to
MainApplication.java
, settings.gradle
and app/build.gradle
.Mohana gowthami Gajula
Michael Wood: hii, can u share any document , how to achieve this by eas build
J
Jitu Nayak
Mohana gowthami Gajula: just run expo run:ios. it will generate your native code sources ie. ios/android folder. Then you can proceed with the instructions from Razorpay regarding their side configurations. Expo SDK 42 added this native support. So now you can do everything on expo what you used to in plain react native cli
Michael Wood
Mohana gowthami Gajula: What Jitu suggests is effectively the Bare workflow (almost), although these days it's a lot closer to the Managed workflow than it used to be, because you can still use Expo's build servers to build the app, and you can create a Custom Dev Client to use for development instead of using Expo Go (which is not compatible with custom native code).
If possible, I would avoid using
expo run:ios
or expo run:android
. At the moment that should be easy with iOS, but because Razorpay on Android requires some custom changes to MainApplication.java, settings.gradle and build.gradle this is more complex for Android.For iOS you should basically just need to install the library using npm or yarn and then build a custom dev client to use instead of Expo Go, and use
eas build
when building the app.For Android, if you want something similar to how it works for iOS, you would need to ask Razorpay to write a Config Plugin, or you would have to write one yourself. I have never written a config plugin myself. If I needed to I would look at the examples in the packages directory in the expo/expo repository on GitHub.
Another possibility is to use
expo run:android
to generate the android
directory. But make sure you do not have an ios
directory. That's basically ejecting for Android, but using the managed workflow for iOS. Then you could make the custom changes to the android/* files manually. You would then build Android and iOS custom dev clients. Then in future if Razorpay or someone else writes a config plugin you could remove the android directory again.Shajeesh Radhakrishnen
We need to integrate our app with Razorpay as our clients are from India. Please add this payment method asap
J
Jitu Nayak
Shajeesh Radhakrishnen: Expo now has support for all libraries which require you to install native modules on your own. Kudos to Expo team. Try their eas build or build it on your own
Shajeesh Radhakrishnen
Jitu Nayak: Thank you so much for the information. I'm new to this could you please share some more information or a link where I can learn more about the same.
Michael Wood
Shajeesh Radhakrishnen: See my post above. For iOS it should basically just work with EAS Build, but for Android you'll need to figure out how to write a Config Plugin (or ask Razorpay to write one) or eject for now until there is a config plugin.
Michael Wood
Merged in a post:
Rozorpay payment gateway - react-native-razorpay
Deepak Chahar
Razorpay is widely used for apps and website instead of Stripe in India, It has many features then stripe, please add this gateway else expo is not useful for medium size applications.
Reference link
J
Jitu Nayak
This is indeed after cocopod issues with react native cli.
Aslam Hasan Khan
Need this feature :( stuck badly on this one
M
Mohamed Eid
with great power comes great responsibility
Dizy
Mohamed Eid: with great power comes large size XD
Mufaddal Hamid
Yes I left expo due to that
Deepak Chahar
Mufaddal Hamid: I haven't any choice now
Load More
→