armenarmen
armenarmen

Reputation: 99

Setting up Shopify recurring billing API with Rails

I've been trying to set up recurring billing for a shopify app built with Shopify's Rails App Gem. The gem itself is great, but there is nothing there to deal with billing.

There is a an outdated billing project that I hasn't been super helpful. I was hoping that any of you might have had to deal with this lately and could point me to a good repo, or stub out highlevel instructions on how to start using the billing api.

Upvotes: 0

Views: 368

Answers (1)

David Lazar
David Lazar

Reputation: 11427

In your embedded App controller, use a before filter.

before_action :require_subscription

In your private method, require_subscription you are free to setup a session and check if the shop has a charge that makes you happy. If not, make one. If they do, carry on. If they have a pending one, activate it. Etc.

You do not need an engine, nor a complex repo to accomplish using the billing API. A simple filter response has done quite well for me anyway.

Upvotes: 1

Related Questions