Recurring charges confirmation_url changing when using app bridge

nagoh
Shopify Partner
1 0 2

We have just today started to see an issue when a user is asked to confirm their charges of a recurring app charge. It appears that the shopify app bridge is changing the url of the confirmation url. 

 

I.e. we get a confirmation_url from the (https://shopify.dev/docs/api/admin-rest/2023-04/resources/recurringapplicationcharge) API. 

We then redirect the user to that URL via the shopify app bridge, using the Shopify App Bridge Navigation - (https://shopify.dev/docs/apps/tools/app-bridge/actions/navigation/redirect-navigate) by calling useNavigate() with the confirmation_url

This has been working, but today we have seen the URL the user is redirected to being modified from the original confirmation_url. It is being changed from https://admin.shopify.com/store/storename/charges/... to https://admin.shopify.com/store/storename/store/storename/charges/... and the user is receiving a 404 page. 

 

Hope someone can help?

Replies 15 (15)

DungNguyen1
Shopify Partner
2 0 3

We got the same issue today!

SonVH
Shopify Partner
4 0 1

I have run into the same issue, too

SonVH
Shopify Partner
4 0 1

Same here, please fix soon!

huy282002
Shopify Partner
4 0 1

Me too, i'm loosing my cx because of it :((( , pls fix soon.

dungnher
Shopify Partner
1 0 0

Same here, please fix soon!

 

DungNguyen1
Shopify Partner
2 0 3

You can use 

top.location.href = res.confirmationUrl

until Shopify fixes the bug 

AndyHung
Shopify Partner
60 0 15

Hi @DungNguyen1,

I can't find "top.location.href". Can you help me how to replace?

SonVH
Shopify Partner
4 0 1

instead of navigate(url), use top.location.href = url

AndyHung
Shopify Partner
60 0 15

@SonVH thank you :))

SonVH
Shopify Partner
4 0 1

Are you Ken? :))

AndyHung
Shopify Partner
60 0 15

No :))) Mình ko phải Ken đâu @SonVH 

Juttgur
Visitor
2 0 0

You can update the maximum amount that can be charged to a merchant for each purchase using the appSubscriptionLineItemUpdate mutation.

lalitjat_808
Shopify Partner
1 0 1
Hi, you can resolve the issue using 

redirect.dispatch(Redirect.Action.REMOTE, {
url: redirectUrl,
new context:false })
instead of 

redirect.dispatch(Redirect.Action.ADMIN_PATH, {
path: redirectUrl })

or you can redirect using JavaScript also

top.location.href = res.confirmationUrl
SeanMythen
Shopify Partner
4 0 1

This worked for me! Missed out on a few installs today because of it though 😞

SeanMythen
Shopify Partner
4 0 1

Well, I thought it had, but now I'm having trouble with it preventing my app from loading when in production when it worked fine during dev.

Edit: I actually did end up getting it working, it was a separate error