Using the Jetpay for Bitrix CMS plug-in
This section describes how to use the Jetpay plug-in version 2.0. The plug-in allows you to perform payments by using JetPay payment solutions on the sites based on Bitrix CMS. Small Business, Business, and Enterprise revisions are supported.
Operation workflow
Payments are processed by using the JetPay payment page.
Figure: The diagram of payment processing with the plug-in enabled
Request for opening the payment page is automatically generated by the plug-in when Jetpay is selected as the payment method.
If the payment is declined, the customer may re-enter the data on the payment page.
Upon receipt of the payment result, a callback is sent back to the merchant site. The callback is processed by the plug-in automatically. The status of the order changes depending on the payment result. The correspondence between payment results and order statuses of the order is configured in the Bitrix CMS settings.
Installing and setting up
Installing the plug-in
- Download file with the Jetpay plug-in here.
- Open Bitrix CMS.
- Open the folder with Bitrix CMS modules in the following order:
Select the Content tab, then select and click the .
- Create the
jetpay
folder inside thebitrix/modules
directory in the following order:Select
to open the following page:Copy the folder name—
jetpay
—into Section name and Folder name fields and make sure that Create index page for this section checkbox is cleared. Click Save. - Extract plug-in archive content into the
bitrix/modules/jetpay
folder following these steps:- Click the
jetpay
folder - Click Upload file.
- Click Add file on the page that opens.
- Select the archive with the plug-in, and then click Save button.
- Right-click the uploaded archive and select Extract files.
- Click Unpack button on the modal window that opens.
Make sure that the structure of files and folders after archive unpacking looks like this:
If the structure is different, move unpacked files and folders into the
/bitrix/modules/jetpay
folder. - Click the
- Activate the installed plug-in in the following order:
Select Settings tab, and then select and click Install in the line with the Jetpay module.
Once you complete these steps, the plug-in status will change to Installed.
Creating and setting up a payment handler
- Create a new payment handler:
To do this, select e-Store tab, and then select and click New payment system.
- Set up the new payment handler look-and-feel by entering the following parameters:
- Handler—select
Jetpay
in the dropdown list - Payment system—handler title which will be shown to the customer on the page with payment methods
- Description—description of the payment handler, optional
If needed, you can upload a payment handler logo to show to the customer on the page with payment methods.
- Handler—select
- Configure the payment handler parameters:
- Project ID—project ID you obtained from JetPay
- Secret salt—value of the secret_key parameter you obtained from JetPay
- Terminal language—language code according to ISO 639-1 alpha-2. If you leave this box empty, language of Payment Page is determined by customer's device IP address
- Additional params—additional parameters according to Payment Page API. To specify two or more parameters, use "&" as separator. For more information about parameters supported by Payment Page, see Payment Page invocation parameters
- Test mode—specify whether Payment Page to run in test mode. Possible options:
Yes
andNo
. If you leave this box empty, test mode will not be applied - Modal mode—specify whether to open Payment Page in a modal window. If you leave this box empty, Payment Page will be opened in an iframe
- Display the page of selecting a payment method—specify whether to show the payment method selection screen. If you leave this parameter empty, customer will be asked to pay by a card
- Pass customer ID—specify whether the plug-in will pass passes the customer ID in the payment request. You are required to select this checkbox for the plug-in to operate correctly.Note: If the payment is made by unauthorized customer, customer ID is not passed in the payment request.
- Configure the parameters in the Status section. These parameters define how the status of the order in Bitrix CMS changes when the status of the corresponding payment in JetPay is updated.
- Status "Paid" (one-stage payments)—use this parameter to select the status to automatically apply to the order after the payment is successfully completed, for example Paid.
In other words, once the payment status changes to
success
, the status of the corresponding order in Bitrix CMS will change to the status specified in this parameter. This parameter is applicable only to one-step purchase. - Authorized payment status (two-stage payments)—use this parameter to select the status to automatically apply to the order in Bitrix CMS after the customer card is authorized in a two-step purchase process, for example Purchase authorized.
Once the payment status changes to
awaiting capture
, the status of the corresponding order in Bitrix CMS will change to the status specified in this parameter. This parameter is applicable only to two-step purchase. - Payment authorization confirmation status (two-stage payments)—use this parameter to select the status to automatically apply to the order after the authorized amount is captured in a two-step payment procedure, for example Purchase captured.
Once the payment status changes to
success
, the status of the corresponding order in Bitrix CMS will change to the status specified in this parameter. This parameter is applicable only to two-step purchase. - Authorized payment cancellation status (two-stage payments)—use this parameter to select the status to automatically apply to the order after the purchase is canceled in a two-step payment procedure, for example Purchase canceled.
Once the payment status changes to
canceled
, the status of the corresponding order in Bitrix CMS will change to the status specified in this parameter. This parameter is applicable only to two-step purchase. - Payment error status (two-stage payments)—use this parameter to select the status to automatically apply to the order after the purchase is canceled in a two-step payment procedure, for example Error.
Once the payment status changes to internal_error or external_error, the status of the corresponding order in Bitrix CMS will change to the status specified in this parameter. This parameter is applicable only to two-step purchase.
- Status "Paid" (one-stage payments)—use this parameter to select the status to automatically apply to the order after the payment is successfully completed, for example Paid.
- Click Save.
Configuring callback receiver
To automatically change the payment status of the order, you need to specify how to receive callbacks from Jetpay.
To configure callback receiver:
- Open the tab Content, and then select
- Create the callback receiver file.
To do so, select
.Enter
jetpay.php
in the File name box and copy the following code into the text box:<?php require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php"); $APPLICATION->IncludeComponent( "bitrix:sale.order.payment.receive", "", Array( "PAY_SYSTEM_ID" => "22", "PAY_SYSTEM_ID_NEW" => "22" ) ); require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_after.php"); ?>
Set the
PAY_SYSTEM_ID
andPAY_SYSTEM_ID_NEW
parameters to JetPay payment system ID. You can find the ID in the ID column on the corresponding row of the table in the following section: - Give the Jetpay technical support the URL you will use to receive callbacks.
If you place the
jetpay.php
file into the root directory of your site, the URL for receiving callbacks will look like this:https://<full_domain_name>/jetpay.php
If the
jetpay.php
file is located not in the root directory of your site, the URL for receiving callbacks will look like this:https://<full_domain_name>/<directory>/jetpay.php
Testing
Once the plug-in is activated, you can use the test mode. With the test mode, you can learn how to use the plug-in without making actual payments. The test mode will allow you to configure and test the plug-in, perform test orders, and view order information. When running in test mode, the payment page displays the corresponding warning.
Configuration
- Check module status in the following section: Installed . The status must be
- Select
- Select
Jetpay
in the dropdown list and click Modify - Configure the required settings. See below for details
- Select Yes in the Test mode box
- Click Save
- Parameters that govern how the JetPay payment page is displayed:
- Display the page of selecting a payment method—configure the payment method selection page
- Additional params—additional parameters of the payment page.
A list of these parameters is available here. When specifying these parameters, select Value. To specify two or more parameters, use "&" as separator
- Terminal language—the language of the payment page. Select Value, and then enter the language code according to ISO 639-1 alpha-2
- Modal mode—specify whether Payment Page will be opened in a modal window. If you leave this box empty, Payment Page is opened in the iframe mode
- Parameters Project ID and Secret salt are required to communicate with Jetpay payment solutions. These parameters are not used in the test mode.
- Pass customer ID—specify whether the plug-in will pass passes the customer ID in the payment request. You are required to select this checkbox for the plug-in to operate correctly.Note: If the payment is made by unauthorized customer, customer ID is not passed in the payment request.
Making test orders
Once the parameters of the plug-in are configured, you can make test orders on the site and check the orders information in Bitrix CMS in the section.
Launching
Once you done with testing the plug-in by using all the payment methods you plan to use, switch to production mode. To do so, you need to get all the information required for the production mode and configure the plug-in settings accordingly.
Receiving the parameters for the production mode
To receive the parameters to integrate with the JetPay payment solutions, do the following:
- Contact JetPay technical support and provide the following parameters:
- The site name and site URL
- The payment page currency
- The URL to receive callbacks
- Receive from JetPay technical support the following parameters:
- Project ID—site identifier
- Secret salt—secret key that is generated for a particular merchant in the JetPay processing system
Configuring the operational parameters
- Open Bitrix CMS
- Select
- Select Jetpay and configure the operational parameters:
- Select No in Test mode
- Enter values for Project ID and Secret salt which you received from JetPay technical support
- Make sure that the remaining parameters are set as required
- Make sure that the Pass customer ID checkbox is selected
- Click Save.
Using
Once the plug-in is launched, it operates autonomously.
We recommend that you control orders by reviewing the information in the
section; also make sure that order numbers are unique within the site. The payment page would not open for duplicate order numbers.If you need to temporary switch the plug-in back to the test mode, pay close attention to how the payment method is displayed on the site. If Yes is selected in the Test mode, currently used payment method is displayed on the site, however all the payments will be processed as test payments. Watch the warning message about test mode shown on the payment page.
Before you switch the plug-in back to the production mode, make sure that the Project ID and Secret salt boxes are populated with the values obtained from the JetPay technical support.
If you have any further questions regarding the plug-in operation, contact JetPay technical support at support@jetpay.kz.