Have your say in Community Polls: What was/is your greatest motivation to start your own business?
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.

Billing API requests approval after already getting approval for store.

Solved

Billing API requests approval after already getting approval for store.

linq-dev
Tourist
11 1 2

I am using the billing api in test mode for this using react/koa.  As I'm testing sometimes on my app restart the billing api request pops up again after already approving it previously. 

 

I'm curious if this is only because it is in test mode or that it will occur live as well. I want to make sure the trial period does not reset and start over for the user. Is this something that requires storing in the db and forcing a redirect with an approved shopify billing link or should it work as is?

 

Thanks in advance.

Accepted Solution (1)

Visely-Team
Shopify Partner
1843 210 488

This is an accepted solution.

Yes, this is something you'll have to take care of. You'll check against your DB whether the merchant has accepted the charge already. If not, create the charge and redirect to the accept page. If the charge exists and is active, you'd redirect the merchant to your app.

Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog

View solution in original post

Replies 4 (4)

Visely-Team
Shopify Partner
1843 210 488

This is an accepted solution.

Yes, this is something you'll have to take care of. You'll check against your DB whether the merchant has accepted the charge already. If not, create the charge and redirect to the accept page. If the charge exists and is active, you'd redirect the merchant to your app.

Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog
linq-dev
Tourist
11 1 2

Thank you for clearing this up. One last question, when someone uninstalls should I have a webhook updating the billing information to be reset as well?

Visely-Team
Shopify Partner
1843 210 488
Yes, but only to reset the billing information stored on your side. Shopify cancels the invoice automatically on app uninstall.
Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog
linq-dev
Tourist
11 1 2

Great, thank you for the help.