Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Razer payment react native---Cannot read property 'open' of undefined #104

Closed
09user opened this issue Aug 21, 2018 · 13 comments
Closed

Razer payment react native---Cannot read property 'open' of undefined #104

09user opened this issue Aug 21, 2018 · 13 comments

Comments

@09user
Copy link

09user commented Aug 21, 2018

Hi ,
Working on razor payment gateway , But getting an error of cannot read property 'OPEN' of undefined,
Below is the code used:

<TouchableHighlight onPress={() => {
        var options = {
          description: 'Credits towards consultation',
          image: 'https://i.imgur.com/3g7nmJC.png',
          currency: 'INR',
          key: 'rzp_test_1DP5mmOlF5G5ag',
          amount: '5',
          external: {
            wallets: ['paytm']
          },
          name: 'foo',
          theme: {color: '#F37254'}
        }
        RazorpayCheckout.open(options).then((data) => {
          // handle success
          alert(`Success: ${data.razorpay_payment_id}`);
        }).catch((error) => {
          // handle failure
          console.log("error : "+error)
          alert(`Error: ${error.code} | ${error.description}`);
        });
        RazorpayCheckout.onExternalWalletSelection(data => {
          alert(`External Wallet Selected: ${data.external_wallet} `);
        });
      }}>`
@aayush123
Copy link

aayush123 commented Sep 2, 2018

Ran into the same issue, realized that I forgot to link the package using react-native link

@iThink32
Copy link
Contributor

iThink32 commented Sep 3, 2018

If you face such issue please try the manual linking process specified here ,

https://facebook.github.io/react-native/docs/linking-libraries-ios

or watch our integration videos

https://razorpay.com/docs/ios/integration-videos/

@ghost
Copy link

ghost commented Sep 4, 2018

Facing same issue on android as well :(

@iThink32
Copy link
Contributor

@ArjithN please refer the manual linking process for android on react - native docs specified above.

@ashwingattani
Copy link

@ArjithN / @09user, did you guys find any resolution to this error? My app is working fine on the iOS front but gives undefined error on the Android platform.
@iThink32, can you help to provide integration docs for Android as well? Thanks.

@Akulvarshney
Copy link

@ArjithN / @09user, did you guys find any resolution to this error? My app is working fine on the iOS front but gives undefined error on the Android platform. @iThink32, can you help to provide integration docs for Android as well? Thanks.

same I need help for the same issue. Kindly help me as well. @ashwingattani @iThink32, what is the solution for this.

open is thrown as undefined.

@vtech18
Copy link

vtech18 commented Nov 17, 2023

Ran into the same issue, realized that I forgot to link the package using react-native link

hiw can we do it in Expo platform

@avdhesh75WT
Copy link

You cant do react-native link in expo app

@gopikap
Copy link

gopikap commented Apr 4, 2024

@Akulvarshney where you able to find a solution? The same happens to me too, saying Error [TypeError: Cannot read property 'open' of null].

Any help would be great.

@vivekshindhe
Copy link
Contributor

The react-native-razorpay package internally uses native libraries for Android and iOS. The error suggests that the native libraries aren't included in the build. During our testing we have been able to resolve this and switching to development build than expo build which allows for the usage of native libraries. Maybe this will help resolve the issue for you folks.

@gopikap
Copy link

gopikap commented Apr 5, 2024

"react-native-razorpay": "^2.3.0" //Razorpay version I am using
"react-native": "0.68.2", //is the react native version i am using
We are not using expo. React cli is what we use.

@vivekshindhe
Copy link
Contributor

If it is react cli that means the package wasn't correctly installed. Can you try reinstalling the package? @gopikap

@gopikap
Copy link

gopikap commented Apr 5, 2024

@vivekshindhe Thank you so much, after re-installation I got the page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants