in-app-payments-react-native-plugin
in-app-payments-react-native-plugin copied to clipboard
Is there a way to check if setSquareApplicationId fails?
I tried to put it inside a try/catch clause, but it doesn't report any error (I have used an invalid Application ID).
This function won't fail with an invalid application id. However, when you try to actually generate a nonce, it would fail with an invalid application id. The setting of the application id doesn't do any checks for validity.
Thanks Stephen.
- As you say, the call to
SQIPCardEntry.startCardEntryFlow
fails. However, the error doesn't say that the application ID is wrong, but that 'the card entry is unauthorized' (see the screenshot below). Is that what it should say?
- IMHO, the error should be raised on the initialization of the App, and not when generating the nonce. I suggest to change this issue from a question to an enhancement. Does this make sense?
Ah, yes, you're right I believe that is the real error. I've updated this to be an enhancement, it does make sense. Thank you for the feedback!
Thanks Stephen. Regarding the error: I would expect something like "Invalid application id" and not "card unauthorized" which I understand to be something else.
So we have here: (1) an enhancement for reporting the error when setSquareApplicationId is called, and a (2) bug for the invalid error code.
If (1) is done, then (2) is not needed. If (1) is not done, then (2) needs to be fixed.
Thank you for your feedback. We have shared the feedback with our team.