Skip to content

In-App Purchases

Introduction

An In-App Purchase integration is responsible for processing platform-specific receipts and ensuring expected actions are taken in any 3rd party system upon successful purchase (e.g entitlement management for end-user).

Accedo One handled IAP for each platform similarly, however due to platform differences, APIs are split per platform. Currently Accedo One supports IAP on the following platforms:

  • Apple
  • Google
  • Amazon
  • Roku

Accedo One must be configured with access to platform-specific store APIs with valid credentials, as validation is performed prior to handing over purchase handling to the payment provider.

Purchase Flow

While Purchase APIs are platform-specific, the only differences between each platform is the set of receipt metadata that is available for each platform. All platforms follow the following purchase flow:

  • List of available purchasable products is requested via <Platform>InAppPurchaseService.GetProducts
  • Client application filters Platform-store specific options based on the list of purchasable products
  • User performs a purchase & client application receives a receipt
  • Receipt is sent to Accedo One where it's pre-validated and decoded
  • If validation passed on Accedo One side, IAP Integration receive <Platform>InAppPurchaseService.ValidatePurchase call with both encoded and decoded receipt information
  • Integration calls payment provider APIs to register the purchase (and potentially create entitlements)

Development with IDK

To start IDK in Entitlements / IAP mode, simply run idk up entitlement-purchase

$ idk up entitlement-purchase

grpc-mock Done!  
purchase-amazon Done!  
purchase-gateway Done!  
purchase-apple Done!  
router Done!  
entitlement-purchase-api Done!  
ui Done!  
Creating network "default-entiapidk" with the default driver
Creating entitlement-purchase_default_entitlement-purchase-api_1 ... 
Creating entitlement-purchase_default_purchase-amazon_1          ... 
Creating entitlement-purchase_default_grpc-mock_1                ... 
Creating entitlement-purchase_default_purchase-apple_1           ... 
Creating entitlement-purchase_default_ui_1                       ... 
Creating entitlement-purchase_default_purchase-gateway_1         ... 
Creating entitlement-purchase_default_router_1                   ... 
Creating entitlement-purchase_default_ui_1                       ... done
Creating entitlement-purchase_default_router_1                   ... done
Creating entitlement-purchase_default_grpc-mock_1                ... done
Creating entitlement-purchase_default_entitlement-purchase-api_1 ... done
Creating entitlement-purchase_default_purchase-apple_1           ... done
Creating entitlement-purchase_default_purchase-amazon_1          ... done
Creating entitlement-purchase_default_purchase-gateway_1         ... done
### IDK environment URLs ###

    - IDK - Admin UI: http://localhost:49154/

APIs

Following APIs must be fulfilled by the integration:

  • AmazonInAppPurchaseService - as defined in purchase/amazon/iap.proto
  • AppleInAppPurchaseService - as defined in purchase/apple/iap.proto
  • GoogleInAppPurchaseService - as defined in purchase/google/iap.proto
  • RokuInAppPurchaseService - as defined in purchase/roku/iap.proto