Sales Channel - Payment API & SDK

batyr
New Member
1 0 0

Hello Shopify Community!

 

Our team is building a Sales Channel and got stuck on the Payment step. We are planning to use Shopify Payment API to finish a checkout process on our side. Thus, we have created a Stripe (Connect) Account in order to tokenise credit cards without sending them to Shopify Card Vault and being PCI-compliant. We have also been granted an access to Payment API from Shopify and got a confirmation from Stripe.

 

As a main information source, we use this link - https://shopify.dev/apps/channels/complete-payment, where all the steps are explained. While completing the payment through Stripe (https://shopify.dev/apps/channels/complete-payment#complete-a-payment-using-stripe), we need to tokenise a credit card from the client app and then send it to the server to complete a payment. While tokenising a credit card, we are sending the Stripe ID of our platform.  

 

After we get the token, we are sending this request to complete a payment (https://shopify.dev/api/admin-rest/2021-10/resources/payment#[post]/admin/api/2021-10/checkouts/{tok...

 

 

 

{
  amount: '35.68',
  payment_token: {
    payment_data: 'tok_1JzAbaLDvjFqzeOO9XjnEYiE',
    type: 'stripe_vault_token'
  },
  token: '6b08443debb04c4a0994d4ff41c6ceb2',
  unique_token: '11fnx85dpz',
  request_details: {
    ip_address: '79.140.114.51',
    user_agent: 'mobile-app/1 CFNetwork/1325.0.1 Darwin/21.1.0',
    accept_language: 'en-GB,en;q=0.9'
  }
}

 

 

 

 

And in response, we get a payment object with an error: `Invalid token id: tok_1JzAbaLDvjFqzeOO9XjnEYiE`:

 

 

 

{
  id: 2894626226342,
  unique_token: '11fnx85dpz',
  payment_processing_error_message: 'Invalid token id: tok_1JzAbaLDvjFqzeOO9XjnEYiE',
  next_action: { redirect_url: null },
  fraudulent: true,
  transaction: null,
  credit_card: null,
  checkout: {
    completed_at: null,
    created_at: '2021-11-24T02:48:36+01:00',
    currency: 'USD',
...
}

 

 

 

 

Have anyone faced the same issue?

I am just wondering that, in the docs it's said that Stripe ID has to be one that's coming from a created checkout in shopify_payment_account_id field which actually makes sense. And this is why probably, Shopify can not match the tokens. However, I was told from Shopify Support that we have to use the Stripe ID of our platform. I am a bit confused about it and would appreciate your help!

 

P.S. There is also a mistake in the docs here - https://shopify.dev/apps/channels/complete-payment, step 2, when sending a request to tokenise a credit card.

In a request, header should be `Authorization: `Bearer #{secret_key}`` instead of `Authentication: Basic #{secret_key}`.

Replies 0 (0)