square / in-app-payments-react-native-plugin

Apache License 2.0
116 stars 49 forks source link

SDK incorrectly detecting sandbox application ID #192

Closed fobos531 closed 1 year ago

fobos531 commented 1 year ago

Describe the issue

When attempting to process a test payment in the simulator we are presented with an error stating that we are using a production app id, but we are using a sandbox one (clearly given that sandbox keys are prefixed with sandbox).

Here is the log:

  // {"code": "USAGE_ERROR", "debugCode": "apple_pay_nonce_request_production_simulator", "debugMessage": "Apple Pay cannot be used in the simulator with a production Square application ID. Please use a Square sandbox application ID or test Apple Pay on a physical device.", "message": "Something went wrong. Please contact the developer of this application and provide them with this error code: production_simulator"}

To Reproduce

Expected behavior

Apple Pay to finish successfully and return a valid token.

Environment (please complete the following information):

Screenshots

Additional context

This is the exact same issue as https://github.com/square/in-app-payments-react-native-plugin/issues/68

The sandbox credentials work perfectly fine when using a physical device, however they do NOT work when using a simulator. Is it possible to get it working on a simulator? Any help is greatly appreciated.

tobischw commented 1 year ago

Hi,

I am a developer working on the In-App Payments SDK at Square. I'd like to provide an update - the root cause of this issue stems from a bug introduced in our backend for handling sandbox interactions with Apple Pay. We are currently investigating the work required to fix this. For now, the recommendation is to test sandbox on a physical device, and that Apple Pay sandbox support on Simulator is currently unavailable.

Thank you for your understanding!

tobischw commented 1 year ago

Update on this: Sandbox should work now. Please re-open if issue persist.

ggirotto commented 1 year ago

@tobischw I'm still facing the issue when testing against iOS simulator

tobischw commented 1 year ago

@ggirotto Which version are you using? Can you provide a full error log?

ggirotto commented 1 year ago

@tobischw Sorry, I didn't realize that this is the react native repo. Created an issue in the Flutter repo: https://github.com/square/in-app-payments-flutter-plugin/issues/217

kuldip-simform commented 1 year ago

@tobischw I'm facing this same issue.

Please check the below video for reference

https://github.com/square/in-app-payments-react-native-plugin/assets/104821076/d2ef2b9f-1e12-49ca-b4dd-ea1ce38d9b68

Soft-Gurus commented 11 months ago

@tobischw I am facing same issue. React Native barebone - 0.71.6 react-native-square-in-app-payments: 1.7.2 image

Soft-Gurus commented 11 months ago

@tobischw the issue is still there. We need to reopen and address this

kuldip-simform commented 11 months ago

Yes @Soft-Gurus I agree. I am still facing this issue. @tobischw Can you please tell us the status from your end on this issue? Can we test Apple pay on simulator?

tobischw commented 11 months ago

Hi folks!

Apple Pay on sandbox on simulator is currently unsupported, and we recommend testing with a physical device. Apologies for the inconvenience this may cause.

ggirotto commented 7 months ago

@tobischw This could be added to the Apple Pay integration docs