Using shopify and spreedly. Getting "payment" : null in checkoutCompleteWithCreditCardV2 API

borderfree
New Member
11 0 0

Hi Team,

This is one issue i am struggling to fix from almost 2Weeks. I think I had posted it in the wrong forum previously. So i am posting it here again. 

Basically we have a Public App (X) (in draft status). We installed the app onto our shopify-store (Y ; both of these shopify websites are .com-s --meaning not India region). Then we ran the App in the shopify store Y, completed the OAuth and got the StoreFrontAccessToken. With this storeFrontAccessToken we are trying to implement these API-s Tutorial - create checkout using Spreedly in Postman rest client. All the APIs return proper response (with http code: 200) along with the expected ids etc exactly like said in the tutorial --Except for the api: checkoutCompleteWithCreditCardV2 which returns null for the payment object (but with http 200 status code). While the tutorial mentions that payment should return a json like `{ "id" : "xxxxxx" }. Any thoughts why this is happening? And how to fix it. All the previous 9 api calls are working good with proper response like mentioned in the tutorial. 

Response for checkoutCompleteWithCreditCardV2. Http status code: 200

{
    "data": {
        "checkoutCompleteWithCreditCardV2": {
            "checkout": {
                "id": "Z2lkOi8vc2hvcGlmeS9DaGVja291dC8xMThkOTRmNmNjOGY3YjRhY2YxNTc4OTdlMjY2OThkMz9rZXk9ODY0ODJjNjQzZTc2NGJkNjg1YTcxYmY1NmQ3ZDkzMTA="
            },
            "checkoutUserErrors": [],
            "payment": null
        }
    }
}

 

Alternatively, the shopify store (X) in question is configured with Bogus gateway, 2checkout test gateway and lastly with Paysafe production gateway provider. We also tried with the test credit cards (given by shopify on their help page) and also with a working proper creditcard (issued in US. and another credit card issues in India). However the api response: checkoutCompleteWithCreditCardV2 consistently returns the payment object as null always. The store is: demoliveshopping.myshopify.com. 

Any thoughts on how to get over the issue please?

0 Likes
syf_
Shopify Staff
Shopify Staff
81 18 14

Hi @borderfree,

I'd be happy to shed some light on the issue you're facing.

I believe the reason the payment object is always returning a null item is likely because you haven't activated the test payment provider, or set your payment provider to test mode. Check out this help page for steps to enable test payments.

If you have already done the above and are still experiencing issues, please provide us with the request id (found in the response header) of one of the requests not returning the expected response, and we will look into this issue further.

Thanks,

Seth.

syf_ | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

0 Likes
borderfree
New Member
11 0 0

The payment provider is activated. We used bogus gateway, test - stripe with test flag etc. But no luck. After too many followups we found the below answer to fix the issue

Apparently the API /deliver.json documentation has an error.  We changed the JSON body to the below and then did the api: 

checkoutCompleteWithCreditCardV2 and now we see the payment id in the response. 
 

 

{
    "delivery": {
        "payment_method_token": "D06tpj1rSyWdigwTxqgj1oypbwo",
        "url": "https://elb.deposit.shopifycs.com/sessions",
        "headers": "Content-type: application/json",
        "body": "{ \"payment\": { \"credit_card\":{ \"number\": \"{{ credit_card_number }}\", \"month\": \"{{ credit_card_month }}\", \"year\": \"{{ credit_card_year }}\", \"verification_value\": \"{{ credit_card_verification_value }}\", \"first_name\":\"{{ credit_card_first_name }}\", \"last_name\":\"{{ credit_card_last_name }}\"}}}"
    }
}

 

 
0 Likes