Open mortenbekditlevsen opened 4 months ago
Hi @mortenbekditlevsen, the errors that you experience during developer mode
cover all refund error codes but perhaps the confusing part is that the error with code 2 can have multiple reasons and we're simulating only one of them.
We understand that there might be cases in which knowing the exact reason for a refund failure could be useful. Thank you for highlighting this gap in our documentation. We will consider this request during our future plannings.
Meanwhile, we want to unblock you as much as possible. Please find below a list of the most common technical errors (code 2) and their description: | NSLocalizedDescription | Description |
---|---|---|
#AlreadyRefunded | Payment was already refunded | |
#RefundInsufficientFunds | Account does not have sufficient funds to perform refund | |
#RefundAmountExceedOriginalAmount | Trying to perform refund with amount higher than original payment | |
#RefundFailedRefundGenericNotSupported | Payment is not refundable | |
#RefundDateExpired | Payment refund is too old to be refunded |
This list might not be exhaustive; any other message can be considered failure due to unknown reasons. Note that this is not official API and might change without notice but it might be useful until we release a version which defines the refund failure reasons similar to Android. We will post an update here when that is available.
Hope that this is helpful! Do not hesitate to ask us any further questions!
Expected Behavior
I expect to be able to distinguish different error codes in my code base, so that I can communicate correctly with the end user.
This issue is related to previously closed issue: #249
Please describe the behavior you are expecting.
Current Behavior
I am trying to make sense of the various refund errors that can occur through the API.
Currently it appears that the refund errors are not covered by the error codes defined in the SDK - and furthermore we get different error codes for apparently similar error situations based on wether we are in
developer mode
or on ademo account
.Here are some errors that we experience when using a
demo account
:And some errors from when we are in
developer mode
:It appears that in
developer mode
, the errors that we can provoke do indeed have different error codes. But one of those codes (2) occurs for every error that we have been able to provoke using ademo account
.We do not have access to a
production account
, so we have no guess as to whether it behaves more like ademo account
ordeveloper mode
- or in a third fashion.Can you give any advice for error handling for refunds - and specifically for distinguishing different error scenarios?
Steps to Reproduce
Perform refunds in developer mode and on a demo account and observe the details of the
NSError
s that are thrown.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
SDK version: 4.0.1
Failure Logs
Please include any relevant log snippets or files here.