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 199 forks source link

Card Declined Test Card Not Triggering Error in SDK #1088

Open xanderbuck opened 4 years ago

xanderbuck commented 4 years ago

I am trying to use the "card declined" test card 4000000000000002 found here on Shopify's list of test cards

When I use this test card with the checkoutCompleteWithCreditCardV2 mutation, I don't receive any checkoutUserErrors or errors indicating the card was declined (even when confirming payment is ready). It should be noted that when I try using this same bad card in the SDK's web flow, it gives me the error message "card declined" as expected.

Since I am getting a successful response back from the checkoutCompleteWithCreditCardV2 mutation, I then poll for order completion as suggested in the Mobile Buy SDK documentation as such:

let retry = Graph.RetryHandler<Storefront.QueryRoot>(endurance: .finite(30)) { (response, error) -> Bool in
    return (response?.node as? Storefront.Checkout)?.order == nil
}

but this polls the whole time and order is always nil.

I've tried using the other cards in the Simulate failed transactions of that website list, and was able to get success with getting error messages back.

xanderbuck commented 4 years ago

Any thoughts @dbart01 @vixdug?

walteryaron commented 4 years ago

Hi @xanderbuck Did you check this: Before you can create test orders, you need to enable the test mode for Shopify payments.

xanderbuck commented 4 years ago

@walteryaron yep, test mode is enabled, and I've been making test orders no problem. Even using the other test credit cards work fine. Its just the "card declined" credit card that doesn't seem to be throwing me an error.