Shopify / checkout-sheet-kit-swift

Shopify’s Checkout Sheet Kit makes it simple to perform a checkout inside your Swift native app.
MIT License
38 stars 15 forks source link

Fetching Order ID or Checkout ID / Status upon completion #117

Closed codeslaw closed 8 months ago

codeslaw commented 10 months ago

Hi, I'm looking for guidance on how to identify orders placed via this SDK.

Our use case is to provide the checkout experience to users logged into our app. Upon placing the order, we will receive a web hook event on the backend, that we want to associate with the user, but its unclear how I can reliably do this.

The completion/cancellation delegate passes no information back to the calling context. I have the original Cart object used to get the checkoutURL, but how can I match that to a Checkout ID (or something similar) to pass along to the backend, that we could use to match the incoming webhook?

Building a custom checkout with the Buy SDK makes this trivial, but so much more is abstracted away here.

Any guidance is appreciated, thanks in advance!

markmur commented 9 months ago

Hey @codeslaw, apologies for the delayed response here.

We will be adding order details to the checkout completed event in the next release.

codeslaw commented 8 months ago

Hi @markmur -- following up here. Is this available now in 1.0.2? Changelog makes no mention of it, nor does the readme.

kiftio commented 8 months ago

hi @codeslaw it'll be included in the next (2.0.0) release along with a couple of other changes. We're just finalising that now, it should be ready very soon.

markmur commented 8 months ago

Hey @codeslaw the CheckoutCompletedEvent is now available in checkout-sheet-kit-swift@2.0.0