Test transaction fails using the checkoutCompleteWithCreditCardV2 api method

borderfree
New Member
11 0 0

I'm not able to do a test transaction using the checkoutCompleteWithCreditCardV2 API method.

If I use the Bogus gateway I get an invalid credit card error(I'm using the test Shopify credit cards) and if I use a demo account of a third party gateway I do not get any errors but the payment Id in the response is null as shown below:

 

{
    "data": {
        "checkoutCompleteWithCreditCardV2": {
            "checkout": {
                "id": "**my checkout id **"
            },
            "checkoutUserErrors": [],
            "payment": null
        }
    }
}

 

0 Likes
borderfree
New Member
11 0 0

Hi,

I am adding the full context here. Adding the Postman queries for a detailed understanding of the issue:

1) Response: 

{
"data": {
"products": {
"edges": [
{
"node": {
"variants": {
"edges": [
{
"node": {
"id": "Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0VmFyaWFudC8zNzgyMDY5MTE4NTg2Mg=="
}
}
]
}
}
}
 
 
]
}
}
}
2) Query:
mutation {
checkoutCreate(input: {
lineItems: [{ variantId: "Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0VmFyaWFudC8zNzgyMDY5MTE4NTg2Mg==", quantity: 1 }]
}) {
checkout {
id
webUrl
lineItems(first: 2) {
edges {
node {
title
quantity
}
}
}
}
}
}
 
Graphql Variables:
{
"input" : {}
}
Response: 
{
"data": {
"checkoutCreate": {
"checkout": {
"id": "Z2lkOi8vc2hvcGlmeS9DaGVja291dC81NmVkMTcxZDZkMzQ3NjM1YWRhY2M3MDdiN2JhOTY2ND9rZXk9YzEzZjM4Y2U1YjFlYzI4ODFkM2Y4OWUwOTdjYzNiZTc=",
"lineItems": {
"edges": [
{
"node": {
"title": "Tesla Hyperlight Eyewear - Blue Aviator",
"quantity": 1
}
}
]
}
}
}
}
}
 
 
3) Query:
mutation checkoutShippingAddressUpdateV2($shippingAddress: MailingAddressInput!, $checkoutId: ID!) {
checkoutShippingAddressUpdateV2(shippingAddress: $shippingAddress, checkoutId: $checkoutId) {
userErrors {
field
message
}
checkout {
id
shippingAddress {
firstName
lastName
address1
province
country
zip
}
}
}
}
 
Graphql variables:
{
"shippingAddress": {
"lastName": "XXXXX",
"firstName": "XXXXXX",
"address1": "XXXXXXX",
"province": "CA",
"country": "US",
"zip": "XXXXXX",
"city": "XXXXXXX"
},

"checkoutId": "Z2lkOi8vc2hvcGlmeS9DaGVja291dC81NmVkMTcxZDZkMzQ3NjM1YWRhY2M3MDdiN2JhOTY2ND9rZXk9YzEzZjM4Y2U1YjFlYzI4ODFkM2Y4OWUwOTdjYzNiZTc="
}
 
 
Response:
{
"data": {
"checkoutShippingAddressUpdateV2": {
"userErrors": [],
"checkout": {
"id": "Z2lkOi8vc2hvcGlmeS9DaGVja291dC81NmVkMTcxZDZkMzQ3NjM1YWRhY2M3MDdiN2JhOTY2ND9rZXk9YzEzZjM4Y2U1YjFlYzI4ODFkM2Y4OWUwOTdjYzNiZTc=",
"shippingAddress": {
"firstName": "XXXXXX",
"lastName": "XXXXXXX",
"address1": "XXXXXXXXX",
"province": "California",
"country": "United States",
"zip": "XXXXXXX"
}
}
}
}
}
 
4) Query:
mutation checkoutEmailUpdateV2($checkoutId: ID!, $email: String!) {
checkoutEmailUpdateV2(checkoutId: $checkoutId, email: $email) {
checkout {
id
}
checkoutUserErrors {
code
field
message
}
}
}
 
