A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
Hi guys, I'm using GraphQL billing API to do a app install payment and here is my query.
{
"query": "mutation AppPurchaseOneTimeCreate($name: String!, $price: MoneyInput!, $returnUrl: URL!){ appPurchaseOneTimeCreate(name: $name, returnUrl: $returnUrl, price: $price) { userErrors { field message } appPurchaseOneTime { createdAt, id, }, confirmationUrl } }",
"variables": {
"name": "TEST one-time purchase",
"test": true,
"returnUrl": "my domain callback",
"price": {
"amount": 1.0,
"currencyCode": "USD"
}
}
}
I have set the "test" as true, but shopify still asking me to add credit card to my account, I cannot use the test charge.
Did I miss anything to do or is there any solution? shopify support only keep post me the document here
Have a look at the documention
You have to pass "test" as an argument to "appPurchaseOneTimeCreate"
Seems like he already did
"test": true,
hmm, maybe not ...
appPurchaseOneTime { createdAt, id, }
should probably include test, eg:
appPurchaseOneTime { createdAt, id, test }
and also include test for:
mutation AppPurchaseOneTimeCreate($name: String!, $price: MoneyInput!, $returnUrl: URL!)
ie:
mutation AppPurchaseOneTimeCreate($name: String!, $price: MoneyInput!, $returnUrl: URL!, $test: Boolean!)
this works for me:
mutation appPurchaseOneTimeCreate($name: String!, $returnUrl: URL!, $price: MoneyInput!, $test: Boolean!) {
appPurchaseOneTimeCreate(name: $name, returnUrl: $returnUrl, price: $price, test: $test) {
userErrors {
field
message
}
appPurchaseOneTime {
createdAt
id
name
price {
amount
currencyCode
}
status
test
}
confirmationUrl
}
}
{
"name": "1000 imported orders.",
"returnUrl": "http://super-duper.shopifyapps.com/",
"price": {
"amount": 10,
"currencyCode": "USD"
},
"test": true
}
Thank you!