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

Inconsistent behaviour in error handling between IOS and Android SDK #470

Open
Bart-Westenenk opened this issue Sep 7, 2024 · 6 comments

Comments

@Bart-Westenenk
Copy link

Expected Behavior

I expected the API's for IOS and Android to have similar return values. Meaning, if a payment fails, my code can be notified in some way on android and IOS.

Current Behavior

Currently the IOS SDK always returns with a "succesful" response, because the Zettle SDK already informs the user. However, it may have effect on what the user will be shown in other locations of the application. Currently there is no way to fetch this in IOS.

Steps to Reproduce

Make a payment using the IOS SDK
See that there is no way to get the success state

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

  • Operating Version: IOS 17.6
  • SDK version: 4.0.1
@Bart-Westenenk
Copy link
Author

Bart-Westenenk commented Sep 7, 2024

The android also can also distinguish between cancelled and failed payments. The IOS SDK seems to give back some error information, but it is not documented anywhere. This needs to be improved.

@ppeelen
Copy link
Contributor

ppeelen commented Sep 9, 2024

Hi @Bart-Westenenk!

Thank you for reaching out.

Could you please elaborate on what you mean with:

Currently the IOS SDK always returns with a "succesful" response, because the Zettle SDK already informs the user.

When a .charge is initiated and it fails, e.g. when the merchant cancels the charge, the SDK will return an error via the iZettleSDKOperationCompletion completion closure / block. In the example mentioned here, it should be one of com.izettle.basic.error, error code 0 and description of Payment cancelled / Cancelled by user. The same goes for other errors, such as "Service unavailable" or "Declined by bank", amongst others. Most common errors can be triggered using the Developer Mode.

I understand that our documentation on the different errors that the SDK can return could be improved and will see if this is something we can prioritize and update in our developer portal.

@Bart-Westenenk
Copy link
Author

This is completely undocumented behavior. There are only error codes for failure reasons in the headers (nothing in the documentation), none for cancel reasons (no balance, cancelled etc.).

so purely based on the documentation I would say there are no error codes given (all errors are handled by Zettle according to the docs), and whichever can be given is unknown and undocumented.

@ppeelen
Copy link
Contributor

ppeelen commented Sep 17, 2024

Thank you for further clarifying this. We understand there is a lack of documentation in our developer portal regarding errors and error handling and we will be working on improving this going forward. Our internal teams are informed and will try to add this to their next planning cycle.

We will update this thread when more documentation is available.

@Bart-Westenenk
Copy link
Author

Any update on this?

@ppeelen
Copy link
Contributor

ppeelen commented Dec 9, 2024

Hi @Bart-Westenenk. This is being worked on together with other updates. We will update this thread when more documentation is available.

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

No branches or pull requests

2 participants