-
-
Notifications
You must be signed in to change notification settings - Fork 51
Setup Stripe
If you want to enable Stripe payment gateway, sign up for a Stripe account, fill the forms and save the publishable key and the secret key from Stripe Developers Dashboard.
Don't expose the secret key on a website or embed it in a mobile application. It must be secret and stored securely in the server-side.
In Stripe, all accounts have a total of four API keys by default-two for test mode and two for live mode:
- Test mode secret key: Use this key to authenticate requests on your server when in test mode. By default, you can use this key to perform any API request without restriction.
- Test mode publishable key: Use this key for testing purposes in your web or mobile app’s client-side code.
- Live mode secret key: Use this key to authenticate requests on your server when in live mode. By default, you can use this key to perform any API request without restriction.
- Live mode publishable key: Use this key, when you’re ready to launch your app, in your web or mobile app’s client-side code.
You can find your secret and publishable keys on the API keys page in Stripe Developers Dashboard.
Use only your test API keys for testing and development. This ensures that you don't accidentally modify your live customers or charges.
On production, use HTTPS in the API, the backend, the frontend and the mobile app to be able to use Stripe payment gateway.
Set Stripe secret key in the following option in api/.env:
MI_STRIPE_SECRET_KEY=STRIPE_SECRET_KEY
Set Stripe publishable key in the following option in frontend/.env:
REACT_APP_MI_STRIPE_PUBLISHABLE_KEY=STRIPE_PUBLISHABLE_KEY
Set Stripe publishable key and other Stripe settings in mobile/.env:
MI_STRIPE_PUBLISHABLE_KEY=STRIPE_PUBLISHABLE_KEY
MI_STRIPE_MERCHANT_IDENTIFIER=MERCHANT_IDENTIFIER
MI_STRIPE_COUNTRY_CODE=US
MI_STRIPE_CURRENCY_CODE=USD
MI_STRIPE_MERCHANT_IDENTIFIER
is the merchant identifier you registered with Apple for use with Apple Pay.
MI_STRIPE_COUNTRY_CODE
is the two-letter ISO 3166 code of the country of your business, e.g. "US". Required for Stripe payments.
MI_STRIPE_CURRENCY_CODE
is the three-letter ISO 4217 alphabetic currency code, e.g. "USD" or "EUR". Required for Stripe payments. Must be a supported currency: https://docs.stripe.com/currencies
Copyright © 2024 Akram El Assas. All rights reserved.