Sign inSign up

bloomioapp/stripe-mock

By bloomioapp

Updated over 1 year ago

A stateful HTTP server that mocks stripe requests and responses

Image
0

1.6K

bloomioapp/stripe-mock repository overview

bloomioapp/stripe-mock

This project is inspired by the stripe/stripe-mock project.

stripe/stripe-mock is a good idea, but it's not very useful without some kind of data persistence.

This project is intended supplement the concept of stripe-mock with coming as close as possible to a real-world stripe server for requests and responses with data persistence.

Usage

The default port for this application is port 80.

Authorization

Authenticate requests with the following authorization headers:

  • Authorization: Bearer sk_test_123
  • Authorization: Bearer sk_test_connect_123

curl -i -X POST -H "Authorization: Bearer sk_test_123" http://localhost/v1/subscriptions

Alternatively, you can use basic auth with empty password

curl -i -X POST -u sk_test_123: http://localhost/v1/subscriptions

Data Persistence

The database is stored under the /var/lib/stripe-mock directory.

To persist data between container restarts, mount a local directory or a docker volume to /var/lib/stripe-mock.

Clear data

Create a POST request to the /config/reset endpoint to reset the internal storage.

curl -i -X POST -H "Authorization: Bearer sk_test_123" http://localhost/config/reset

Limitations/TODO

  • The app does support webhooks, but currently only supports customer.subscription.* events
  • The app does not support stripe connect
  • TODO: build dockerfile using nginx-alpine-slim instead of php7.4-alpine for smaller image size

Tag summary

Content type

Image

Digest

sha256:3af0fcd6b

Size

158.5 MB

Last updated

over 1 year ago

docker pull bloomioapp/stripe-mock