-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
Today there is no reasonable way to discern between a "user cancelling the purchase" and "a real error" for in app purchases.
The source code (see excerpt below) states "Some error occurred in the purchase. The purchasing process if aborted".
/// Status for a [PurchaseDetails].
///
/// This is the type for [PurchaseDetails.status].
enum PurchaseStatus {
....
/// Some error occurred in the purchase. The purchasing process if aborted.
error,
...
}There needs to be a way to know if this "error" is simply a user cancelling the purchase or if it's a real error.
The purchaseDetails.error does contain some information, but it seems like figuring out whether or not this was a user cancellation error (at least for iOS) would require parsing the JSON of purchaseDetails.error.details which is extremely unreasonable (and possibly unreliable) and is something that should be handled at the library level.
Proposal
Add a new enum type: PurchaseStatus.cancel so that library to separate these two different occurrences.