Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Cancelling on app purchase still installs the app

Solved

Cancelling on app purchase still installs the app

mck782
Shopify Partner
1 0 0

Hi experts, 

 

While developing a simple Shopify app, I'm struggling to set up billing logic. I followed the workshop tutorial to include billing logic into the authentication flow: https://workshops.shopify.dev/workshops/usage-billing#4

 

Everything works as expected except that when I click 'cancel' button in the payment page, it still installs the app. I also realized that session is getting stored in the designated DB before going through the payment. Is this expected or this is because I set isTest flag to true when calling request.billing? What would be the solution to this? Should I implement a middleware logic to re-direct all request to the payment page until the payment is made?

Accepted Solution (1)

snakecase
Shopify Partner
18 4 8

This is an accepted solution.

Hi,

 

I replied to someone with the same problem than you few days ago. My answer is here but I believe the whole thread can be interesting for you. I quote the interesting part of my first response below so you don't have to navigate around if you don't want to:

 

The workshop is about a "Usage Billing with the Shopify Billing API" which means that the subscription is here to limit the usage of a specific feature in your app, not to limit the access of the application.

 

Later in the thread, you can find a discussion on how to change the billingConfig and an advice on how to implement the access restriction (a middleware is probably the best solution)


I hope it helps you.

 

 

View solution in original post

Replies 2 (2)

jordanholmes
Shopify Partner
152 28 34

Hello,

 

It is expected. The app has to be installed to call the billing api's.

 

You can just redirect traffic to a payment info page until the the merchant has accepted or uninstalls.

Jordan Holmes
Shopify Expert and Ruby on Rails Developer
Shopify Partner Directory

snakecase
Shopify Partner
18 4 8

This is an accepted solution.

Hi,

 

I replied to someone with the same problem than you few days ago. My answer is here but I believe the whole thread can be interesting for you. I quote the interesting part of my first response below so you don't have to navigate around if you don't want to:

 

The workshop is about a "Usage Billing with the Shopify Billing API" which means that the subscription is here to limit the usage of a specific feature in your app, not to limit the access of the application.

 

Later in the thread, you can find a discussion on how to change the billingConfig and an advice on how to implement the access restriction (a middleware is probably the best solution)


I hope it helps you.