Sample integration of Stripe Checkout with LiveView Native.
- Create a Stripe account and put the secret in the
STRIPE_SECRETenvironment variable:
STRIPE_SECRET=sk_test_***- Create a product for 100 coins and put the price ID in the
100_COINS_PRICE_IDenvironment variable:
100_COINS_PRICE_ID=price_***- Create a webhook for
checkout.session.completedand put the webhook secret in theSTRIPE_WEBHOOK_SECRETenvironment variable:
STRIPE_WEBHOOK_SECRET=whsec_***- Update
priv/static/.well-known/apple-app-site-associationwith your developer team ID and app bundle ID.
{
"applinks": {
"details": [{
"appIDs": ["[TEAM_ID].[BUNDLE_ID]"],
...
}],
...
}
}- Set the
BASE_URLenvironment variable to use for redirects in the Stripe checkout session. You can use a service like ngrok to test universal links locally.
BASE_URL=https://example.comTo start your Phoenix server:
- Run
mix setupto install and setup dependencies - Start Phoenix endpoint with
mix phx.serveror inside IEx withiex -S mix phx.server
Now you can visit localhost:4000 from your browser.
Ready to run in production? Please check our deployment guides.
- Official website: https://www.phoenixframework.org/
- Guides: https://hexdocs.pm/phoenix/overview.html
- Docs: https://hexdocs.pm/phoenix
- Forum: https://elixirforum.com/c/phoenix-forum
- Source: https://github.com/phoenixframework/phoenix