You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice to have a test for our Stripe integration. I think this can be added to the existing integration test flow in test/integration.test.js, but we will need to coordinate webhook signing secrets and call into the billing service for the first time, so I think it will take a bit of work to do properly. The following is a rough outline of how I think this should work:
we'll need to POST that signed request to the billing service's new /stripe endpoint - this will require us to teach setupNewClient about the billing service, since it uses a different HTTP endpoint than the upload API we've interacted with thus far
we'll need to ensure that the test environment's secrets are configured with a STRIPE_ENDPOINT_SECRET matching the secret used to create the signed webhook request in step (1) - this probably means adding a STRIPE_ENDPOINT_TEST_SECRET (name flexible) to the process.env of the integration test and ensuring that the two match. We'll want to be careful to avoid leaking secrets if possible here.
we'll need to ensure that the REQUIRE_PAYMENT_PLAN environment variable is set to true in the integration environment.
The text was updated successfully, but these errors were encountered:
Most of the heavy lifting here is done by upgrading the `@web3-storage/upload-api` dependency. There is a new "feature flag" in the context that changes whether payment plans are required for provisioning - I'm going to set it to `false` for now in production and we can flip it once we're ready to turn this on.
I spent a bit of time working toward extending our integration tests to exercise the Stripe webhook handler, but it turned into a big enough project that I decided to defer and recorded what I learned in an issue here:
#267
Most of the heavy lifting here is done by upgrading the
`@web3-storage/upload-api` dependency. There is a new "feature flag" in
the context that changes whether payment plans are required for
provisioning - I'm going to set it to `false` for now in production and
we can flip it once we're ready to turn this on.
I spent a bit of time working toward extending our integration tests to
exercise the Stripe webhook handler, but it turned into a big enough
project that I decided to defer and recorded what I learned in an issue
here:
#267
It would be nice to have a test for our Stripe integration. I think this can be added to the existing integration test flow in
test/integration.test.js
, but we will need to coordinate webhook signing secrets and call into the billing service for the first time, so I think it will take a bit of work to do properly. The following is a rough outline of how I think this should work:setupNewClient
that usesstripe.webhooks.generateTestHeaderString
to create a signed webhook request/stripe
endpoint - this will require us to teachsetupNewClient
about the billing service, since it uses a different HTTP endpoint than the upload API we've interacted with thus farSTRIPE_ENDPOINT_SECRET
matching the secret used to create the signed webhook request in step (1) - this probably means adding aSTRIPE_ENDPOINT_TEST_SECRET
(name flexible) to theprocess.env
of the integration test and ensuring that the two match. We'll want to be careful to avoid leaking secrets if possible here.REQUIRE_PAYMENT_PLAN
environment variable is set totrue
in the integration environment.The text was updated successfully, but these errors were encountered: