RU

Payment widget

The payment widget is a pop-up window that is embedded on the Merchant's website and appears when the Customer clicks the Pay button. It includes secure payment data fields (the data is processed by Payture in compliance with security standards) and an email field for sending an electronic fiscal receipt as required by Federal Law No. 54-FZ (the Russian law on cash registers and fiscal receipts). The payment widget is optimized for mobile devices and for different browsers.

To test the widget, use test cards.
The result for this widget is always a successful payment without 3DS.
For example, card number 4111 1111 1111 1111. The expiration date, CVC2/CVV2, and cardholder can be arbitrary.
The receipt sent is not a fiscal document and serves only to demonstrate how the widget works.

Currently, the widget works only via InPay.

Installation

Example of the head section on a page with the widget:

<head>
    <script type="text/javascript" src="path/to/widget/payture-widget.min.js"></script>
    <link rel="stylesheet" type="text/css" href="path/to/widget/widgetStyles.css">
</head>

Example of opening the widget when Pay is clicked:

<button id="start_widget" onclick="openWidget()">Pay</button>

To install the widget on their website, the Merchant needs to complete the following steps:

  1. Request test access parameters from Payture support.
  2. By default, the widget uses the standard Payture templates. If the Merchant wants to change the look of the templates, they need to prepare and send to support a payment form template (Type=Pay) and an operation result template (Type=Return), which opens after the 3DS check. The Merchant can either create their own templates from scratch or modify the standard Payture widget templates. Information, detailed technical guidance on creating templates, and sample widget templates are available on the templates page in the "Widget templates" section.
  3. Include the payture-widget.min.js library in the head section of the page. Download payture-widget.min.js.
  4. Add the styles required by the widget to the head section. Download widgetStyles.css.
  5. Define the function that opens the widget. The required parameters are set in the PaytureWidget() constructor.
  6. Configure the widget to open on some event, for example, when the Pay button is clicked.
  7. If needed, configure the website's behavior depending on the success argument of the OnTransactionCompleted function.
  8. Test the widget in the test environment using test cards.
  9. Obtain production access parameters from Payture support and switch to the production environment.

Widget parameters

Example of a function that opens the widget:

function openWidget() {
    var widget = new PaytureWidget({
        Key : "Merchant_Widget",
        Amount : 20,
        Product : "Payment for order No. 1",
        Domain : 2,
        CustomParams :
        {
            TemplateTag : "Default",
            Language : "Default",
            Name : "John Smith",
            Delivery : "Pickup",
            OrderID : "1233abc6688",
            Url : "https://site.com/order"
        },
        ChequeParams :
        {
            Positions:[
               {
                  Quantity: 1.000,
                  Price: 10.00,
                  Tax: 2,
                  Text: "Tea"
               },
               {
                  Quantity : 2.000,
                  Price : 5.00,
                  Tax: 2,
                  Text: "Pie"
               }
            ],
            CustomerContact : "",
            Message: "Payture receipt"
        },
        OnTransactionCompleted : function(success) {
            alert( success );
        }
    });
}

Parameters passed to the PaytureWidget() constructor:

ParameterDescriptionFormat
KeyPayment terminal nameString (Mandatory)
AmountPayment amount in rubles, with up to 2 digits after the decimal pointFloat (Mandatory)
ProductName of the purchase being paid for, shown to the Customer in the payment widget. Substituted into the {Product} placeholder of the widget templateString [1..50] (Optional)
DomainNumber that identifies the gateway URL:
1 — main address of the Production environment (default)
2 — test environment: https://sandbox3.payture.com
Integer (Optional)
SessionOperation type:
Pay — charge as part of a one-step payment (default)
Block — hold of funds as part of a two-step payment. The held funds can then be captured with the Charge command or released with the Unblock command
String (Optional)
CustomParamsContains the name and language of the widget template used, as well as any additional Merchant parameters (for example, payer name, delivery description, order number, page URL). See the subsections belowObject (Optional)
ChequeParamsReceipt parameters. Corresponds to the Cheque parameter in the receipt format. See the subsections belowObject (Optional)
OnTransactionCompletedFunction called after the transaction completes, before the widget closes. It has one argument, success, which is the operation result: true for a successful payment, false for an unsuccessful paymentFunction (Optional)

CustomParams

Widget template parameters. You can additionally pass any custom Merchant fields; they will be available in the template as placeholders.

ParameterDescription
TemplateTagName of the widget template used.
Must be passed if the Merchant uses multiple templates. If the parameter is not passed, the template named Default is used. Learn more about payment page templates.
LanguageWidget template language.
Must be passed if the template uses multiple languages. If the parameter is not passed, the Default template language is used. Learn more about payment page templates.

ChequeParams

Fiscal receipt parameters. The minimum set of fields is listed below:

ParameterDescription
PositionsList of receipt items. Each item includes:
• Item name (Text)
• Quantity (Quantity)
• Price (Price)
• Tax (Tax)

Important! The total of the receipt items must equal the operation amount in Amount. For a detailed description of item parameters, see the 54-FZ documentation.
CustomerContactThe Customer's phone number in the 79165554444 format or email address for sending the receipt. Used if the Customer does not provide a delivery address in the widget.
MessageEmail subject or SMS message text.
Generally, you can set a default value via Payture support and not pass it.

Important!

We recommend using the success parameter in OnTransactionCompleted only to determine the subsequent behavior of the Merchant's website. This parameter is vulnerable to manipulation by fraudsters and cannot serve as a guarantee of a successful payment.

To get the actual transaction results, use notifications.