Access denied calling checkoutCompleteWithCreditCard from iOS App

Rishabh_Tayal
Shopify Partner
22 0 4

I am trying to use checkout graphql API in iOS mobile buy sdk. The storefront token has access 

unauthenticated_read_content,unauthenticated_read_product_listings,unauthenticated_read_collection_listings,unauthenticated_write_checkouts,unauthenticated_read_checkouts,unauthenticated_write_customers,unauthenticated_read_customers

 

I am using Shopify vault to convert the credit card information to a vault token. and then send that token to complete checkout mutation: 

checkoutCompleteWithCreditCardV2

 

I am getting error

[Buy.Graph.QueryError.Reason(message: "CheckoutCompleteWithCreditCardV2 access denied", line: nil, column: nil)]

Replies 5 (5)

hassain
Shopify Staff (Retired)
624 104 187

Hey @Rishabh_Tayal 

 

As per the Storefront-API checkout guide,  to complete a checkout using the checkoutCompleteWithCreditCardv2 mutation you need to have the `write_checkouts_payments` scope enabled for your app. This scope is enabled by turning your app into a sales channel app and then requesting for payment processing

 
As a simpler workaround, the simplest way to complete a checkout is by redirecting the customer to a web view where they will be presented with the same flow that they're familiar with on the web. The Storefront.Checkout resource provides a webUrl that you can use to present a web view.
 

To learn more visit the Shopify Help Center or the Community Blog.

Rishabh_Tayal
Shopify Partner
22 0 4

@hassain Thanks for your response. Our app is listed as 'sales channel'. I have also requested for payment processing access. However our request is not getting approved saying we don't have proper use case for the payment processing.

 

I am aware of the web checkout flow. We already have that feature in the mobile app and now would like to be able to add a native checkout using the checkoutCompleteWithCreditCardv2 mutation.

Rishabh_Tayal
Shopify Partner
22 0 4

@hassain Any update?

 

hassain
Shopify Staff (Retired)
624 104 187

Hey @Rishabh_Tayal ,

 

Thank you for all of the additional information.

 

As mentioned in my previous comment in order to use the checkoutCompleteWithCreditCardv2 mutation you will need to have the `write_checkouts_payments` scope enabled for your app, and this scope can only be enabled by being a sales channel app and receiving access for payment processing. So if you were not approved for payment processing for your use case, then you will not be able to use this mutation. 

 

In your situation, remaining with your current web checkout flow would be the best (in terms of ease of implementation and for security purposes) and only viable solution for completing the checkout in your app. 

To learn more visit the Shopify Help Center or the Community Blog.

Saminath_Krisna
Tourist
4 0 1

I got permission for payment processing by filling out this form https://docs.google.com/forms/d/e/1FAIpQLSfaiwWJwTsMKKi6Sl-qfiLMwKRKyZ9TxBuutumkk6ThisFTUg/viewform. I'm still getting the “CheckoutCompleteWithCreditCardV2 access denied” error when I try to make a GraphQL query using mobileBuySDK. Our app is a sales channel and has access to Checkout API.Screenshot 2020-07-09 at 1.00.51 PM.png

I'm using the card Vault https://github.com/Shopify/mobile-buy-sdk-ios/#card-vaulting- for generating the token and followed this process https://github.com/Shopify/mobile-buy-sdk-ios/#credit-card-checkout- to checkout using credit card. This is where I get the “CheckoutCompleteWithCreditCardV2 access denied” error. Can you let me know why this may be happening? or how can we make sure that write_checkouts_payments scope is enabled for our app ?
Any help would be appreciated. Thanks.