In this guide, we will cover how to connect Stripe to your Onboarding Online project:
Open your project in The Onboarding Online system
Go to the ‘Project Overwiew’ tab.
Here, click on the Create button in the ‘Stripe’ section
You will see a form that you have to fill:
Firstly, you have to add 4 keys:
2 Publishable Keys : Production and Sandbox
2 Secret Key : Production and Sandbox
What is Stripe API Keys and Their Modes
What is Stripe API Keys and Their Modes
Get the Test keys:
Stripe API keys are secure access codes that connect your website or application to Stripe, the payment processor. These keys allow you to process payments, manage transactions, and perform various operations related to your Stripe account programmatically. Stripe provides four types of API keys: two for your test environment and two for your live environment.
Stripe Publishable (Public) Keys Publishable keys are used in the frontend code of your website that your customers interact with. These keys can be shared publicly and are included in scripts that run in browsers when customers enter their payment details.
Stripe Secret Keys Secret keys are used on the server side to perform backend operations safely and confidentially. They should never be exposed publicly as they can perform sensitive operations like creating charges or issuing refunds. Protecting your secret key is crucial to prevent unauthorized access to your Stripe account.
Test Sandbox and Live Modes Stripe offers test keys for a sandbox environment, allowing you (or developers) to simulate transactions without any financial impact. Objects created in one mode are not accessible in the other. For instance, a subscription plan created in test mode is not available in live mode, and vice versa.
How to Find and Fill Publishable and Secret Test(Sandbox) keys:
1. Go to the Developers → API keys page on the Stripe dashboard. Make sure The Test mode is enabled here
2. Click on the test publishable key to copy it to the clipboard:
3. Paste the Test Publishable key in ‘Create Stripe integration’ screen in ‘Sandbox Publishable key’ field:
4. Reveal test secret key by pressing the “Reveal test key” button
5.Click on the test secret key to copy it to the clipboard:
6. Paste the test Secret key in ‘Create Stripe integration’ screen in ‘Sandbox Publishable key’ field:
How to Find and Fill Publishable and Secret Production keys:
1. Go to the Developers → API keys page on the Stripe dashboard. Press the “Test mode” toggle and disable it
2. Copy the Publishable Key
4. Paste the Test Publishable key on the ‘Create Stripe integration screen’ in ‘Production Publishable Key’ field:
5. Click the "Create secret key" to create a new secret key; you cannot view/reveal a secret key once created. Each secret key is given a name so you can keep track of which is used where.
6. Copy the Generated Secret Key from the Stripe
6. Paste the Live Secret key on ‘Create Stripe integration’ screen in ‘Production Secret Key’ field:
Click on The 'Create' button on the form to finish the setup
Register domains to enable payment methods
For certain payment methods, you must register in stripe every web domain that shows the payment method. The list of payment methods:
Google Pay
Link
PayPal
Amazon Pay
Klarna
Apple Pay
You also need to register domains for testing. You can either register in Stripe sandbox, or register in live mode and the domain will also be registered in sandboxes automatically. Remember to register your domains in live mode before going live.
Registering a domain in Stripe
You can find your Custom domain on the Project overview page
On the Payment method domains page, click Add a new domain.
Enter your domain name.
Click Save and continue.
(Optional) Repeat steps 1-3 for additional domains that you need to register.
After completing these steps, your domain shows up on the Payment method domains page.
Manage your domain in Stripe
You can see a list of all of your domains in the Dashboard.
To disable a domain, click the row action and then click Disable. If a domain is disabled, the payment methods no longer appear in Elements or Checkout’s embeddable payment form on that domain.
To enable a disabled domain, click the row action and then click Enable.
Add WebHooks to get Stripe events in analytics and Meta Pixel.
Go to Developers → Webhooks
2. Locate the webhook pointing to our production and sandbox backend URL
3. Make sure to enable all events related to the checkout.session object, including at minimum:
checkout.session.completed
checkout.session.async_payment_succeeded
checkout.session.async_payment_failed
checkout.session.expired
Once these events are enabled, we will be able to properly receive production events and send them to Meta Pixel and Amplitude.