Question

Best Way to show purchase history

  • 6 September 2023
  • 1 reply
  • 39 views

Badge +3

What are the best practices for showing users’ their purchase history (for one time purchase consumables-not entitlements)? I especially want to make sure that users can see their purchase history if they attempted to make a purchase and it failed-so they can easily check to see if the purchase failed before or after they paid.

Should I show them my own custom purchase list generated from `getCustomerInfo` or are there iOS and Play Store pages that I link them out to? The latter seems preferrable because, in the end, that is the true source of truth. But I’m not sure where to find such pages and how to link the user to them?


1 reply

Userlevel 4
Badge +6

Hey @caseycrogers

I’d probably recommend handling the error right in the moment - so if the customer’s purchase failed before they paid, triggering a modal or something that lets them know that there was an error, please try again. The `purchase(package:)` method will throw an error if there is a failure while purchasing. 

Otherwise, you can use the `getCustomerInfo` object that returns from a successful purchase to create a purchase history in the customer’s profile, or to add the consumable in a visible way such as adding tokens to their bank, for example.

Reply