zinc-collective / compensated

Create value. Get Paid.
Other
13 stars 1 forks source link

Prioritize data from the unified_receipt objects when parsing apple in app purchases #25

Open zspencer opened 4 years ago

zspencer commented 4 years ago

Apple has deprecated the latest_receipt and receipt_info fields in the server-to-server notifications that we listen to in favor of a unified_receipt field. We will want to update the AppleIap::EventParser to prioritize the unified_receipt and fall-back to the previous fields if it does not exist so that consumers of apple payment events do not have to worry about that change:

Important The following top-level objects are scheduled for deprecation: latest_receipt, latest_receipt_info, latest_expired_receipt, and latest_expired_receipt_info. Update any existing code to rely on the following objects in unified_receipt instead: latest_receipt and latest_receipt_info.

See: https://developer.apple.com/documentation/appstoreservernotifications/unified_receipt

Note: We don't have any example payloads of a unified_receipt yet, so this may actually be a tough ticket to tackle unless you are using example data from an existing server that is getting unified_receipt payloads; or we can make it up from the spec Apple providers.