To connect the Stripe payment system you need a secret API and a webhook key.
You can copy the secret API key to the Developers -> API key partition and copy the Secret key.
Next you need to set the URL for the Callbacks. This is necessary for the bot to receive payment notifications.
Go to the Webhooks section and add an address for webhooks.
and select the event:
Save and get to the page with the installed webhook, copy the key (Signing secret) webhook (in the salebot field - Webhook key):
after pressing Reveal key will open Webhook, which will start with whsec_...
After receiving the keys, we will proceed to the settings in Salebot.
In salebot, open the section of payment systems, select Stripe. On the connection page, you need to enter the received data.
To generate a link to a payment, you need to set the value of the payment_sum variable (such as 150 or 100.55 (via a dot!)), then the stripe_pay_url variable appears. This variable can be displayed with a link or placed on the button with the text "Pay".
The link has the form:
Also, before setting the payment_sum value, you can specify the following optional variables to configure the payment.
payment_description - order description
Create a link to a payment of EUR 2 (default dollar)
Note, first we set additional variables for the settings, then payment_sum. You can define variables earlier in a chain, not in a single block, this is an example.
Next, at the right place, we will display the stripe_pay_url variable, which contains the link in the block or in the button
Payment example page
After successful payment in the bot will come callbacks, on which you can understand that there was a successful payment. These callbacks in the system you see as messages from the user, so that they can not be sent by the user, they consist of the first 20 characters of the secret key and the account success, for example: sk_live_d35gky6d8ers_success
These callbacks DO NOT SEE the user, they are displayed only to the operator.
The type of comparison should be "Full match"
Also after successful payment, the stripe_payment_completed variable is set to True.
For example, you can make a successful payment processing block with a condition and print the corresponding message to the user:
After the payment is completed, a stripe_callback_data variable will be added to the client, containing the payment system response data for the completed transaction. You can extract the necessary data from the dictionary using the get method.
You can use the secret key from the test environment to test the integration. To do this, in the personal account stripe menu on the right, you need to switch to the test environment.
Next, configure the configuration described at the beginning of this instruction. Enter the test secret key and add the address for webhooks to the test environment.
Test card number
4242 4242 4242 4242
any future date
CVC - any three digits
If something is not working, compare the data with the data on the official site: https:/stripe.com/docs/testing#regulatory-cards