Choose between Stripe, or Lemon Squeezy (not implemented)
service-go-user/domain/payment/provider.go
file.
The payments implementation can generate the client Checkout Session to process payments, the Customer Portal to check invoices, and includes a Webhook implementation to listen for changes.
The flow is as follows:
service-go-user/http/route_webhook.go
.
Regardless of the provider, remember to set up the webhook URL in the provider’s dashboard, pointing to the /payments/webhook
route.
To test Stripe webhook locally, you can use the Stripe CLI, authenticate, and forward the events to the local server:
docker-compose.yml
file.
Stripe
, Lemon Squeezy
and Local (mock)
.
stripe
, lemon
and local
.
docker-compose.yml
file:
stripe
, set STRIPE_API_KEY
and STRIPE_PRICE_ID
.lemon
, set LEMON_API_KEY
, LEMON_VARIANT_ID
and LEMON_STORE_ID
.local
, no configuration is needed.STRIPE_API_KEY
, STRIPE_PRICE_ID
and STRIPE_WEBHOOK_SECRET
, you need to create an account on the Stripe website and get the keys from the dashboard.
Secret Key
and set it as the STRIPE_API_KEY
.Prices
tab and create a new price.Price ID
and set it as the STRIPE_PRICE_ID
.Signing Secret
.Signing Secret
and set it as the STRIPE_WEBHOOK_SECRET
.LEMON_API_KEY
, LEMON_VARIANT_ID
and LEMON_STORE_ID
, you need to create an account on the Lemon Squeezy website and get the keys from the dashboard.
LEMON_API_KEY
.Copy variant ID
. Set it as the LEMON_VARIANT_ID
.Store ID
. Set it as the LEMON_STORE_ID
.