-
Notifications
You must be signed in to change notification settings - Fork 396
fix: Resume request refund on Promo decline or fail #5695
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
base: main
Are you sure you want to change the base?
Conversation
📸 Snapshot Test9 modified, 870 unchanged
🛸 Powered by Emerge Tools |
| switch action { | ||
| case .successfullyRedeemedPromotionalOffer: | ||
| return | ||
| case .declinePromotionalOffer, .promotionalCodeRedemptionFailed: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not super convinced we should execute the path action if promotionalCodeRedemptionFailed. What happens if the user cancels the purchase in the Apple dialog? So if they accept the offer but then cancel it when the Apple UI to purchase appears. Is that an error?
In Android we are only executing the path action (the refund) if they explicitly dismiss. If they cancel the purchase in the Apple dialog, or if there's an error, we don't continue and we go back to main.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're actually right.
What happens if the user cancels the purchase in the Apple dialog?
With the current code nothing, but we should open the cancel dialog anyway. We're actually not handling it correctly.
In Android we are only executing the path action (the refund) if they explicitly dismiss. If they cancel the purchase in the Apple dialog, or if there's an error, we don't continue and we go back to main.
I've tweaked the implementation c45d6b9 using an existing helper 👍
| } catch { | ||
| // swiftlint:disable:next todo | ||
| // TODO: Log error message | ||
| Logger.error(Strings.promo_offer_purchase_failed(productId, offerId, error)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the iOS payment sheet is dismissed, it goes here with a cancelation?
Motivation
We've got a report of refunds not working when passing through a promo offer.
Description