Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Billing Built-In #8

Closed
gnikyt opened this issue Jan 23, 2018 · 7 comments
Closed

Billing Built-In #8

gnikyt opened this issue Jan 23, 2018 · 7 comments
Assignees
Labels
feature Enhancement to the code

Comments

@gnikyt
Copy link
Owner

gnikyt commented Jan 23, 2018

I'm going to build in the ability to charge for apps. I've done this many times, and figure its good to bake in as an (optional) thing for this package.

I plan on making it a separate middleware which anyone can attach to their routes. All settings for the billing including app name, pricing, trial period, etc, will be configurable.

Essentially the flow will be:

  1. Shop gets authenticated with current middleware
  2. Billing middleware will check if shop has paid (activation charge ID), or is grandfathered in (db flag)
  3. If not paid:
    i. Redirect to Shopify billing screen
    ii. Shop accepts/declines and is redirected back to a billing controller
    iii. If accepted, charge is activated and stored in database for that shop, then redirected to home route.
    iiii. If declined, show error
  4. If paid:
    i. Continue to route as normal

I'll be working on this in a new branch, with tests, and merge in once I feel its OK. Timeline for this is a bit sparse as I'm a tad busy these days so hang tight :)

@gnikyt gnikyt added the feature Enhancement to the code label Jan 23, 2018
@gnikyt gnikyt self-assigned this Jan 23, 2018
@gnikyt
Copy link
Owner Author

gnikyt commented Jan 23, 2018

Branch reference: billable-feature.

@gnikyt
Copy link
Owner Author

gnikyt commented Jan 23, 2018

So far:

  • Basics are setup
  • New configuration values in place
  • Shop model is modified to support billing
  • Middleware is implemented
  • Basic tests in place for middleware and new shop changes

Next:

  • Billing controller
    i. Handling redirect/display of Shopify billing page
    ii. Handle accept of billing
    iii. Handle decline of billing

@gnikyt
Copy link
Owner Author

gnikyt commented Jan 24, 2018

Billing controller is now complete. Need to add tests for the processor action in the controller which completes things.

After that, some real-world tests.

@gnikyt
Copy link
Owner Author

gnikyt commented Jan 24, 2018

Tests are now complete, code is also completed.

Working on updating some docs, and will begin real-world tests hopefully tomorrow, if not, early next week.

@gnikyt
Copy link
Owner Author

gnikyt commented Jan 24, 2018

And we have success!

Install + Grandfathered mode: Working
Install + Pay mode: Working
Install + Decline mode: Working (shows error)

screen-shot-2018-01-24-at-4 25 28-pm

I'll be auditing the code, pushing a release, and updating the wiki with information on enabling this feature over the next few days.

@gnikyt
Copy link
Owner Author

gnikyt commented Jan 25, 2018

Based on tests (both code and real-world), we're good to merge in master.

From here, i'll update docs/wiki, do more tests, and release

@gnikyt gnikyt mentioned this issue Jan 25, 2018
@gnikyt
Copy link
Owner Author

gnikyt commented Jan 25, 2018

Closing due to PR #10

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature Enhancement to the code
Projects
None yet
Development

No branches or pull requests

1 participant