question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to open RazorpayCheckout when called from Modal in iOS - works in android

See original GitHub issue

RazorpayCheckout does not open when tried to call inside a Modal. This works in android and not in iOS.

I checked by creating a new project with the following code

<View style={{marginTop: 22}}>
        <Modal
          animationType="slide"
          transparent={false}
          visible={this.state.modalVisible}
          onRequestClose={() => {
            Alert.alert('Modal has been closed.');
          }}>
          <TouchableHighlight style={{justifyContent : 'center', alignContent : 'center', paddingTop : 100}} onPress={() => {
            var options = {
              description: 'Credits towards consultation',
              image: 'https://i.imgur.com/3g7nmJC.png',
              currency: 'INR',
              key: 'rzp_test_1DP5mmOlF5G5ag',
              amount: '5000',
              name: 'foo',
              prefill: {
                email: 'void@razorpay.com',
                contact: '9191919191',
                name: 'Razorpay Software'
              },
              theme: {color: '#F37254'}
            }
            RazorpayCheckout.open(options).then((data) => {
              // handle success
              alert(`Success: ${data.razorpay_payment_id}`);
            }).catch((error) => {
              // handle failure
              alert("ERROR, error",error)
              alert(`Error: ${error.code} | ${error.description}`);
            });
          }}>
          <Text>ClickMe</Text>
          </TouchableHighlight> 

      </Modal>
       
      <TouchableHighlight
          onPress={() => {
            this.setModalVisible(true);
          }}>
          <Text>Show Modal</Text>
        </TouchableHighlight>

      </View>

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
iThink32commented, Jan 18, 2019

@meetyourdev updated the comment , pls check

1reaction
iThink32commented, Jan 18, 2019

@meetyourdev I actually tried to explain in terms of react-native anyway please use a new component and try opening react-native-razorpay on it. Moreover both the iOS / android implementations follow the same logic but the implementation is platform specific , so I suggest you to use the above approach as it will work for both android and iOS

Read more comments on GitHub >

github_iconTop Results From Across the Web

RazorPay Checkout open function not worked on both iOS ...
When call the Razor-pay open function, its wonts open a Razor-pay Amount page. · Opened the modal page then loading the page and...
Read more >
Payment Gateway | Web Integration - Troubleshooting & FAQs
Mozilla Firefox users may not be able to open the bank page while making a netbanking payment on ... Yes, you can track...
Read more >
android - Razorpay checkout form stuck on loading in webview
Here is a partially working solution. The main problem is that the Razorpay dialog tries to open a new window to show the...
Read more >
react-native-razorpay - Yarn - Package Manager
Steps. Import RazorpayCheckout module to your component: import RazorpayCheckout from 'react-native-razorpay';. Call RazorpayCheckout.open method with the ...
Read more >
react-native-razorpay - npm
Call RazorpayCheckout.open method with the payment options . The method returns a JS Promise where then part corresponds to a successful payment ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found