graphql variables: 
{ "checkoutId": "Z2lkOi8vc2hvcGlmeS9DaGVja291dC81NmVkMTcxZDZkMzQ3NjM1YWRhY2M3MDdiN2JhOTY2ND9rZXk9YzEzZjM4Y2U1YjFlYzI4ODFkM2Y4OWUwOTdjYzNiZTc=",
"email": "xxxxxx@xxxx.xxx"
}
 
response:
{
"data": {
"checkoutEmailUpdateV2": {
"checkout": {
"id": "Z2lkOi8vc2hvcGlmeS9DaGVja291dC81NmVkMTcxZDZkMzQ3NjM1YWRhY2M3MDdiN2JhOTY2ND9rZXk9YzEzZjM4Y2U1YjFlYzI4ODFkM2Y4OWUwOTdjYzNiZTc="
},
"checkoutUserErrors": []
}
}
}
 
5) query:
query {
node(id: "Z2lkOi8vc2hvcGlmeS9DaGVja291dC81NmVkMTcxZDZkMzQ3NjM1YWRhY2M3MDdiN2JhOTY2ND9rZXk9YzEzZjM4Y2U1YjFlYzI4ODFkM2Y4OWUwOTdjYzNiZTc=") {
... on Checkout {
id
webUrl
availableShippingRates {
ready
shippingRates {
handle
priceV2 {
amount
}
title
}
}
}
}
}
graphql variable:
 
response:
 
{
"data": {
"node": {
"id": "Z2lkOi8vc2hvcGlmeS9DaGVja291dC81NmVkMTcxZDZkMzQ3NjM1YWRhY2M3MDdiN2JhOTY2ND9rZXk9YzEzZjM4Y2U1YjFlYzI4ODFkM2Y4OWUwOTdjYzNiZTc=",
"availableShippingRates": {
"ready": true,
"shippingRates": [
{
"handle": "shopify-Standard-16.72",
"priceV2": {
"amount": "16.72"
},
"title": "Standard"
}
]
}
}
}
}
 
 
6) Query:
mutation checkoutShippingLineUpdate($checkoutId: ID!, $shippingRateHandle: String!) {
checkoutShippingLineUpdate(checkoutId: $checkoutId, shippingRateHandle: $shippingRateHandle) {
checkout {
id
}
checkoutUserErrors {
code
field
message
}
}
}
 
graphql variables:
{
"checkoutId": "Z2lkOi8vc2hvcGlmeS9DaGVja291dC81NmVkMTcxZDZkMzQ3NjM1YWRhY2M3MDdiN2JhOTY2ND9rZXk9YzEzZjM4Y2U1YjFlYzI4ODFkM2Y4OWUwOTdjYzNiZTc=",
"shippingRateHandle": "shopify-Standard-16.72"
}
 
response:
{
"data": {
"checkoutShippingLineUpdate": {
"checkout": {
"id": "Z2lkOi8vc2hvcGlmeS9DaGVja291dC81NmVkMTcxZDZkMzQ3NjM1YWRhY2M3MDdiN2JhOTY2ND9rZXk9YzEzZjM4Y2U1YjFlYzI4ODFkM2Y4OWUwOTdjYzNiZTc="
},
"checkoutUserErrors": []
}
}
}
 
7) query:
query {
node(id: "Z2lkOi8vc2hvcGlmeS9DaGVja291dC81NmVkMTcxZDZkMzQ3NjM1YWRhY2M3MDdiN2JhOTY2ND9rZXk9YzEzZjM4Y2U1YjFlYzI4ODFkM2Y4OWUwOTdjYzNiZTc=") {
... on Checkout {
id
webUrl
totalPrice
currencyCode
}
}
}
 
graphql variables:
 
response:
{
"data": {
"node": {
"id": "Z2lkOi8vc2hvcGlmeS9DaGVja291dC81NmVkMTcxZDZkMzQ3NjM1YWRhY2M3MDdiN2JhOTY2ND9rZXk9YzEzZjM4Y2U1YjFlYzI4ODFkM2Y4OWUwOTdjYzNiZTc=",
"totalPrice": "478.72",
"currencyCode": "EUR"
}
}
}
 
