Stripe Integration Guide
Stripe is a powerful tool for processing payments, it provides an efficient method for generating revenue from your clients. Here's a step-by-step guide to help you integrate Stripe with Mixpost Enterprise and get started with processing payments.
1. Create an account
If you haven't already, head to Stripe's website and sign up for an account.
2. Configure webhooks
2.1 Webhook URL
From Stripe's dashboard, go to Developers -> Webhooks and click on Add endpoint.
Enter the following URL:
https://example.com/<MIXPOST_CORE_PATH>/payment-webhook
Substitute <MIXPOST_CORE_PATH>
with your specified MIXPOST_CORE_PATH
. If you have not altered the MIXPOST_CORE_PATH
environment variable, use the default value: mixpost
.
2.2 Events
- Choose Listen to to Events on your account.
- Choose Version to Latest API version (2023-08-16).
- Add the following events to listen for:
customer.subscription.created
customer.subscription.updated
customer.subscription.deleted
customer.updated
customer.deleted
invoice.payment_succeeded
payment_method.automatically_updated
- Click Add endpoint.
After adding the endpoint, click on Reveal link to expose your Signing secret. You should copy it somewhere safe. We will need it later.
Screenshots:
3. Get credentials
- From Stripe's dashboard, go to Developers -> API Keys.
- You will find two keys there: a Publishable Key and a Secret Key. Both are necessary for integration.
Always keep your Secret Key confidential.
Screenshots:
4. Copy the credentials to Mixpost
Once you have Publishable Key, Secret Key, and Signing secret, navigate to your Mixpost dashboard and enter these credentials into the Stripe payment platform section. Make sure to select the Enabled option.
Navigate to the User Menu at the bottom left, click on Enterprise Console, then select Settings from the left sidebar, and finally click on Payment Platforms.
Screenshots:
5. Add pricing plans
We are adding all the necessary pricing plans in both Stripe and Mixpost dashboard.
5.1 Add products in Stripe
- Navigate to the Products section in your Stripe Dashboard.
- Click the Add product button.
- Enter a plan name, e.g Starter.
- Move to the Price information section.
- Choose the Standard pricing model.
- Set the plan price, for example, $9.00.
- Choose Recurring for the type of payment.
- Select the Billing period. Mixpost supports only Monthly or Yearly billing periods.
- If you want to offer both Monthly and Yearly billing options for your plan, click on Add another price to set up additional pricing.
- Save the product.
Screenshots:
5.2 Sync Stripe products with Mixpost plans
After the product has been created in your Stripe dashboard. You should copy the API ID
of each product price to your created plans in the Mixpost Dashboard. See the instructions.
Screenshots:
6. Testing
- Try to register a user and subscribe to a plan.
- Use Stripe's test card numbers to make sure the subscription is done correctly.
7. Go live
Once you're confident in the integration:
- Switch from using Stripe's test mode to live mode.
- Ensure you've added any necessary pricing plans in both Stripe and your Mixpost dashboard.
- Start onboarding users and generating revenue!