https://github.com/fgribreau/stripe-update-card
💳 Expose a page that let your customers update their payment information on Stripe.
https://github.com/fgribreau/stripe-update-card
creditcard microservice payment stripe
Last synced: 4 months ago
JSON representation
💳 Expose a page that let your customers update their payment information on Stripe.
- Host: GitHub
- URL: https://github.com/fgribreau/stripe-update-card
- Owner: FGRibreau
- Created: 2018-06-09T22:08:27.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-07-19T09:03:11.000Z (almost 2 years ago)
- Last Synced: 2024-10-20T00:36:18.063Z (9 months ago)
- Topics: creditcard, microservice, payment, stripe
- Language: Rust
- Homepage: https://fgribreau.com
- Size: 3.23 MB
- Stars: 19
- Watchers: 3
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Stripe Update Card microservice
Expose a page that let your customers update their payment information on Stripe.
[](https://travis-ci.org/FGRibreau/stripe-update-card)
[](https://crates.io/crates/stripe-update-card) [](https://crates.io/crates/stripe-update-card) [](https://crates.io/crates/stripe-update-card) [](https://hub.docker.com/r/fgribreau/stripe-update-card/) [](https://hub.docker.com/r/fgribreau/stripe-update-card/) [](https://join.slack.com/t/fgribreau/shared_invite/zt-edpjwt2t-Zh39mDUMNQ0QOr9qOj~jrg)
![]()
### 🐳 Getting started
```bash
docker run -it \
-e STRIPE_PUBLISHABLE_KEY=pk_test_xxx \
-e STRIPE_SECRET_KEY=sk_test_xxx \
-e SUCCESS_REDIRECT_URL=https://url.to.redirect/on/success \
-p 8080:8080 \
fgribreau/stripe-update-card# open payment update page for customer id: cus_D1Cj3rjHrjPQg5
open http://localhost:8080/cus_XXXXXXXXXXXX
```Don't forget to change `cus_XXXXXXXXXXXX` with the Stripe customer id and then expose the URL `http://sub.domain.tld/cus_XXXXXXXXXXXX` from your app.
## Configuration
Configuration is managed through environment variables, see [.env.dist](./.env.dist) for the full-list.
```bash
# mandatory config
STRIPE_PUBLISHABLE_KEY=pk_test_xxxxxxxx
STRIPE_SECRET_KEY=sk_test_xxxx
SUCCESS_REDIRECT_URL=https://url.to.redirect/on/success# optional config
PAGE_TITLE="Update Card"
FORM_DATA_IMAGE=/path/to/your/logo.png
FORM_DATA_NAME="The name of your company or website"
FORM_DATA_DESCRIPTION="A description of the product or service being purchased"
FORM_DATA_PANEL_LABEL="Update Card Details"
FORM_DATA_COLLECT_BILLING_ADDRESS=false
FORM_DATA_LABEL="Update Card Details"
FORM_DATA_ALLOW_REMEMBER_ME=false
FORM_DATA_LOCALE=auto
```See [stripe-update-card](https://hub.docker.com/r/fgribreau/stripe-update-card/) on docker hub.
## Running in production at
- [Image-Charts](https://payment.image-charts.com/cus_XXXXXX)
- [Redsmin](https://payment.redsmin.com/cus_XXXXXX)## 🦄 Do you use it in production? Please support my work :)
## ⛴ Cargo install
```bash
cargo install stripe-update-card
```## ⚙️ Deployment
- Deploy it (the fastest way is to use [Clever-cloud](https://www.clever-cloud.com/doc/rust/rust/) thanks to their awesome native Rust support)
- Set environment variables
- Don't forget to add "RUSTUP_CHANNEL=nightly" env. variable for Rocket
- Done!## ❤️ Shameless plug
- [**Charts, simple as a URL**. No more server-side rendering pain, 1 url = 1 chart](https://image-charts.com)
- [Looking for a free **Redis GUI**?](https://www.redsmin.com) [Or for **real-time alerting** & monitoring for Redis?](http://redsmin.com)
- [**Mailpopin**](https://mailpop.in/) - **Stripe** payment emails you can actually use## Development
```
cargo install cargo-watch
cargo install cargo-releasesource .env
# watch for changes and restart everytime
RUST_LOG=debug cargo watch -x run
```- Use Stripe test tokens
- Use credit card number `4242 4242 4242 4242` and any date & CVV## CI
This project use Travis-CI to run tests & do builds.
Required environment variables are:
- CODECOV_TOKEN (get one at https://codecov.io/gh/FGRibreau/ )