Interface PurchaseCallback
- All Known Subinterfaces:
PendingPurchaseCallback
public interface PurchaseCallback
Callback interface that the main class must implement in order for in-app-purchasing
to work. Once the main class implements this interface the methods within it
are invoked to indicate the various purchase states.
-
Method Summary
Modifier and TypeMethodDescriptionvoiditemPurchased(String sku) Indicates a the given SKU was purchased by a user.voiditemPurchaseError(String sku, String errorMessage) Callback indicating a the given SKU purchase failedvoiditemRefunded(String sku) Invoked if a refund was granted for a purchase.voidpaymentFailed(String paymentCode, String failureReason) Indicates that a manual payment has failedvoidpaymentSucceeded(String paymentCode, double amount, String currency) Indicates that a manual payment has passedvoidInvoked when a subscription SKU is canceledvoidInvoked when a subscription SKU is started
-
Method Details
-
itemPurchased
Indicates a the given SKU was purchased by a user. When purchasing multiple SKU's at once multiple calls to this method will be performed.
Parameters
sku: the sku purchased
-
itemPurchaseError
-
itemRefunded
Invoked if a refund was granted for a purchase.
Called on iOS and macOS (StoreKit 2) when Apple revokes a purchase: a refund, or a Family Sharing purchase the organizer withdrew. Other platforms do not call it, so treat it as a prompt to recompute ownership from the receipts (see
Purchase#getReceipts()), which is the signal that works everywhere.Parameters
sku: the sku purchased
-
subscriptionStarted
Invoked when a subscription SKU is started
Parameters
sku: the sku purchased
Deprecated
-
subscriptionCanceled
Invoked when a subscription SKU is canceled
Parameters
sku: the sku purchased
Deprecated
-
paymentFailed
-
paymentSucceeded
-