### Install Prodamus Widget Script Source: https://help.prodamus.ru/payform/integracii/cms/vidzhet-i-primery-knopok-dlya-saita To install the Prodamus widget on your website, insert the provided script tag before the closing tag. This script loads the necessary functionality for the payment widget. Several domain variations are provided for different environments. ```html ``` ```html ``` ```html ``` ```html ``` -------------------------------- ### Configure External GET Request for Payment Link Source: https://help.prodamus.ru/payform/integracii/servisy-dlya-chat-botov/integraciya-s-sistemoi-smartsender/otsylaem-ssylku-na-oplatu This snippet outlines the configuration for an 'External Request' block, specifically a GET request, to obtain a payment link. It details the URL, required parameters, and variable substitutions for dynamic data like customer phone, product details, user ID, and action type. Ensure variables are correctly substituted to avoid errors. ```text Method: GET URL: [Your Payment Page Link] Parameters: do: link customer_phone: {{ tel }} products[0][name]: {{ products_name }} products[0][price]: {{ products_price }} products[0][quantity]: 1 type: json _param_userid: {{ userId }} sys: smartsender _param_smartsender_action: {{ action }} ``` -------------------------------- ### payformInit Function Parameters Source: https://help.prodamus.ru/payform/integracii/integraciya-eo-v-konstruktory-saitov Details on the parameters available for the `payformInit` function, including order details and customer information. ```APIDOC ## payformInit Function Parameters ### Description This section describes the parameters that can be passed to the `payformInit` function for customizing payment requests. ### Method N/A (Client-side JavaScript function) ### Endpoint N/A (Client-side JavaScript function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```javascript // Example with additional customer details const UNIQ_IDButton = document.querySelector("#UNIQ_ID"); UNIQ_IDButton?.addEventListener("click", () => { payformInit("XXX.payform.ru", { order_sum: 100, currency: "rub", customer_email: "test@mail.ru", // Optional: Customer's email customer_phone: "+79994478937" // Optional: Customer's phone number }); }); ``` ### Response #### Success Response (200) N/A (Client-side integration) #### Response Example N/A (Client-side integration) ### Parameter Details: * **`XXX.payform.ru`** (string) - Required - Your school's payment page URL (e.g., `yourdomain.payform.ru`). * **`order_sum`** (number) - Required - The total amount of the order. * **`currency`** (string) - Optional - The currency of the order. Accepted values: `rub`, `usd`, `eur`, `kzt`. If omitted, the system defaults to `rub`. * **`customer_email`** (string) - Optional - The email address of the customer. * **`customer_phone`** (string) - Optional - The phone number of the customer. **Note:** If `customer_email` and `customer_phone` are not provided, the widget will prompt the customer to enter them. ``` -------------------------------- ### Installments Disabled Parameter Source: https://help.prodamus.ru/payform/integracii/rest-api/instrukcii-dlya-samostoyatelnaya-integracii-servisov This section details the 'installments_disabled' parameter, which controls the availability of installment payment methods. ```APIDOC ## GET /websites/help_prodamus_ru_payform ### Description This endpoint allows you to retrieve information related to payment form configurations, specifically focusing on the 'installments_disabled' parameter. ### Method GET ### Endpoint /websites/help_prodamus_ru_payform ### Query Parameters #### installments_disabled (integer) - Optional - If passed and not 0, payment methods related to installments will be unavailable for selection during payment. ### Response #### Success Response (200) - **installments_disabled** (integer) - Indicates whether installment payments are disabled. #### Response Example { "installments_disabled": 0 } ``` -------------------------------- ### Webhook Notification Payload Example (PHP Array) Source: https://help.prodamus.ru/payform/uvedomleniya/kak-ustroena-otpravka-uvedomlenii-ob-oplate This snippet shows an example of the data structure sent in a webhook notification for a successful payment. It includes details about the order, customer, payment, and products. This format is typically processed as a PHP array. ```php '2020-07-27T12:31:01+03:00', 'order_id' => '300155', 'order_num' => 'test', 'domain' => 'demo.payform.ru', 'sum' => '100.00', 'customer_phone' => '+79999999999', 'customer_email' => '', 'customer_extra' => 'тест', 'payment_type' => 'Пластиковая карта Visa, MasterCard, МИР', 'commission' => '3.5', 'commission_sum' => '0.03', 'attempt' => '1', 'sys' => 'demo', 'vk_user_id' => '1234567890', 'products' => [ [ 'name' => 'Доступ в клуб "Девелопер клаб"', 'price' => '100.00', 'quantity' => '1', 'sum' => '100.00' ] ], 'payment_status' => 'success', 'payment_status_description' => 'Успешная оплата' ]; ?> ``` -------------------------------- ### Integrate Prodamus Widget Scripts and Stylesheet Source: https://help.prodamus.ru/payform/integracii/integraciya-eo-v-konstruktory-saitov This snippet includes the necessary JavaScript and CSS files from Prodamus to initialize the payment widget on your website. These should be placed within the section of your HTML. ```html ``` -------------------------------- ### GET /websites/help_prodamus_ru_payform Source: https://help.prodamus.ru/payform/integracii/rest-api/instrukcii-dlya-samostoyatelnaya-integracii-servisov Retrieves information about payment limits for a specific Prodamus Payform. ```APIDOC ## GET /websites/help_prodamus_ru_payform ### Description Retrieves information about payment limits for a specific Prodamus Payform. ### Method GET ### Endpoint /websites/help_prodamus_ru_payform ### Parameters #### Query Parameters - **payments_limit** (integer) - Optional - The payment limit for the generated link. ### Response #### Success Response (200) - **payments_limit** (integer) - The payment limit for the generated link. #### Response Example { "payments_limit": 10000 } ``` -------------------------------- ### Configure Prodamus Payment Module Settings Source: https://help.prodamus.ru/payform/integracii/servisy-dlya-chat-botov/activeusers This section details the configuration of the 'External Payment Module' (ВРМ Продамус) within the Prodamus payment system. It specifies the required fields: 'Payment System' (select 'Prodamus'), 'Phone' (using the variable `{b.0.request.customer_phone}`), and 'Amount' (which can be a fixed value or a variable like `{b.0.request.sum}`). The 'Description' field is optional for additional payment notification data. Settings are then saved. ```text 1) Поле “Платежная система” - выберите из списка “Продамус”. 2) Поле “Телефон” - обязательное поле. Вставьте значение: `{b.0.request.customer_phone}` вставьте значение именно в этом виде, со скобками 3) Поле “Сумма” - можно указать фиксированное значение цифрами, можно указать в виде переменной, если у вас настроены другие процессы и вы хотите, чтобы сумма генерировалась автоматически под каждый случай покупки: `{b.0.request.sum}` переменная суммы 4) Поле “Описание” - не обязательное, эти данные поступают как дополнительные в систему уведомлений о совершившихся платежах 5) Сохраняем настройки. ``` -------------------------------- ### GET /websites/help_prodamus_ru_payform Source: https://help.prodamus.ru/payform/integracii/tekhnicheskaya-dokumentaciya-po-avtoplatezham/uvedomleniya Retrieves detailed information about a subscription, including payment dates, discount amounts, and autopayment status. ```APIDOC ## GET /websites/help_prodamus_ru_payform ### Description Retrieves detailed information about a subscription, including payment dates, discount amounts, and autopayment status. ### Method GET ### Endpoint /websites/help_prodamus_ru_payform ### Parameters #### Query Parameters - **next_payment_discount** (number) - Optional - The amount of discount for the next payment. - **next_payment_discount_num** (integer) - Optional - The number of future payments eligible for the discount. - **date_create** (string) - Optional - The date the subscription was created. - **date_first_payment** (string) - Optional - The date of the first payment. - **date_last_payment** (string) - Optional - The date of the last actual payment. - **date_next_payment** (string) - Optional - The date of the next scheduled payment. - **date_next_payment_discount** (string) - Optional - The date when the next payment discount amount is determined. - **payment_num** (integer) - Optional - The total number of payments made. - **current_attempt** (integer) - Optional - The current attempt number for automatic payment. - **max_attempts** (integer) - Optional - The maximum number of allowed automatic payment attempts. - **autopayment** (integer) - Optional - Indicates the autopayment status. 0 for purchase, 1 for automatic debit. ### Request Example ```json { "next_payment_discount": 10.50, "next_payment_discount_num": 2, "date_create": "2023-10-26T10:00:00Z", "date_first_payment": "2023-11-01T10:00:00Z", "date_last_payment": "2024-01-15T10:00:00Z", "date_next_payment": "2024-02-01T10:00:00Z", "date_next_payment_discount": "2024-01-25T10:00:00Z", "payment_num": 3, "current_attempt": 1, "max_attempts": 5, "autopayment": 1 } ``` ### Response #### Success Response (200) - **next_payment_discount** (number) - The amount of discount for the next payment. - **next_payment_discount_num** (integer) - The number of future payments eligible for the discount. - **date_create** (string) - The date the subscription was created. - **date_first_payment** (string) - The date of the first payment. - **date_last_payment** (string) - The date of the last actual payment. - **date_next_payment** (string) - The date of the next scheduled payment. - **date_next_payment_discount** (string) - The date when the next payment discount amount is determined. - **payment_num** (integer) - The total number of payments made. - **current_attempt** (integer) - The current attempt number for automatic payment. - **max_attempts** (integer) - The maximum number of allowed automatic payment attempts. - **autopayment** (integer) - Indicates the autopayment status. 0 for purchase, 1 for automatic debit. #### Response Example ```json { "next_payment_discount": 10.50, "next_payment_discount_num": 2, "date_create": "2023-10-26T10:00:00Z", "date_first_payment": "2023-11-01T10:00:00Z", "date_last_payment": "2024-01-15T10:00:00Z", "date_next_payment": "2024-02-01T10:00:00Z", "date_next_payment_discount": "2024-01-25T10:00:00Z", "payment_num": 3, "current_attempt": 1, "max_attempts": 5, "autopayment": 1 } ``` ``` -------------------------------- ### Construct Message with Payment Link Variable Source: https://help.prodamus.ru/payform/integracii/servisy-dlya-chat-botov/integraciya-s-sistemoi-smartsender/otsylaem-ssylku-na-oplatu This snippet shows how to configure the 'Write Message' block to include a dynamic payment link. It involves setting the content type to 'Text' and crafting the message body, ensuring the `{{ payment_link }}` variable is included. The example demonstrates a personalized message format. ```text Block: Write Message Content Type: Text Message Text: {{ firstName }}, ваша ссылка на оплату {{ payment_link }} ```