Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Developer creates Products and Prices in Stripe #79

Open
zspencer opened this issue Jun 15, 2020 · 0 comments
Open

Developer creates Products and Prices in Stripe #79

zspencer opened this issue Jun 15, 2020 · 0 comments
Labels
code Work that will require some amount of programming documentation Work that is intended to focus on improving documentation Stripe Relates to the Stripe payment processor test Work that will require testing skillz
Milestone

Comments

@zspencer
Copy link
Member

zspencer commented Jun 15, 2020

Feature: Cross-Platform Product and Service Pricing
  In order to maximize my income streams by selling products or services across channels
  I want to programmatically manage a plethora of sales channels


  Scenario: Developer Creates Products and Prices in Stripe
  Given Compensated is configured with a clean Stripe account
  And there is a compensated.json with the following data:
  """
  {
    "products": [
      {
        "name": "Robot Delivery",
        "prices": [
          { "nickname": "Small month-to-month", "amount": 10_00, "currency": "usd", "interval": "monthly" },
          { "nickname": "Small full-year", "amount": 100_00, "currency": "usd", "interval": "annual" },
          { "nickname": "Medium month-to-month", "amount": 20_00, "currency": "usd", "interval": "monthly" },
          { "nickname": "Medium full-year", "amount": 200_00, "currency": "usd", "interval": "annual" },
          { "nickname": "Large month-to-month", "amount": 40_00, "currency": "usd", "interval": "monthly" },
          { "nickname": "Large full-year", "amount": 400_00, "currency": "usd", "interval": "annual" }
        ]
      }
    ]
  }
  """
  When I run `compensated apply`
  Then a "Robot Delivery" Product is created in Stripe
  And the "Robot Delivery" Product has a "Small month-to-month" Price of $10 USD billed monthly in Stripe
  And the "Robot Delivery" Product has a "Small full-year" Price of $100 USD billed annually in Stripe
  And the "Robot Delivery" Product has a "Medium month-to-month" Price of $20 USD billed monthly in Stripe
  And the "Robot Delivery" Product has a "Medium full-year" Price of $200 USD billed annually in Stripe
  And the "Robot Delivery" Product has a "Large month-to-month" Price of $40 USD billed monthly in Stripe
  And the "Robot Delivery" Product has a "Large full-year" Price of $400 USD billed annually in Stripe

Dev Notes

@zspencer zspencer changed the title Developer may programmatically create Products and Prices in Stripe Developer programmatically creates Products and Prices in Stripe Jun 15, 2020
@zspencer zspencer added this to the 0.1.0 milestone Jun 15, 2020
@zspencer zspencer added code Work that will require some amount of programming documentation Work that is intended to focus on improving documentation Stripe Relates to the Stripe payment processor test Work that will require testing skillz labels Jun 15, 2020
zspencer added a commit that referenced this issue Jun 15, 2020
See: #79

I went back and forth between cucumber-js and cucumber-rb; and I wound
up choosing cucumber-js because JavaScript is the lingua-franca of the
web; and it seems like it makes it a bit easier for folks to get started
contributing to systems testing when we use a language that they're
familiar with.

This also adds the system tests to CI.
@zspencer zspencer changed the title Developer programmatically creates Products and Prices in Stripe Developer creates Products and Prices in Stripe Jun 15, 2020
zspencer added a commit that referenced this issue Jun 15, 2020
See: #79

I went back and forth between cucumber-js and cucumber-rb; and I wound
up choosing cucumber-js because JavaScript is the lingua-franca of the
web; and it seems like it makes it a bit easier for folks to get started
contributing to systems testing when we use a language that they're
familiar with.

This also adds the system tests to CI.
zspencer added a commit that referenced this issue Jun 15, 2020
* 🎉💡📝✅ Sprout cucumber-js for system-testing compensated

See: #79

I went back and forth between cucumber-js and cucumber-rb; and I wound
up choosing cucumber-js because JavaScript is the lingua-franca of the
web; and it seems like it makes it a bit easier for folks to get started
contributing to systems testing when we use a language that they're
familiar with.

This also adds the system tests to CI.

* ✨Sprout compensated executable

* ✅➕Create persistent sandbox for running Compensated in feature tests

A Sandbox lets us isolate test environments for each scenario, allowing
for unlimited parallelization of feature-tests. Because compensated is
only a command-line program, the sandbox mostly contains the files,
but I could see it spinning up a tiny-ass web-server to be a fake
Stripe API kind of like MailCatcher does.

Still have to think about how to make the `Then` statements work.
zspencer added a commit that referenced this issue Jul 12, 2020
See: #79

This is a big commit because it conflates the formatting changes from
#89.

That said, it's also significant in it's own right. The ClientSandbox
now has the ability to query and assert against Stripe, so we will be
able to write full integration tests.

That said we _probably_ want to consider spinning out a fake Stripe API
so that our tests don't _always_ perform a full end-to-end check.

Perhaps in Coruru, if something like that doesn't exist already?
zspencer added a commit that referenced this issue Jul 12, 2020
See: #79

The compensated cli now exists, and forwards options and configuration into
commands. Commands can be defined by extending the
`Compensated::Command` class, and overriding the `execute` method.

The first command is `apply`, which creates the configured products and
prices in the Payment Processors that support it.

This is a pretty-close to direct port of the code that I wrote to
allow folks to create products and prices in Stripe.

See: zinc-collective/convene#26

Further, this gives us a `.rubocop.yml` file in the top level of the
project so that formatting can begin to become consistent across files.
zspencer added a commit that referenced this issue Jul 13, 2020
…#90)

See: #79

This is a big commit because it conflates the formatting changes from
#89.

That said, it's also significant in it's own right. The ClientSandbox
now has the ability to query and assert against Stripe, so we will be
able to write full integration tests.

That said we _probably_ want to consider spinning out a fake Stripe API
so that our tests don't _always_ perform a full end-to-end check.

Perhaps in Coruru, if something like that doesn't exist already?

Co-authored-by: Tom Lee <[email protected]>
zspencer added a commit that referenced this issue Jul 13, 2020
See: #79

The compensated cli now exists, and forwards options and configuration into
commands. Commands can be defined by extending the
`Compensated::Command` class, and overriding the `execute` method.

The first command is `apply`, which creates the configured products and
prices in the Payment Processors that support it.

This is a pretty-close to direct port of the code that I wrote to
allow folks to create products and prices in Stripe.

See: zinc-collective/convene#26

Further, this gives us a `.rubocop.yml` file in the top level of the
project so that formatting can begin to become consistent across files.
user512 pushed a commit that referenced this issue Jul 14, 2020
See: #79

The compensated cli now exists, and forwards options and configuration into
commands. Commands can be defined by extending the
`Compensated::Command` class, and overriding the `execute` method.

The first command is `apply`, which creates the configured products and
prices in the Payment Processors that support it.

This is a pretty-close to direct port of the code that I wrote to
allow folks to create products and prices in Stripe.

See: zinc-collective/convene#26

Further, this gives us a `.rubocop.yml` file in the top level of the
project so that formatting can begin to become consistent across files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code Work that will require some amount of programming documentation Work that is intended to focus on improving documentation Stripe Relates to the Stripe payment processor test Work that will require testing skillz
Projects
None yet
Development

No branches or pull requests

1 participant