[Feature Request]: API To Detect Purchase Cancellations

App Name: RevenueCat SDK

SDK version you are referring to for this feature request: v0.24
React Native version you are referring for this feature request: N/A

App Link on Amazon Appstore: N/A

Is your feature request related to a problem?

When a user initiates a purchase, but presses the back button on the payment screen, the purchase() function returns a PurchaseResponse code (PurchaseResponseCode - Amazon Vega Docs) of 4 (FAILED). This means that it is not possible for developers to distinguish between a legitimate purchase failure and a cancellation triggered by the user.

Typically, developers would update their UI in different ways depending on if the result is a cancellation or failure:

  • If the user cancelled the purchase, developers would likely want to dismiss their paywall or show a cancellation message, but they will usually not want to show an error message for an event that isn’t an error.
  • If the purchase failed due to an error, the developer likely would show an error message to the user.

Describe the solution you’d like

If I were designing a solution to this issue, I would create a new enumeration member on PurchaseResponseCode that represents cancellations triggered by the user (USER_CANCELLED), and provide that value in the PurchaseResponse returned by the purchase() function when the user presses the back button on the purchase screen.

Is this a blocker? Describe alternatives you’ve considered

Without this feature, it is impossible for developers to distinguish between purchase cancellations and errors. Until this is possible through the APIs, developers must either:

  • Treat all purchase cancellations as errors
  • Treat all purchase errors as cancellations

Thank you for your time and considerations! Happy to answer any questions that you may have :slight_smile:

Hi @fireatwill_rc ,

Welcome to the community and thank you for posting this feature request.

We have shared your request with the relevant team for evaluation.
We will let you know when we have an update on this.

Thanks,
Rohit