Access denied calling checkoutCompleteWithCreditCard from iOS App

Highlighted
Shopify Partner
13 0 2

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)]

0 Likes
Highlighted
Shopify Staff (Retired)
Shopify Staff (Retired)
624 102 125

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.
 

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
Shopify Partner
13 0 2

@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.

0 Likes
Highlighted
Shopify Partner
13 0 2

@hassain Any update?

 

0 Likes
Highlighted
Shopify Staff (Retired)
Shopify Staff (Retired)
624 102 125

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. 

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
3 0 0

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.

0 Likes