8)query:
{
"payment_method": {
"credit_card": {
"first_name": "XXXXXX",
"last_name": "XXXXXX",
"number": "XXXXXXXXXXXXXXX",
"verification_value": "XXX",
"month": "XX",
"year": "XXXX",
"email": "XXXXXXXXX@XXXX.XXX"
},
"data": {
"my_payment_method_identifier": "448",
"extra_stuff": {
"some_other_things": "Can be anything really"
}
}
}
}
 
 Response:
 
{
"transaction": {
"token": "HaGzfiGDvajTTGRNFEmJtRtqEvG",
"created_at": "2020-12-28T17:49:10Z",
"updated_at": "2020-12-28T17:49:10Z",
"succeeded": true,
"transaction_type": "AddPaymentMethod",
"retained": false,
"state": "succeeded",
"message_key": "messages.transaction_succeeded",
"message": "Succeeded!",
"payment_method": {
"token": "La2PXQPsvnGqLYF8g1xdZ1y7YTw",
"created_at": "2020-12-28T17:49:10Z",
"updated_at": "2020-12-28T17:49:10Z",
"email": "XXXXXXXXXX@XXXX.XX",
"data": {
"my_payment_method_identifier": "448",
"extra_stuff": {
"some_other_things": "Can be anything really"
}
},
"storage_state": "cached",
"test": false,
"metadata": null,
"callback_url": null,
"last_four_digits": "XXXX",
"first_six_digits": "XXXXXX",
"card_type": "XXXXXX",
"first_name": "XXXXX",
"last_name": "XXXXX",
"month": XX,
"year": XXXX,
"address1": null,
"address2": null,
"city": null,
"state": null,
"zip": null,
"country": null,
"phone_number": null,
"company": null,
"full_name": "XXXXXX XXXXXXX",
"eligible_for_card_updater": true,
"shipping_address1": null,
"shipping_address2": null,
"shipping_city": null,
"shipping_state": null,
"shipping_zip": null,
"shipping_country": null,
"shipping_phone_number": null,
"payment_method_type": "credit_card",
"errors": [],
"fingerprint": "cc5f5a5fbbe2f44cb7b8ecbe0f5566acd1da",
"verification_value": "XXX",
"number": "XXXX-XXXX-XXXX-XXXX"
}
}
}
 
9) Query:
{
"delivery": {
"payment_method_token": "La2PXQPsvnGqLYF8g1xdZ1y7YTw",
"headers": "Content-type: application/json",
"body": "{ \"payment\": { \"credit_card\":{ \"number\": \"\", \"month\": \"\", \"year\": \"\", \"verification_value\": \"\", \"first_name\":\"\", \"last_name\":\"\"}}}"
}
}
 
response:
 
{
"transaction": {
"token": "35xC1lG4KIipymMjwFqVINOQRuE",
"transaction_type": "DeliverPaymentMethod",
"state": "succeeded",
"created_at": "2020-12-28T17:49:22Z",
"updated_at": "2020-12-28T17:49:22Z",
"succeeded": true,
"message": "Succeeded!",
"response": {
"status": 200,
"headers": "Server: nginx\r\nDate: Mon, 28 Dec 2020 17:49:22 GMT\r\nContent-Type: application/json\r\nContent-Length: 46\r\nConnection: close\r\nVary: Accept-Encoding\r\nAccess-Control-Allow-Origin: *\r\nStrict-Transport-Security: max-age=31536000; includeSubDomains; preload\r\nP3P: CP=\"NOI DSP COR NID ADMa OPTa OUR NOR\"",
"body": "{\"id\":\"east-xxxxxxxxxxxxxxxxxxxxxxxxx\"}"
},
"receiver": {
"company_name": "Shopify",
"receiver_type": "shopify",
"token": "U0qBHjMmS2YoUlmpQEj7Fhsls92",
"state": "retained",
"created_at": "2020-09-03T19:23:42Z",
"updated_at": "2020-09-03T19:23:42Z",
"credentials": null
},
"payment_method": {
"token": "La2PXQPsvnGqLYF8g1xdZ1y7YTw",
"created_at": "2020-12-28T17:49:10Z",
"updated_at": "2020-12-28T17:49:22Z",
"email": "xxxxxxxxxx@xxxxxx.xxx",
"data": {
"my_payment_method_identifier": "448",
"extra_stuff": {
"some_other_things": "Can be anything really"
}
},
"storage_state": "used",
"test": false,
"metadata": null,
"callback_url": null,
"last_four_digits": "XXXX",
"first_six_digits": "XXXXXX",
"card_type": "XXXXX",
"first_name": "XXXXX",
"last_name": "XXXXXXX",
"month": XX,
"year": XXXX,
"address1": null,
"address2": null,
"city": null,
"state": null,
"zip": null,
"country": null,
"phone_number": null,
"company": null,
"full_name": "XXXXX XXXXX",
"eligible_for_card_updater": true,
"shipping_address1": null,
"shipping_address2": null,
"shipping_city": null,
"shipping_state": null,
"shipping_zip": null,
"shipping_country": null,
"shipping_phone_number": null,
"payment_method_type": "credit_card",
"errors": [],
"fingerprint": "cc5f5a5fbbe2f44cb7b8ecbe0f5566acd1da",
"verification_value": "",
"number": "XXXX-XXXX-XXXX-XXXX"
}
}
}
 
