A place to discuss charging merchants for your apps and services using the billing API.
Hello, I'm working with the Billing API on a development store. I'm passing {test: true} to the GraphQL AppPurchaseOneTimeCreate mutation, but the payment confirmation screen URL (`confirmationUrl`) that is returned requires me to enter a real credit card. How can I test the payment without having to add a real credit card?
Hi @nick_el,
Thanks for your post!
The recommended method for testing your app's billing system, I would refer to the developer document on testing your apps billing system by using a development store for testing.
You can also refer to the REST and GraphQL on how to complete these tests.
I hope that helps!
To learn more visit the Shopify Help Center or the Community Blog.
Thank you, but the document states
To have your app create a test charge, you can change your app's charge requests to include "test": true. This will create a test charge when you install the app so that you don't incur a real charge on your account.
I'm already passing `{test: true}` (see screenshot) and I am already working on a development store. There is still a screen popping up asking me to enter a credit card. I tried with a real card and then it says "The shop cannot accept the provided charge.".
Any ideas?
EDIT: I'm creating a charge inside of my app, whereas the document appears to talk about charging at the time of app installation. I'm confused, how can an app charge something before it's installed?
@kevnob just following up to see if you could help with my last comment. Thank you!
Hi Nick,
Dit you find a solution for this? We discover the exact same issue where we already send test=true with our call
Hi @StoreContrl_Adm & @nick_el,
I'm facing the same issue, set `test` flag as `true` and confirmation page shows the `test` banner but it has the `approve` button disabled, were you guys able to find a solution for this issue?
Thanks
I didn't sorry. I suggest asking in the Slack channel.
You can try this way with outting the test flag inside the query. That was the working code for us.
That work for me! 👆
Hi everyone, I'm just writing it here in case anyone would need it.
My problem was that I was not changing the query itself and including the test there. You have to change the GraphQL query AND include "test": true in your variables.
My query looks like this:
{
"query": "mutation AppSubscriptionCreate($test: Boolean!, $name: String!, $lineItems: [AppSubscriptionLineItemInput!]!, $returnUrl: URL!) { appSubscriptionCreate(test: $test, name: $name, returnUrl: $returnUrl, lineItems: $lineItems) { userErrors { field message } appSubscription { id } confirmationUrl } }",
"variables": {
"name": "My subscription",
"returnUrl": "http://localhost:3000",
"test": true,
"lineItems": [
{
"plan": {
"appRecurringPricingDetails": {
"price": {
"amount": 10.0,
"currencyCode": "USD"
},
"interval": "EVERY_30_DAYS"
}
}
}
]
}
}