Checkout through credit card getting abandoned without any error message.

Fanzine
New Member
2 0 0

Hi Shopify community,

I am building a mobile application for my shopify store using "mobile-buy-SDK-iOS". Everything works fine till creating a checkout, adding shipping address, selecting delivery method, activating coupon code, adding billing address and card information. After getting card information, I am able to get a vault token by following method.

 

        let cardClient = Card.Client()
        
        let creditCard = Card.CreditCard(
            firstName:        firstName,
            middleName:       middleName,
            lastName:         lastName ,
            number:           cardNumber,
            expiryMonth:      month,
            expiryYear:       year,
            verificationCode: code
        )

        let task = cardClient.vault(creditCard, to: paySettings!.cardVaultUrl) { token, error in
        }

 

but when I create payment by following method,

        let payment = Storefront.CreditCardPaymentInputV2.create(
            paymentAmount:  paymentAmount,
            idempotencyKey: uuid,
            billingAddress: mailingAddress,
            vaultId:        vaultToken,
            test:           .value(false)
        )
        
        let mutation = StoreQuery.mutationToCompleteCarPayment(checkoutID: checkoutID!, payment: payment)
        let task = client.mutateGraphWith(mutation) { result, error in

        if let userError = result?.checkoutCompleteWithCreditCardV2?.checkoutUserErrors {
                print(userError)
            }
            print (result?.checkoutCompleteWithCreditCardV2?.payment!)

            let checkoutReady = result?.checkoutCompleteWithCreditCardV2?.checkout?.ready ?? false
            let paymentReady  = result?.checkoutCompleteWithCreditCardV2?.payment?.ready ?? false
        }

 

I get nothing in userError, nothing in payment print statement and 'checkoutReady' and 'paymentReady' flags return false.

and when I poll at order completion method, I get null order after 30 seconds and when I check abandoned order section in my shopify section, that order appears there. The abandon order makes some sense as I enter a test/invalid card information but I should get some error message in card payment mutation response. Why I do not get any error message? OR should I try using a real credit card? How will I handle invalid card information case?

Please help.

0 Likes