Billing API requests approval after already getting approval for store.

Solved
Highlighted
Tourist
11 1 1

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.

0 Likes
Highlighted

Success.

Shopify Partner
1367 159 247

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
2 Likes
Highlighted
Tourist
11 1 1

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?

0 Likes
Shopify Partner
1367 159 247
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
1 Like
Highlighted
Tourist
11 1 1

Great, thank you for the help.

0 Likes