Sample integration of Stripe Checkout with LiveView Native.
- Create a Stripe account and put the secret in the
STRIPE_SECRET
environment variable:
STRIPE_SECRET=sk_test_***
- Create a product for 100 coins and put the price ID in the
100_COINS_PRICE_ID
environment variable:
100_COINS_PRICE_ID=price_***
- Create a webhook for
checkout.session.completed
and put the webhook secret in theSTRIPE_WEBHOOK_SECRET
environment variable:
STRIPE_WEBHOOK_SECRET=whsec_***
- Update
priv/static/.well-known/apple-app-site-association
with your developer team ID and app bundle ID.
{
"applinks": {
"details": [{
"appIDs": ["[TEAM_ID].[BUNDLE_ID]"],
...
}],
...
}
}
- Set the
BASE_URL
environment 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.com
To start your Phoenix server:
- Run
mix setup
to install and setup dependencies - Start Phoenix endpoint with
mix phx.server
or 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