Inability to complete a payment using Stripe

New Member
13 0 0
Hi everyone, can you please help us solve the issue of receiving nil value of shopify_payments_account_id from checkout object.
 
Here are the steps to replicate the issue we are seeing:

When the customer makes a checkout, create a checkout object for the transaction. When you create a checkout, Shopify will return the merchant's shopify_payments_account_id.

Send the merchant's shopify_payments_account_id and the card information from your platform account to Stripe using the tokens endpoint. The secret key corresponds to your Stripe secret key which you can grab from the API section of your Stripe account.
 
POST /v1/tokens HTTPS/1.1
Host: api.stripe.com
Authentication: Basic #{secret_key}
Stripe-Account: #{shopify_payments_account_id}

card: {
  number: '4242424242424242',
  exp_month: 12,
  exp_year: 2019,
  cvc: 123
}
But we are getting nil value of shopify_payments_account_id from checkout object.
0 Likes
Shopify Staff
Shopify Staff
135 22 26

Hey @Kevin107 ,

 

Shopify will return a null value for the "shopify_payments_account_id" field for 1 of two reasons:

 

1) Your Shopify shop has not been approved yet for payment processing 

2) Your Shopify shop's payments account does not have a connection with the API Client ID

 

For the 1st reason, you can follow the instructions here to request payment processing via your App Setup screen in your Partner's Dashboard.  Once you have done that, our Partner Specialists will review your application to ensure you meet all the criteria before enabling you to process payments with Stripe

 

Hassain | Developer Support Specialist @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes
Highlighted
New Member
13 0 0

@hassain FYI We are using Admin Rest Api 

1) Your Shopify shop has not been approved yet for payment processing 
       We created an app in partner account in which payment processing is approved. Is there also an option in shopify shop to approve the payment processing?

2) Your Shopify shop's payments account does not have a connection with the API Client ID
     
Is there any api to check the connection? Please let me know what will be the procedure

0 Likes
Shopify Staff
Shopify Staff
135 22 26

Hey @Kevin107 

 

A quick correction from what I mentioned in my comment yesterday. For 1 - a more accurate representation of this condition is that "Your Shopify shop has not yet been enabled with Shopify Payments". From the Shopify documentation, in order to integrate with Stripe to process payments your shop needs to have Shopify Payments activated as their payment gateway. However from what I can see on my end your test store of "top-fan-test.myshopify.com" does not have Shopify Payments enabled yet.

 

"Is there also an option in shopify shop to approve the payment processing?"

 

Yes, to enable Shopify Payments for your shop go to your store's Admin --> Settings --> Payment Providers --> Activate Shopify Payments.

 

Hassain | Developer Support Specialist @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes
New Member
13 0 0

@hassain  If shopify payment is activated only then we can use stripe for payments, But want to know 

POST /v1/tokens HTTPS/1.1
Host: api.stripe.com
Authentication: Basic #{secret_key}
Stripe-Account: #{shopify_payments_account_id}

card: {
  number: '4242424242424242',
  exp_month: 12,
  exp_year: 2019,
  cvc: 123
}

which stripe account "secret_key" will be used here forAuthentication as we disable stripe for payment.
After enabling shopify payments still we are not getting "shopify_payments_account_id" in response.

0 Likes
New Member
13 0 0

@hassain 

 

Now we are getting the value of "shopify_payments_account_id" but we have a question here 

 

 
Send the merchant's shopify_payments_account_id and the card information from your platform account to Stripe using the tokens endpoint. The secret key corresponds to your Stripe secret key which you can grab from the API section of your Stripe account.

POST /v1/tokens HTTPS/1.1
Host: api.stripe.com
Authentication: Basic #{secret_key}
Stripe-Account: #{shopify_payments_account_id}

card: {
  number: '4242424242424242',
  exp_month: 12,
  exp_year: 2019,
  cvc: 123
}

Which stripe account secret_key we should use to further proceed with it? 
If we use shopify payment will amount will goes into stripe account?
0 Likes
New Member
13 0 0

@hassain 
In this i am able to do first 2 steps and now stuck in last step

POST /admin/checkouts/#{token}/payments.json HTTPS/1.1
Host: shop-name.myshopify.com
X-Shopify-Access-Token: #{shopify_access_token}
X-Shopify-Checkout-Version: 2016-08-28

{
  "payment": {
    "amount": "33.00",
    "unique_token": "12345",
    "payment_token": {
      "payment_data": "tok_1AgzvXGp4JCfxblBH7gs5kLB",
      "type": "stripe_vault_token" },
    "request_details": {
      "ip_address": "123.1.1.1",
      "accept_language": "en"
      "user_agent": "Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/54.0.2840.98 Safari\/537.36"
    },
  }
}

getting below error 

{
    "errors": {
        "checkout": {
            "shipping_line": [
                {
                    "code": "blank",
                    "message": "can't be blank",
                    "options": {}
                },
                {
                    "code": "blank",
                    "message": "can't be blank",
                    "options": {
                        "code": null
                    }
                }
            ]
        }
    }
}

Below is the "X-Request-ID" → "255318d4-459b-47d6-a6df-713cb524e2d0". Please verify logs and let me know the reason as i am sending shipping line in checkout too.

0 Likes
Shopify Staff
Shopify Staff
240 33 37

Hey @Kevin107,

 

Thanks for the request ID. I can see you're sending shipping_line parameters when you attempt to create a payment. I believe shipping_line needs to be added to the checkout, not the payment. Can you confirm the checkout has shipping lines?

0 Likes
New Member
13 0 0

@scottydont when i try to create checkout with 

requires_shipping: false

 still it is requiring the shipping_line don't know why? as according to shopify documentation 

requires_shipping
READ-ONLY
"requires_shipping": true

Whether the checkout requires shipping. If true, then shipping_line must be set before creating a payment.

 

 

0 Likes
Excursionist
20 0 3

@scottydont`requires_shipping` is a READONLY field, as you can see.

 

Shopify will make this field `true`, if you have any variants in your checkout that requires shipping. So you are adding products/variants in your checkout line_items that require shipping.

 

This is not a field that you can control on Checkout level. But you can change it in `/admins/products`.

0 Likes