Skip to content

Conversation

@facumenzella
Copy link
Contributor

Motivation

We've got a report of refunds not working when passing through a promo offer.

Description

  • Resume path when promo offer fails or is declined
  • Fix padding for ProgressView
@emerge-tools
Copy link

emerge-tools bot commented Oct 22, 2025

📸 Snapshot Test

9 modified, 870 unchanged

Name Added Removed Modified Renamed Unchanged Errored Approval
RevenueCat
com.revenuecat.PaywallsTester.mac-native
0 0 8 0 160 0 ⏳ Needs approval
RevenueCat
com.revenuecat.PaywallsTester.mac-catalyst-optimized-for-mac
0 0 1 0 236 0 ⏳ Needs approval
RevenueCat
com.revenuecat.PaywallsTester
0 0 0 0 237 0 N/A
RevenueCat
com.revenuecat.PaywallsTester.mac-catalyst-scaled-to-match-ipad
0 0 0 0 237 0 N/A

🛸 Powered by Emerge Tools

switch action {
case .successfullyRedeemedPromotionalOffer:
return
case .declinePromotionalOffer, .promotionalCodeRedemptionFailed:
Copy link
Contributor

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.

Copy link
Contributor Author

@facumenzella facumenzella Oct 27, 2025

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 👍

@facumenzella facumenzella requested a review from a team as a code owner October 27, 2025 10:18
@facumenzella facumenzella requested a review from vegaro October 27, 2025 10:31
} catch {
// swiftlint:disable:next todo
// TODO: Log error message
Logger.error(Strings.promo_offer_purchase_failed(productId, offerId, error))
Copy link
Contributor

@vegaro vegaro Oct 31, 2025

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?

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