checkout-sheet-kit-swift
checkout-sheet-kit-swift copied to clipboard
Address in cart.delivery not displayed
What area is the issue related to?
Checkout Sheet Kit
What version of Checkout Sheet Kit are you using?
3.3.0
Steps to Reproduce (with code)
- My iOS app is collecting address as an earlier part of the flow (
addressin the example code below). - My Swift code creates a cart using the Storefront SDK like so:
let addressInput = Storefront.CartDeliveryAddressInput.create(address1: .value(address.streetAddress),
address2: .init(orNull: address.streetLine2),
city: .value(address.city),
countryCode: .value(.us),
firstName: .value(address.firstName),
lastName: .value(address.lastName),
provinceCode: .value(address.state),
zip: .value(address.zipCode))
let cardAddress = Storefront.CartSelectableAddressInput.create(
address: Storefront.CartAddressInput.create(deliveryAddress: .value(addressInput)),
selected: .value(true),
oneTimeUse: .value(true)
)
let buyerIdentityInput = Storefront.CartBuyerIdentityInput.create(email: .value(user.emailAddress()))
let deliveryInput = Storefront.CartDeliveryInput.create(addresses: .value([cardAddress]))
// cartLine created with Storefront.CartLineInput.create
let cartInput = Storefront.CartInput.create(lines: .value([cartLine]),
buyerIdentity: .value(buyerIdentityInput),
delivery: .value(deliveryInput))
let createCartMutation = Storefront.buildMutation { $0
.cartCreate(input: cartInput) { $0
.cart { $0
.id()
.checkoutUrl()
}
}
}
- With the resulting checkout URL, display Checkout Sheet Kit in SwiftUI via
CheckoutSheet(checkout: url) - For some users they see a previous address in the CheckoutSheet instead of the current address.
Expected Behavior
I would expect a cart created with a single cart.delivery address, with selected=true, to show that address and only that address.
Actual Behavior
If a user uses our product twice they are sometimes presented the last address passed to CheckoutSheet instead of the current address. I assume there are cookies in play overriding the cart configuration but I can find no way to avoid them.
Storefront domain
aura-2.myshopify.com