FROM CACHE - en_header

Storefront API: Orders not showing up after calling checkoutCompleteWithTokenizedPaymentV3

Sterling_Smith
Excursionist
19 0 6

Am I missing an additional step?  The return Checkout object has an order field that's just "null," and nothing is showing up in my Shopify admin dashboard under orders.  I've followed this documentation very specifically (adjusting to the checkoutCompleteWithTokenizedPaymentV3 endpoint) and still no luck.

 

Any help would be appreciated!

Replies 24 (24)
_JB
Shopify Staff
Shopify Staff
836 99 211

Hey @Sterling_Smith,

 

There are a few requirements that your app needs before you can use this mutation, this guide shows the V2 mutation but the requirements are the same. Please make sure your app has filled these requirements before trying that mutation.

 

If that looks good, can you kindly provide more information about the response you're seeing when you send this mutation? Ideally, if you can provide the X-Request-ID from the response header I can use that to pin-point your request in our logs.

JB | Solutions Engineer @ Shopify 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

Sterling_Smith
Excursionist
19 0 6

Hi, thanks for the response

 

It looks like we have payments set up as according to that documentation, so here is our x-request-id header: f39dd67b-cef9-46c5-b99a-c44f549f092c

 

It looks like even though a legitimate credit card was provided, the response object includes a payment object that looks like:

 

 

"payment": {
  "id": "Z2lkOi8vc2hvcGlmeS9QYXltZW50LzE0OTU4MTUxMjcwODk/Y2hlY2tvdXQ9NmJiMzVkMTVmYWI5ZTRjYmJmMWIxN2I0MGFkOGZmMDUma2V5PWNhOGIyZjU5NjAxM2NlOWIzNzUxYmIyYzhkMzliNTBi",
  "test": false,
  "ready": false,
  "errorMessage": null,
  "transaction": null,
  "nextActionUrl": null,
  "creditCard": null
},

the card provided was tokenized via Shopify, using the 

https://elb.deposit.shopifycs.com/sessions

endpoint

 

Sterling_Smith
Excursionist
19 0 6

Hello there,

 

We've made some progress and are now seeing this error in our store when attempting to complete and pay for a checkout order

Screen Shot 2020-05-13 at 12.35.42 PM.png

 

With not much to go on, is there anything you would suggest we try?

daniel_sonny
Excursionist
12 0 4

Hello. I'm facing the same issue but with a Apple Pay payment token.

 

Basically, We manage to create a checkout, fill it with items but the checkoutCompleteWithTokenizedPaymentV3 doens't return a "order" and neither a error in "checkoutUserErrors" field once we call the mutation to complete the checkout.

 

Is there a way to debug the issue? is there a log registry we can check to understand the issue.

 

More over the documentation seems a clunky and misses of what data we should send from the Apple pay response that we get from the Swift native feature with PassKit.

Sterling_Smith
Excursionist
19 0 6

Yep!  This same thing is also happening to us with an Apple Pay token as well

daniel_sonny
Excursionist
12 0 4

Hey mate @Sterling_Smith. How did you mange to get at least an error in their dashboard for the current checkout? Our Checkouts we do programmatically are just displayed in the "abandoned" section.

 

The situation with this mutation seems a bit messy to me.

lukasz_gj
New Member
1 0 0

I am facing with the same issue.
Do you know if it is a temporary problem?
I would like to proceed with implementation.

@Sterling_Smith how you managed to see errors?

Sterling_Smith
Excursionist
19 0 6

The error we are now seeing is still located in the Abandoned Checkouts section of our dashboard, when we click on one of the checkouts in the list, it shows up at the bottom.

 

We were able to get this far by ensuring that everything related to accepting payments in the store (not the app, but the store we were trying to place orders with) was set up properly (Settings -> Payments), but that new error is still there

daniel_sonny
Excursionist
12 0 4

@Sterling_Smith Ok, basically is what we have now. I mean the Abandoned checkouts section full of our tries, but without errors you see.

 

@_JB Could you please address us?

_JB
Shopify Staff
Shopify Staff
836 99 211

Hello all,

 

Looking in to this as we speak. If possible, please provide the X-Request-ID from a response with an empty payment object, and I can use this to find the request in our logs and get more information from there.

JB | Solutions Engineer @ Shopify 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

_JB
Shopify Staff
Shopify Staff
836 99 211

@Sterling_Smith @daniel_sonny @lukasz_gj,

 

Can you confirm if you're processing real or test payments on these checkouts? I'm seeing some errors in our logs related to the vaulted card, but we aren't able to see much in our logs when it comes to payments so any clarification you can provide will be helpful.

JB | Solutions Engineer @ Shopify 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

daniel_sonny
Excursionist
12 0 4

@_JB thanks for you help. Tomorrow I'll provide you some requests ids.

 

In the meantime, we are trying with real translations on Apple pay on our app. For sure we missed something, but we don't really able to understand what is missing in our config.

 

What I really don't understand is why you don't return an error on mutation execution and it would be good to have a events log as Stripe has, for example.

 

Sterling_Smith
Excursionist
19 0 6

Thank you for the response @_JB 

 

The request header is: 

"x-request-id":"3889712b-591f-414f-bbc5-9679ec99c67d",

 

I know that the store's payment processing has not be set to test mode, and for whatever reason when trying to tokenize a credit card in the vault using the "test" parameter, it returns an error saying that test cards are not available.  We are trying to use a real credit card.

