What this solution does
The module integrates with the Stripe payment system to accept payments. It supports Stripe API version 2023-08-16 and operates in both test (demo mode) and live (live mode) environments.
The system utilizes payment templates. Included options are CUSTOM, the default template for Debit Card, Credit Card, SEPA, SOFORT, and GIROPAY payments, and REDIRECT, which immediately redirects the user to the Stripe payment page without displaying buttons on the site.
To use custom templates, place the files in one of the following directories relative to the site root:
/local/php_interface/sale_payment/stripe/templates/
/bitrix/php_interface/sale_payment/stripe/templates/
If files with the same name exist in multiple directories, the first listed path takes precedence.
Automatic payment confirmation is configured via webhooks. Copy the stripeWebhook.php file from the module root to a publicly accessible URL location. In the Stripe dashboard, navigate to Developers -> Webhooks, add a new endpoint, and within the endpoint settings under the webhook details block, click update details.
In the opened window, specify support for the events charge.succeeded and checkout.session.completed, then click the update endpoint button. In the Signing secret block, click click to reveal and copy the secret key. Go to the site admin panel, open the Stripe payment system settings, and paste the copied key into the Webhook token field. Perform a test payment.
Supported events:
OnBeforeStripeCharge — triggered after customer creation. Parameters passed: &$arCreateFields (an array passed to \Stripe\Charge::create) and $customer (an object from \Stripe\Customer::create).
OnBeforeUpdateOrder — triggered after receiving the payment status. Parameters passed: &$arFields (an array of fields for CSaleOrder::Update), $charge (an object from \Stripe\Charge::create), and $orderID (the order identifier).
OnBeforeSuccessOutput — triggered before displaying the success message. Parameters passed: &$output (a string or HTML code displaying the result), $arFields (an array of order fields, the same as used in CSaleOrder::Update), and $orderID (the order identifier).
OnBeforeErrorOutput — triggered before displaying the error message. Parameters passed:
The Stripe payment module by Dev2Fun uses the following parameters for handling errors and order data.
The variable &$error accepts a string or HTML code to display an error message.
The variable $errorText contains the text description of the error.
The array $arFields includes order fields identical to those passed to the CSaleOrder::Update method.
The variable $orderID represents the identifier of the current order.
For remarks or suggestions to improve the module functionality, contact the technical support service.
There is also an option to express gratitude to the author of the development.
When needed, General iT can implement “Stripe payment module”, configure the module and verify it against the current website setup.