social-common / pragma.order / OrderProviderPlugin / syncOrders /

syncOrders #

abstract suspend fun syncOrders(accountId: String, providerData: ProviderData, orders: Orders)

Fetches entitlements from the third party provider and syncs them as Pragma orders. References OrderMappingSpecs.json to map provider entitlements to Pragma sku ids.

Parameters #

accountId

Third party provider account id to sync orders against

providerData

Information about the third party provider to sync for, optionally includes a provider token necessary for some providers

orders

Helper used to interact with Pragma orders

PragmaApplicationErrors

  • OrderRpc.OrderProviderUnexpectedResponseApplicationError when there is an issue communicating with the third party provider.

PragmaResultErrors pragma.PragmaError.OrderService_OrderStatusUpdateFailed when the order status fails to update in the database. pragma.PragmaError.OrderService_ProviderDetailsUpdateFailed when the provider details fail to update in the database.