daniel_sonny
Excursionist
12 0 4

We manage to fix this issue by sending the entire JSON returned by Apple Pay Native sdk to checkoutCompleteWithTokenizedPaymentV3, and not just the payment token.

 

Nice, but my suggestions still:

  1. add more info in the documentation on how to use your API with ApplePay and GooglePay.
  2. add errors to understand what happened.
Sterling_Smith
Excursionist
19 0 6

Hi @daniel_sonny do you think you could provide the format of the request you're sending to the checkoutCompleteWithTokenizedPaymentV3 endpoint?  Minus any sensitive info of course.  I just want to be sure since I think we're using different SDKs to retrieve the apple pay token but both attempting to use it for the same purpose.

 

@_JB any further insight based on the provided info would be really appreciated, this is a bit urgent as it's affecting our live app

daniel_sonny
Excursionist
12 0 4

This is the mutation we use following the specs of their (GraphQL) mutations:

export const checkoutCompleteWithTokenizedPaymentV3 = `mutation checkoutCompleteWithTokenizedPaymentV3(
  $checkoutId: String
  $payment: TokenizedPaymentInputV3!
) {
  checkoutCompleteWithTokenizedPaymentV3(
    checkoutId: $checkoutId
    payment: $payment
  ) {
    checkout {
      id
      webUrl
      subtotalPriceV2 {
        amount
      }
      availableShippingRates {
        ready
        shippingRates {
          handle
          priceV2 {
            amount
          }
          title
        }
      }
      shippingLine {
        priceV2 {
          amount
        }
      }
      lineItems(first: 20) {
        edges {
          node {
            id
            title
            quantity
          }
        }
      }
      orderStatusUrl
      order {
        name
        email
        orderNumber
        financialStatus
        fulfillmentStatus
        currentTotalPrice {
          amount
        }
        subtotalPriceV2 {
          amount
        }
        cancelReason
      }
    }
    checkoutUserErrors {
      code
      field
      message
    }
    payment {
      id
      amountV2 {
        amount
      }
      ready
      test
      transaction {
        amountV2 {
          amount
        }
        kind
        statusV2
        test
      }
    }
  }
}
`

Where TokenizedPaymentInputV3 is

const payment: TokenizedPaymentInputV3 = {
      paymentAmount: {
        amount: paymentAmount.amount,
        currencyCode,
      },
      idempotencyKey: ....,
      billingAddress: shippingAddress,
      type,
      paymentData: String,
    };

where paymentToken is the String (an escaped JSON) provided by native Apple pay mobile SDK (PassKit).

 

I hope this could be helpful for you.

Sterling_Smith
Excursionist
19 0 6

@daniel_sonny thanks for the response.  Unfortunately it seems like escaping the JSON response that we're getting (using React-Native-Payments) doesn't cause the payment to be accepted or orders to show up.

 

Just to be clear, are you still experiencing trouble when trying to check out with a vaulted credit card?  Were you only able to solve this for Apple Pay?

 

Thanks!

_JB
Shopify Staff
Shopify Staff
836 99 211

Hey @Sterling_Smith,

 

So far I haven't been able to replicate the behaviour you've described. I have an app setup on my test store with the same scopes as your app, but the  checkoutCompleteWithTokenizedPaymentV3mutation works for me as expected. I'm hoping you can confirm a few more things: 

 

-The test shop you're using currently has the storefront password enabled, can you confirm that you're disabling the storefront password on that shop before testing?

 

-Can you confirm if you're seeing the same error when using the V2 versions of the mutations?

 

As well, I'd like to ask that you try your tests again by enabling "test mode" on your test shop's gateway. With test mode enabled, you can send through  4012 8888 8888 1881as the credit card number, any year/month combo in the future, and any 3 digit CVV code. This will prevent you from needing to use a real card for testing, and will help rule out any issues with the card as being related to the issue.

 

Please let me know about the above, and don't hesitate to reach out if there are any questions.

JB | Solutions Engineer @ Shopify 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

Sterling_Smith
Excursionist
19 0 6

Hi @_JB 

 

Thanks for your response.  We've disabled password protection on the store in question, as well as set payments to test mode.  We used a test card, but it still wasn't working, so I thought to combine the advice given by @daniel_sonny and see if I could pass the escaped JSON that was returned from the Shopify Card Vault as the paymentData parameter.  Still no dice, but I did receive the same error (see this post from earlier) in the Abandoned Checkouts control panel, just like before.  So I'm thinking it has something to do with the paymentData parameter, since I seem to get that error with either way I proved the vault id.

 

Can you reassure me that I'm doing this correctly?  My order of operations is as follows:

 

- A user enters their credit card data into a form field in our app.

- We send that form data to 'https://elb.deposit.shopifycs.com/sessions' and receive an ID from the Shopify Card Vault as a JSON response (formatted like '{"id":"idstringgoeshere"}') 

- That ID is then provided as an input object (as part of a TokenizedPaymentInputV3) on a mutation of checkoutCompleteWithTokenizedPaymentV3 using the Storefront API

 

If something in the mutation wasn't formatted correctly it would usually return an error, we've seen errors like this in the past.  But everything does seem to go through fine, no errors are returned from the mutation request.  It's only when we check the Abandoned Checkouts that we see there was an issue.

 

The x-request-id of the latest request we made is: "ec233e51-dccf-4ff0-ac22-ad32d2ae9d51"

 

Could we be formatting something wrong in the TokenizedPaymentInputV3?