Making Purchases
Learn how to make purchases in Deepwall
The Deepwall SDKs create and restore in-app purchases for both subscriptions and non-subscription products, and validate user receipts for you without the need for additional code.
Whenever users decide to buy a product on a displayed paywall, the purchase transaction is automatically created on the related platform, finished and acknowledged for Android apps by Deepwall.
Deepwall also provides automatic server-side receipt validation on all platforms and sends purchase events for you to handle and take necessary actions in your app workflow.
Note: Purchase transactions are automatically created and finished by Deepwall and acknowledged for Android apps.
Using Purchase Events
The Deepwall SDK triggers various events while making in-app purchases which gives you the ability to manage the purchase flow in your app.
Event for Purchase Initiation
iOS Event
Android Event
deepwallPaywallPurchasingProduct
Parameters :
productCode:
String
PAYWALL_PURCHASING_PRODUCT
Parameters :
PaywallPurchasingProductInfo
productCode:
String
Deepwall sends the deepwallPaywallPurchasingProduct
event for iOS and PAYWALL_PURCHASING_PRODUCT
event for Android whenever a purchase is initiated by the user and a purchase is started by the Deepwall SDK, and sends the product code as a parameter.
You can use this event to log started purchases on your side.
Event for Purchase Success
iOS Event
Android Event
deepwallPaywallPurchaseSuccess
Parameters :
type:
PloutosValidationType
result:
PLPurchaseResponse
subscriptions:
Array of SubscriptionItem
products:
Array of ProductItem
PAYWALL_PURCHASE_SUCCESS
Parameters :
SubscriptionResponse
type:
DeepwallReceiptValidationType
result:
SubscriptionDetail
subscription
Array of PurchaseSubscriptionItem
products:
Array of String
Deepwall sends the deepwallPaywallPurchaseSuccess
event for iOS and PAYWALL_PURCHASE_SUCCESS
event for Android whenever a purchase or restore is realized successfully and the receipt has been verified. All purchased subscriptions and non-subscription products are returned as a parameter.
This event can also be sent when the client receipt has been changed for any reason and Deepwall automatically validates latest receipt with success.
You can recognize and handle this event checking the validation type parameter:
AUTO: If the validation type is AUTO
, this means the purchase success event is triggered because of automatic receipt validation during app launch.
PURCHASE: If the validation type is PURCHASE
, this means a purchase is made successfully. In this case you can close the paywall if another purchase cannot be made by users and make necessary updates for paid users in your app.
RESTORE: If the validation type is RESTORE
, this means a restore request is successfully validated. In this case, you can close the paywall if another purchase cannot be made by users and make necessary updates for paid users in your app.
Event for Purchase Failure
iOS Event
Android Event
deepwallPaywallPurchaseFailed
Parameters :
productCode:
String
reason:
String
errorCode:
String
isPaymentCancelled:
Bool
PAYWALL_PURCHASE_FAILED
Parameters :
SubscriptionErrorResponse
type:
DeepwallReceiptValidationType
result:
DeepwallPurchaseFailedInfo
productCode:
String
reason:
String
errorCode:
String
isPaymentCancelled:
Bool
Deepwall sends thedeepwallPaywallPurchaseFailed
event for iOS and PAYWALL_PURCHASE_FAILED
event for Android whenever a purchase has failed due to an error.
Purchase Cancelled by the User: If payment is started and the user does not approve the payment, then purchase fail event is sent with the isPaymentCancelled
parameter as TRUE
.
Purchase Failed Due To Error: If isPaymentCancelled
is FALSE
, this means the purchase is failed due to an error.
Tracking Purchases
Dashboard
Successful purchases will be made available through the Deepwall Dashboard.
Purchase Events Logging
Deepwall provides integration to MMPs like Adjust and AppsFlyer, and it can log IAP-based events on those platforms without the need of integrating SDKs from those providers.
See the following guide to learn more about event logging to MMPs :
Webhooks
Deepwall can send real-time in-app subscription and purchase events to your server with Webhooks, if you want.
See the following guide to learn more about webhooks :
You can check out the following guide to learn about listening to all the SDK events and parameters:
You can also check out the following guide for troubleshooting the most common errors while setting up the in-app purchases and Deepwall SDK:
Last updated