Shopify / mobile-buy-sdk-ios

Shopify’s Mobile Buy SDK makes it simple to sell physical products inside your mobile app. With a few lines of code, you can connect your app with the Shopify platform and let your users buy your products using Apple Pay or their credit card.
MIT License
452 stars 198 forks source link

Apple Pay - Payment is null when fetched for `ready`status #1222

Open lorenzOliveto opened 11 months ago

lorenzOliveto commented 11 months ago

I'm trying to implement the apple pay checkout but I'm facing this issue: when I query for the payment to check if it's been completed it returns nil so the checkout always fails.

This is the query

Storefront.buildQuery(inContext: context) { $0
    .node(id: paymentId) { $0
        .onPayment { $0
            .id()
            .ready()
            .errorMessage()
        }
    }
}

I'm sure that the payment id is correct since I've taken it for the checkout previously.

What could cause this problem? How can I query for errors on this operation?