10) Query:
mutation checkoutCompleteWithCreditCardV2($checkoutId: ID!, $payment: CreditCardPaymentInputV2!) {
checkoutCompleteWithCreditCardV2(checkoutId: $checkoutId, payment: $payment) {
checkout {
id
}
checkoutUserErrors {
code
field
message
}
payment {
id
}
}
}
 
graphql variables:
{
"checkoutId": "Z2lkOi8vc2hvcGlmeS9DaGVja291dC81NmVkMTcxZDZkMzQ3NjM1YWRhY2M3MDdiN2JhOTY2ND9rZXk9YzEzZjM4Y2U1YjFlYzI4ODFkM2Y4OWUwOTdjYzNiZTc=",
"payment": {
"paymentAmount": {
"amount": "478.71",
"currencyCode": "EUR"
},
"idempotencyKey": "124",
"billingAddress": {
"firstName": "XXXXXX",
"lastName": "XXXXXX",
"address1": "XXXXXXXXXXXX",
"province": "CA",
"country": "US",
"city": "XXXXXX",
"zip": "XXXXX"
},
"test": true,
"vaultId": "east-xxxxxxxxxxxxxxxxxxxxxxx"
}
}
 
Response:
{
"data": {
"checkoutCompleteWithCreditCardV2": {
"checkout": {
"id": "Z2lkOi8vc2hvcGlmeS9DaGVja291dC81NmVkMTcxZDZkMzQ3NjM1YWRhY2M3MDdiN2JhOTY2ND9rZXk9YzEzZjM4Y2U1YjFlYzI4ODFkM2Y4OWUwOTdjYzNiZTc="
},
"checkoutUserErrors": [],
"payment": null
}
}
}
 
 
Please let me know if you require any other information for this case.
0 Likes
borderfree
New Member
11 0 0

Any update on this please?

0 Likes
borderfree
New Member
11 0 0

Hi,

I am adding the Postman queries for a detailed understanding of the issue:

1) Query:

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

 

response:

