Have your say in Community Polls: What was/is your greatest motivation to start your own business?

Re: Shopify appPurchaseOneTimeCreate confirmationUrl redirection error

Shopify appPurchaseOneTimeCreate confirmationUrl redirection error

Manoj_M
Shopify Partner
1 0 2

Hi,

      I built a Shopify app with Remix.js using the `app Purchase One Time Create` billing method. After the user clicks the purchase button, it creates a confirmation URL. For that, I followed (https://shopify.dev/docs/api/admin-graphql/2024-01/mutations/appPurchaseOneTimeCreate).

In the server action, the `app Purchase One Time Create` mutation is executed, and it redirects to the `confirmation URL`.

During the redirection process, I'm getting the following error:

If I open this link in a separate tab, it opens, but it does not open when the checkout button is clicked.

Manoj_M_0-1720420765332.png

Please help me resolve this issue.

Replies 3 (3)

loyds_mohan
Shopify Partner
1 0 3

I am also experiencing an issue with the appPurchaseOneTimeCreate billing method in my Shopify app built with Remix.js. After the user clicks the purchase button, the appPurchaseOneTimeCreate mutation creates a confirmation URL, which I then attempt to redirect to. However, I encounter the following error:
The loading of “https://admin.shopify.com/store/demo-store/charges/ApplicationCharge/confirm_application_charge?sign... in a frame is denied by “X-Frame-Options“ directive set to “deny“.

 

This issue is blocking our One Time Payment feature and affecting our users' ability to complete the purchase process.

Can you provide guidance on how to resolve this issue? Is there a specific way to handle the redirection to the confirmation URL to avoid the X-Frame-Options restriction, or any alternative approach to ensure the payment process works seamlessly?

massiv
Shopify Partner
7 0 3

please, tell me you guys found the problem... i am facing the exact same problem and i have been days now trying to find a solution

ViralSanchala
Shopify Partner
3 0 0

I found solution for this like use below code for redirect and this will work.

top.location.href = res.confirmationUrl

I found this solution in this question
https://community.shopify.com/c/shopify-apps/recurring-charges-confirmation-url-changing-when-using-...