AppSubscriptionCreate [recurring] GraphQL - spring-boot with test mode.

Solved

AppSubscriptionCreate [recurring] GraphQL - spring-boot with test mode.

ssodano
Shopify Partner
11 1 5

Hi all, i'm trying to test app subscription flow, and when i try to create subscription according with this documentation:
https://shopify.dev/docs/api/admin-graphql/2023-01/mutations/appsubscriptioncreate#examples-Create_a...
with the additional parameter (test=true).

After create service end with 200 http status code, it return me an confirmationUrl.
When I click the confirmation URL and get prompted to accept the subscription, I can't see the alert that the payment is in test mode. Where am I doing wrong?

In attachment a prompt that show up.Immagine 2023-03-29 164202.png

Accepted Solution (1)

ssodano
Shopify Partner
11 1 5

This is an accepted solution.

The error was due to the fact that the definition of the test parameter was missing in the query (mutation), for this reason it was if as shopify did not receive that flag to true.

So for my example, 'recurring pricing plan only' [https://shopify.dev/docs/api/admin-graphql/2023-01/mutations/appSubscriptionCreate#examples-Create_a...] just send
with italic parameters added in:

mutation (with  appSubscriptionCreate($lineItems: [AppSubscriptionLineItemInput!]!, $name: String!, $returnUrl: URL!, $test: Boolean) {
appSubscriptionCreate(lineItems: $lineItems, name: $name, returnUrl: $returnUrl, test: $test) {
appSubscription {
# AppSubscription fields
}
confirmationUrl
userErrors {
field
message
}
}
}


View solution in original post

Reply 1 (1)

ssodano
Shopify Partner
11 1 5

This is an accepted solution.

The error was due to the fact that the definition of the test parameter was missing in the query (mutation), for this reason it was if as shopify did not receive that flag to true.

So for my example, 'recurring pricing plan only' [https://shopify.dev/docs/api/admin-graphql/2023-01/mutations/appSubscriptionCreate#examples-Create_a...] just send
with italic parameters added in:

mutation (with  appSubscriptionCreate($lineItems: [AppSubscriptionLineItemInput!]!, $name: String!, $returnUrl: URL!, $test: Boolean) {
appSubscriptionCreate(lineItems: $lineItems, name: $name, returnUrl: $returnUrl, test: $test) {
appSubscription {
# AppSubscription fields
}
confirmationUrl
userErrors {
field
message
}
}
}