{
"transaction": {
"token": "35xC1lG4KIipymMjwFqVINOQRuE",
"transaction_type": "DeliverPaymentMethod",
"state": "succeeded",
"created_at": "2020-12-28T17:49:22Z",
"updated_at": "2020-12-28T17:49:22Z",
"succeeded": true,
"message": "Succeeded!",
"url": "https://elb.deposit.shopifycs.com/sessions",
"response": {
"status": 200,
"headers": "Server: nginx\r\nDate: Mon, 28 Dec 2020 17:49:22 GMT\r\nContent-Type: application/json\r\nContent-Length: 46\r\nConnection: close\r\nVary: Accept-Encoding\r\nAccess-Control-Allow-Origin: *\r\nStrict-Transport-Security: max-age=31536000; includeSubDomains; preload\r\nP3P: CP=\"NOI DSP COR NID ADMa OPTa OUR NOR\"",
"body": "{\"id\":\"east-b66cdcfa8f2d87ded029d220e986c658\"}"
},
"receiver": {
"company_name": "Shopify",
"receiver_type": "shopify",
"token": "U0qBHjMmS2YoUlmpQEj7Fhsls92",
"hostnames": "https://elb.deposit.shopifycs.com/",
"state": "retained",
"created_at": "2020-09-03T19:23:42Z",
"updated_at": "2020-09-03T19:23:42Z",
"credentials": null
},
"payment_method": {
"token": "La2PXQPsvnGqLYF8g1xdZ1y7YTw",
"created_at": "2020-12-28T17:49:10Z",
"updated_at": "2020-12-28T17:49:22Z",
"email": "xxxxxxxxxx@xxxxxx.xxx",
"data": {
"my_payment_method_identifier": "448",
"extra_stuff": {
"some_other_things": "Can be anything really"
}
},
"storage_state": "used",
"test": false,
"metadata": null,
"callback_url": null,
"last_four_digits": "XXXX",
"first_six_digits": "XXXXXX",
"card_type": "XXXXX",
"first_name": "XXXXX",
"last_name": "XXXXXXX",
"month": XX,
"year": XXXX,
"address1": null,
"address2": null,
"city": null,
"state": null,
"zip": null,
"country": null,
"phone_number": null,
"company": null,
"full_name": "XXXXX XXXXX",
"eligible_for_card_updater": true,
"shipping_address1": null,
"shipping_address2": null,
"shipping_city": null,
"shipping_state": null,
"shipping_zip": null,
"shipping_country": null,
"shipping_phone_number": null,
"payment_method_type": "credit_card",
"errors": [],
"fingerprint": "cc5f5a5fbbe2f44cb7b8ecbe0f5566acd1da",
"verification_value": "",
"number": "XXXX-XXXX-XXXX-XXXX"
}
}
}

 

2) query:

mutation checkoutCompleteWithCreditCardV2($checkoutId: ID!, $payment: CreditCardPaymentInputV2!) {
checkoutCompleteWithCreditCardV2(checkoutId: $checkoutId, payment: $payment) {
checkout {
id
}
checkoutUserErrors {
code
field
message
}
payment {
id
}
}
}

 

 graphql variables:

{
"checkoutId": "Z2lkOi8vc2hvcGlmeS9DaGVja291dC81NmVkMTcxZDZkMzQ3NjM1YWRhY2M3MDdiN2JhOTY2ND9rZXk9YzEzZjM4Y2U1YjFlYzI4ODFkM2Y4OWUwOTdjYzNiZTc=",
"payment": {
"paymentAmount": {
"amount": "478.71",
"currencyCode": "EUR"
},
"idempotencyKey": "124",
"billingAddress": {
"firstName": "XXXXXX",
"lastName": "XXXXXX",
"address1": "XXXXXXXXXXXX",
"province": "CA",
"country": "US",
"city": "XXXXXX",
"zip": "XXXXX"
},
"test": true,
"vaultId": "east-b66cdcfa8f2d87ded029d220e986c658"
}
}
 

 

response:

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

 

Please let me know if you require any other information for this case.

0 Likes
borderfree
New Member
11 0 0

Hi,

Please let me know if there is any update.

0 Likes
borderfree
New Member
11 0 0

Hi,

Is there any update on this?

0 Likes
borderfree
New Member
11 0 0

Hi,

Please let me know if there is any update.

0 Likes
borderfree
New Member
11 0 0

Hi,

Any update on this please?

0 Likes
borderfree
New Member
11 0 0

Shopify Support team. 

 

Any update on this please. we are stuck on it since Dec. Atleast can somebody tell the areas we have to check to get this fixed? 

context:

we are following this tutorial. https://shopify.dev/tutorials/complete-a-sales-channel-payment-with-checkout-api.

Every thing works fine. Except that in the lat step for this api: checkoutCompleteWithCreditCardV2 we get null object for the payment, in the response. 

 

What all have we tried till now?

  1. we change the payment gateway to bogus gate way; tested with the test creditcards
  2. we configured paysafe production payment gateway and tested with real creditcards issues in USA; India. 

none of the above work. we get the same null object for the payment in the response. 

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

 

Guys this issue has been since Dec 16th. I request somebody to kindly look into the issue and help us understand where we are doing the mistake. 

 

0 Likes