mirror of
https://github.com/RevenueCat/purchases-ios
synced 2026-11-10 22:45:55 +05:45
Add the networking layer for starting a hosted checkout (#7627)
* Add the networking layer for starting a hosted checkout POST /rcbilling/v1/hosted-checkout creates the checkout session with the payment provider and returns the page to present for it. Co-authored-by: Cursor <cursoragent@cursor.com> * Send the Apple external purchase token id when starting a checkout The endpoint ties the checkout session to the registered token, so the token id is also part of the request's dedup key: two taps carrying different tokens must never share one session. Co-authored-by: Cursor <cursoragent@cursor.com> * Document what PostHostedCheckoutOperation is for Co-authored-by: Cursor <cursoragent@cursor.com> * Retry the hosted checkout request Retries only ever fire on a 429, which the server rejects before creating a session, so there is nothing to strand. Giving up instead costs the customer the tap they are waiting on. Co-authored-by: Cursor <cursoragent@cursor.com> * Name a case where no external purchase token applies Co-authored-by: Cursor <cursoragent@cursor.com> * Drop the comments on the hosted checkout path cases Co-authored-by: Cursor <cursoragent@cursor.com> * Generating new test snapshots (#7633) * Generating new test snapshots (#7634) * Generating new test snapshots (#7635) * Generating new test snapshots (#7636) * Generating new test snapshots (#7637) * Generating new test snapshots (#7638) * Generating new test snapshots (#7639) * Generating new test snapshots (#7640) * Generating new test snapshots (#7641) * Cover the created status of a new checkout session The endpoint answers 201, which is the status the flow actually reads. Co-authored-by: Cursor <cursoragent@cursor.com> * Spell ID and URL the way the rest of the SDK does The decoder converts from snake case, which yields Id and Url, so the names have to be mapped rather than inferred. Co-authored-by: Cursor <cursoragent@cursor.com> * Send the presented offering context when starting a checkout A purchase made through the in-app sheet has to carry the same attribution a StoreKit purchase from that paywall would, so placement, targeting rule, workflow, step and paywall travel with it. Co-authored-by: Cursor <cursoragent@cursor.com> * Add snapshots for the presented offering context request Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: RevenueCat Git Bot <72824662+RCGitBot@users.noreply.github.com>
This commit is contained in:
153 files changed
+5777
-4
No files matched your search
@@ -218,6 +218,7 @@ extension HTTPRequest {
|
||||
|
||||
case getWebOfferingProducts(appUserID: String)
|
||||
case getWebBillingProducts(userId: String, productIds: Set<String>)
|
||||
case postHostedCheckout
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user