### Create Payment Request Example Source: https://docs.mixplat.ru/extensions Example of a request payload for initiating a low-level payment. Ensure all fields like description, amount, and signature are correctly provided. ```json { "description" : "Оплата заказа №571 по счёту от 12.08", "amount" : 20000, "signature" : "d9729feb74992cc3482b350163a1a010" } ``` -------------------------------- ### Example Request Signature Calculation Source: https://docs.mixplat.ru/methods An example showing the concatenation of payment identifiers and API key for signature generation. ```text md5( 707607041571c23a4398db8ef7b3ae1f4b07aeeb7c54f8e3c7c9) ``` -------------------------------- ### Refund Payment Request Example Source: https://docs.mixplat.ru/methods This example demonstrates how to construct a POST-JSON request to the refund_payment endpoint to initiate a payment refund. Ensure the signature is correctly generated using the payment_id and your API_KEY. ```json POST https://api.mixplat.com/refund_payment { "api_version" : 3, "payment_id" : "XXehOfcV7wM2z7YGFHs5vCYEeCrbD3mh", "signature" : "d9729feb74992cc3482b350163a1a010" } ``` -------------------------------- ### Get Payment Status Request Example (JSON) Source: https://docs.mixplat.ru/methods This is an example of a JSON request to the get_payment_status endpoint. It includes the API version, payment ID, and signature required to identify the transaction. ```json { "api_version" : 3, "payment_id" : "796123456", "signature" : "d9729feb74992cc3482b350163a1a010" } ``` -------------------------------- ### Example SMS Notification from Mixplat Source: https://docs.mixplat.ru/extensions This is an example of the POST-JSON request sent by Mixplat to your handler URL when an SMS is received. Ensure your handler is configured to accept this format. ```json { "api_version" : 3, "request" : "sms", "project_id" : 1203, "sms_id" : 260692604, "user_phone" : "79031230001", "mobile" : { "payment_system" : "mobile_ru_beeline", "mccmnc" : 25099, "sender" : "3443", "text_raw" : "Добро 100", "prefix" : "добро", "text_after_prefix" : "100" }, "signature" : "5bc8837cebfd650a97fcdab650843c16" } ``` -------------------------------- ### Send SMS Request Example Source: https://docs.mixplat.ru/extensions This is an example of a POST-JSON request to the create_sms endpoint to send an SMS message. Ensure all required parameters like api_version, project_id, user_phone, message, and signature are correctly provided. ```json POST https://api.mixplat.com/create_sms { "api_version" : 3, "project_id" : 1203, "user_phone" : "79031230001", "message" : "Спасибо за участие. Ваш запрос принят.", "signature" : "5bc8837cebfd650a97fcdab650843c16" } ``` -------------------------------- ### Payment Check Request Example Source: https://docs.mixplat.ru/extensions This is an example of a POST-JSON request sent from Mixplat to a merchant's TSP to check payment feasibility. It includes all necessary parameters for the `payment_check` method. ```json POST { "api_version" : 3, "request" : "payment_check", "payment_id" : "XXehOfcV7wM2z7YGFHs5vCYEeCrbD3mh", "project_id" : 1203, "test" : 0, "amount" : 12000, "currency" : "RUB", "date_created" : "2028-02-29 11:22:33", "user_phone" : "79261000000", "mobile" : { "payment_system" : "mobile_ru_megafon", "billing_type" : "mc", "mccmnc" : 25002, "sender" : "3434", "text_raw" : "OKR 456", "prefix" : "OKR", "text_after_prefix" : "456" }, "signature" : "d9729feb74992cc3482b350163a1a010" } ``` -------------------------------- ### Phone Info Request Example Source: https://docs.mixplat.ru/extensions Example of a POST-JSON request to the phone_info endpoint to retrieve operator details for a specific phone number. Ensure the signature is correctly generated. ```json POST https://api.mixplat.com/phone_info { "api_version" : 3, "project_id" : 1203, "user_phone" : "79261000000", "signature" : "d9729feb74992cc3482b350163a1a010" } ``` -------------------------------- ### Get Payment Status Error Example Source: https://docs.mixplat.ru/methods Illustrates a typical error response when a payment ID is not found. Ensure the payment ID is correct before querying. ```json { "error_description" : "Payment ID XXehOfcV7wM2z7YGFHs5vCYEeCrbD3mh is not found" } ``` -------------------------------- ### Initiate Mobile Payment Source: https://docs.mixplat.ru/extensions Example of initiating a mobile payment using the create_payment API. Ensure the 'user_phone' and other required fields are correctly populated. ```json POST https://api.mixplat.com/create_payment { "api_version" : 3, "project_id" : 1203, "request_id" : "324223", "payment_method" : "mobile" "user_phone" : "79031234567" "merchant_payment_id" : "571", "description" : "Оплата заказа №571 по счёту от 12.08", "amount" : 20000, "signature" : "d9729feb74992cc3482b350163a1a010" } ``` ```curl curl https://api.mixplat.com/create_payment \ -X POST \ -H 'Content-Type: application/json' \ -d '{ \ "api_version" : 3, \ "project_id" : 1203, \ "request_id" : "324223", \ "payment_method" : "mobile" \ "user_phone" : "79031234567" \ "merchant_payment_id" : "571", ``` -------------------------------- ### Get Payment Status Request Example (cURL) Source: https://docs.mixplat.ru/methods This cURL command demonstrates how to send a POST request to the get_payment_status endpoint. Ensure the Content-Type header is set to application/json and the request body contains the necessary payment details. ```curl curl https://api.mixplat.com/get_payment_status \ -X POST \ -H 'Content-Type: application/json' \ -d '{ "api_version" : 3, "payment_id" : "796123456", "signature" : "d9729feb74992cc3482b350163a1a010" }' ``` -------------------------------- ### Forming Response Signature for get_payment_status Source: https://docs.mixplat.ru/methods This example shows how to generate the MD5 signature for the response from the get_payment_status method. It concatenates the payment_id and the API_KEY. ```text md5 ( payment_id+API_KEY) ``` -------------------------------- ### Error Response for Get Refund Status Source: https://docs.mixplat.ru/methods This example shows an error response when a refund is not found. The 'result' field indicates the error type, and 'error_description' provides more details. ```json { "result" : "error_refund_not_found", "error_description" : "Refund is not found" } ``` -------------------------------- ### Example Payment Status Notification from Mixplat Source: https://docs.mixplat.ru/methods This is an example of a POST request sent by Mixplat to the merchant's TSP to notify about a payment status. It includes detailed payment information, user data, and specific card details. ```json POST { "api_version" : 3, "request" : "payment_status", "payment_id" : "XXehOfcV7wM2z7YGFHs5vCYEeCrbD3mh", "merchant_payment_id" : "571", "payment_method" : "yandex_pay", "payment_method_group" : "card", "status" : "success", "status_extended" : "success_success", "amount" : 50000, "amount_user" : 50000, "amount_merchant" : 48750, "signature" : "d9729feb74992cc3482b350163a1a010", "test" : 0, "currency" : "RUB", "date_created" : "2019-03-03 11:45:23", "date_processed" : "2019-03-03 11:47:12", "project_id" : 1203, "merchant_data" : "Договор №571", "merchant_fields" : { "Cookie" : "HunjV5LHOvDIF", "client-category" : "VIP", "Возраст" : 33 }, "user_email" : "email@mail.ru", "user_name" : "Дмитрий", "user_phone" : "79031234567", "user_comment" : "Договор №571 от 19.07.2022", "user_account_id" : "124522751", "user_country_code" : "ru", "user_country" : "Россия", "user_region_code" : "RU-KLU", "user_region" : "Калужская обл.", "utm_source" : "vkontakte", "card" : { "pan" : "408397******8222", "payment_system" : "card_visa", "issuer_country_code" : "ru", "issuer_country" : "Россия", "issuer" : "ALFA-BANK" } } ``` -------------------------------- ### Forming Request Signature for get_payment_status Source: https://docs.mixplat.ru/methods This example demonstrates how to construct the MD5 signature for the get_payment_status request. It concatenates payment_id, merchant_payment_id, and the API_KEY. ```text md5 ( payment_id+merchant_payment_id+API_KEY) ``` -------------------------------- ### Example Request Signature Result Source: https://docs.mixplat.ru/methods The resulting MD5 hash after calculating the signature for a get_payment_status request. ```text 7e99a4988888d5c14b9faf2e14a95d43 ``` -------------------------------- ### Refund Status Notification Request Example Source: https://docs.mixplat.ru/methods This is an example of the POST-JSON request sent by Mixplat to the TSP's handler URL to notify about a refund's status. It includes all relevant payment and refund details. ```json POST { "api_version" : 3, "request" : "refund_status", "refund_id" : 19872, "payment_id" : "XXehOfcV7wM2z7YGFHs5vCYEeCrbD3mh", "merchant_payment_id" : "878712525", "amount" : 10000, "status" : "success", "date_created" : "2019-04-02 12:43:00", "date_completed" : "2019-04-02 13:15:00", "signature" : "d9729feb74992cc3482b350163a1a010" } ``` -------------------------------- ### Example Response Signature Result Source: https://docs.mixplat.ru/methods The resulting MD5 hash after calculating the signature for a get_payment_status response. ```text 047780e4f51dc6664d333536a6b4aab8 ``` -------------------------------- ### Get Subscription Status Request (cURL) Source: https://docs.mixplat.ru/methods This cURL command demonstrates how to send a request to get the subscription status. It uses the POST method and includes the necessary JSON payload in the request body. ```curl curl https://api.mixplat.com/get_subscription_status \ -X POST \ -H 'Content-Type: application/json' \ -d '{ "api_version" : 3, "recurrent_id" : "434241", "signature" : "d9729feb74992cc3482b350163a1a010" }' ``` -------------------------------- ### Create Payment Form Request (cURL) Source: https://docs.mixplat.ru/methods Example of a cURL command to create a payment form. This demonstrates how to send a POST request with a JSON payload to the Mixplat API. ```curl curl https://api.mixplat.com/create_payment_form \ -X POST \ -H 'Content-Type: application/json' \ -d '{ \ "api_version" : 3, \ "project_id" : 10001, \ "amount" : 50000, \ ``` -------------------------------- ### Get Register (get_register) Source: https://docs.mixplat.ru/extensions Retrieves registers of payments, SMS, and refunds from Mixplat. Supports daily or monthly periods. ```APIDOC ## POST /get_register ### Description Retrieves registers of payments, SMS, and refunds for a specified period (day or month). ### Method POST-JSON ### Endpoint https://api.mixplat.com/get_register ### Parameters #### Request Body Parameters - **api_version** (int) - Required - API version, always "3". - **company_id** (int) - Required - The Mixplat company ID for which the register is generated. - **period** (string) - Required - The day (YYYY-MM-DD) or month (YYYY-MM) for which the register is requested. - **signature** (string) - Required - The request signature, formed by MD5(company_id + period + API_KEY). ### Request Example ```json { "api_version": 3, "company_id": 10002020, "period": "2020-12-31", "signature": "0720d2e07297b0335bc568cc09e6aa1e" } ``` ### Response #### Success Response (200) - **result** (string) - Indicates "ok" on successful execution. - **error_description** (string) - Description of the error if `result` is not "ok". - **payment_register_id** (int|null) - ID of the payment register, or null if not found. - **payment_register_download_url** (string|null) - URL to download the payment register, or null if not found. - **sms_register_id** (int|null) - ID of the SMS register, or null if not found. - **sms_register_download_url** (string|null) - URL to download the SMS register, or null if not found. - **refund_register_id** (int|null) - ID of the refund register, or null if not found. - **refund_register_download_url** (string|null) - URL to download the refund register, or null if not found. #### Response Example ```json { "result": "ok", "payment_register_id": 12345, "payment_register_download_url": "https://api.mixplat.com/download/payment_register/12345", "sms_register_id": 67890, "sms_register_download_url": "https://api.mixplat.com/download/sms_register/67890", "refund_register_id": null, "refund_register_download_url": null } ``` ### XML Register Formats #### Payment Register XML - **id** (int) - Payment register ID. - **type** (string) - Register type, always `payment`. - **period** (string) - Register period (`daily` or `monthly`). - **date_begin** (string) - Start date of the period (YYYY-MM-DD). - **date_end** (string) - End date of the period (YYYY-MM-DD). - **company_id** (int) - Company ID. - **data** - Contains payment details. - **payment** - **payment_id** (string) - Payment ID. - **project_id** (int) - Project ID. - **merchant_payment_id** (string|null) - Merchant payment ID. - **merchant_data** (string|null) - Merchant-specific data. - **date_created** (string) - Payment creation date (YYYY-MM-DD HH:MM:SS). - **date_processed** (string|null) - Payment processing date (UTC+03:00). - **currency** (string) - Payment currency. - **amount** (int) - Payment amount in minor units. - **amount_user** (int|null) - Amount paid by user in minor units. - **amount_merchant** (int|null) - Amount to be paid to merchant in minor units. - **payment_method** (string|null) - Payment method used. - **user_phone** (string|null) - User's phone number. #### Refund Register XML - **id** (int) - Refund register ID. - **type** (string) - Register type, always `refund`. - **period** (string) - Register period (`daily` or `monthly`). - **date_begin** (string) - Start date of the period (YYYY-MM-DD). - **date_end** (string) - End date of the period (YYYY-MM-DD). - **company_id** (int) - Company ID. - **data** - Contains refund details. - **refund** - **refund_id** (string) - Refund ID. - **payment_id** (string) - ID of the payment for which the refund was made. - **currency** (string) - Refund currency. - **amount** (int) - Refund amount in minor units. - **project_id** (int) - Project ID. #### SMS Register XML - **id** (int) - SMS register ID. - **type** (string) - Register type, always `sms`. - **period** (string) - Register period (`daily` or `monthly`). - **date_begin** (string) - Start date of the period (YYYY-MM-DD). - **date_end** (string) - End date of the period (YYYY-MM-DD). - **company_id** (int) - Company ID. - **data** - Contains SMS details. - **sms** - **sms_id** (string) - SMS ID. - **project_id** (int) - Project ID for which the SMS was created. ``` -------------------------------- ### Error Response from Mixplat Source: https://docs.mixplat.ru/extensions An example of an error response from Mixplat, indicating an issue such as a project not being found or not active. The error_description provides more details. ```json { "result" : "error_project_not_found", "error_description" : "Project 1203 is not active" } ``` -------------------------------- ### Example Merchant Data for Payment Widget Source: https://docs.mixplat.ru/widget-options Illustrates the structure for passing arbitrary merchant data within the payment widget options. This data can be useful for tracking and filtering payments. ```json { "Cookie": "HunjV5LHOvDIF", "client-category": "VIP", "Возраст": 33 } ``` -------------------------------- ### Successful Payment Statuses Response Source: https://docs.mixplat.ru/methods This is an example of a successful response from the `get_payment_statuses` method, indicating 'ok' status and providing an array of payment objects. ```json { "result" : "ok", "payments" : [ { "payment_id" : "796123456", "project_id" : 1203, "status" : "success", "amount" : 12000, "currency" : "RUB", "date_created" : "2028-02-29 11:22:33" } ] } ``` -------------------------------- ### Successful Get Refund Status Response Source: https://docs.mixplat.ru/methods This is an example of a successful response from the get_refund_status method, indicating the refund was processed successfully. It includes payment details and timestamps. ```json { "result" : "ok", "payment_id" : "XXehOfcV7wM2z7YGFHs5vCYEeCrbD3mh", "merchant_payment_id" : "878712525", "amount" : 10000, "status" : "success", "date_created" : "2019-04-02 12:43:00", "date_completed" : "2019-04-02 13:15:00", "signature" : "d9729feb74992cc3482b350163a1a010" } ``` -------------------------------- ### Initialize Mixplat Widget with JS Source: https://docs.mixplat.ru/widget-options Initialize the Mixplat widget and set payment options using plain JavaScript. Define callbacks for success, failure, and close events. ```javascript document.addEventListener('DOMContentLoaded', function(){ let elem = document.getElementById('mixplat_widget'); elem.addEventListener('click', function(){ let options = { widget_key: '1becc19b-d3e8-422f-bb28-14ec9d94e66b', amount: 1000, // 10 руб. 00 коп. description: 'Благотворительное пожертвование', payment_method: 'card', user_email: 'email@mail.ru', user_phone: '79031234567', merchant_payment_id: '1234567' } let M = new Mixplat(options); M.build(); M.setSuccessCallback(function(o, i){ console.log('success'); }); M.setFailCallback(function(o, i){ console.log('fail'); }); M.setCloseCallback(function(o, i){ console.log('close'); }); }); }); ``` -------------------------------- ### Error Response for Get Payment Status Source: https://docs.mixplat.ru/methods This is an example of an error response from the Mixplat API when a payment is not found. The 'result' field indicates the specific error encountered. ```json { "result" : "error_payment_not_found" } ``` -------------------------------- ### Successful Get Payment Status Response Source: https://docs.mixplat.ru/methods This is an example of a successful response from the Mixplat API for the get_payment_status method. It includes detailed information about the payment, such as status, amounts, timestamps, and user-provided data. ```json { "result" : "ok", "payment_id" : "796123456", "merchant_payment_id" : "572", "payment_method" : "bank", "payment_method_group" : "sbp", "status" : "success", "status_extended" : "success_success", "amount" : 50000, "amount_user" : 50000, "amount_merchant" : 48750, "test" : 0, "currency" : "RUB", "date_created" : "2019-03-03 11:45:23", "date_processed" : "2019-03-03 11:47:12", "project_id" : 1203, "merchcant_data" : "Договор №571", "merchant_fields" : { "Cookie" : "HunjV5LHOvDIF", "client-category" : "VIP", "Возраст" : 33 }, "user_email" : "email@mail.ru", "user_name" : "Дмитрий", "user_phone" : "79031234567", "user_comment" : "Договор №571 от 19.07.2022", "user_account_id" : "124522751", "user_country_code" : "ru", "user_country" : "Россия", "user_region_code" : "RU-KLU", "user_region" : "Калужская обл.", "utm_source" : "vkontakte", "bank" : { "pan" : "408178**********2202", "issuer_country_code" : "ru", "issuer_country" : "Россия", "issuer" : "ALFA-BANK" } } ``` -------------------------------- ### Generate Payment Signature in Python Source: https://docs.mixplat.ru/extensions This Python snippet shows how to create the MD5 signature for a low-level payment initiation. It uses the `hashlib` module and requires the API key, project ID, request ID, and merchant payment ID. ```Python import hashlib api_key = '6yh9ik3f1734f29e3dc0118034277e67504rfjj9' project_id = 123456 request_id = 'test_request_id' merchant_payment_id = 'test_merchant_payment_id' signature_string = f"{request_id}{project_id}{merchant_payment_id}{api_key}" signature = hashlib.md5(signature_string.encode()).hexdigest() ``` -------------------------------- ### Handle Payment Process Initialization Source: https://docs.mixplat.ru/widget-options Use setProcessCallback to execute a function when the payment process begins. This callback is intended for lightweight actions as the payment is initializing. ```javascript M.setProcessCallback(function(o, i){ // действия в момент начала обработки платежа console.log('pending'); }); ``` -------------------------------- ### Initialize Mixplat Widget with jQuery Source: https://docs.mixplat.ru/widget-options Initialize the Mixplat widget and set payment options using jQuery. Define callbacks for success, failure, and close events. ```javascript $(function(){ $('#mixplat_widget').on('click', function(){ let options = { widget_key: '1becc19b-d3e8-422f-bb28-14ec9d94e66b', amount: 1000, // 10 руб. 00 коп. description: 'Благотворительное пожертвование', payment_method: 'card', user_email: 'email@mail.ru', user_phone: '79031234567', merchant_payment_id: '1234567' } let M = new Mixplat(options); M.build(); M.setSuccessCallback(function(o, i){ console.log('success'); }); M.setFailCallback(function(o, i){ console.log('fail'); }); M.setCloseCallback(function(o, i){ console.log('close'); }); }); }); ``` -------------------------------- ### Initiate Low-Level Payment (create_payment) Source: https://docs.mixplat.ru/extensions Allows users to initiate a low-level payment by providing various optional and mandatory parameters. This includes details about the payment, user, currency, and redirection URLs. ```APIDOC ## POST /create_payment ### Description Initiates a low-level payment transaction. This method allows for detailed configuration of the payment, including user-specific information, currency, and optional features like test mode or recurring payments. ### Method POST ### Endpoint /create_payment ### Parameters #### Request Body - **api_version** (int) - Required - API version. - **project_id** (int) - Required - Project identifier. - **request_id** (string) - Required - Unique identifier for the request. - **payment_method** (string) - Required - The method of payment (e.g., "mobile", "card"). - **merchant_payment_id** (string) - Required - Merchant's unique identifier for the payment. - **description** (string) - Required - Description of the payment. - **amount** (int) - Required - The amount to be paid in the smallest currency unit (e.g., kopecks for RUB). - **signature** (string) - Required - Signature for request verification. - **user_comment** (string) - Optional - User-defined comment for the payment. - **user_account_id** (string) - Optional - User's account ID within the merchant's system. - **test** (int) - Optional - Flag for test payment (1 for test, 0 for real). Defaults to 0. - **timeout** (int) - Optional - Time in seconds allocated for payment. Defaults to 21600 (6 hours). - **language** (string) - Optional - Language for the payment form and messages. Defaults to "RU" or "EN" based on IP. - **currency** (string) - Optional - Payment currency. Defaults to RUB. - **items** (json-object) - Optional - Data for the fiscal receipt. Structure defined in section 3.7. - **redirect_url** (string) - Required if payment_method is "card" - URL to redirect the payer after 3D Secure authentication. - **recurrent_payment** (int) - Optional - Flag for setting up a recurring payment (1 for recurring, 0 for regular). Defaults to 0. - **payment_scheme** (string) - Optional - Payment scheme for bank cards. Defaults to "single". - **utm_medium** (string) - Optional - UTM parameter for traffic type. - **utm_source** (string) - Optional - UTM parameter for traffic source. - **utm_campaign** (string) - Optional - UTM parameter for advertising campaign. - **utm_term** (string) - Optional - Custom UTM parameter. - **user_phone** (string) - Optional - User's phone number, required for 'mobile' payment method. ### Request Example ```json { "api_version": 3, "project_id": 1203, "request_id": "324223", "payment_method": "mobile", "user_phone": "79031234567", "merchant_payment_id": "571", "description": "Оплата заказа №571 по счёту от 12.08", "amount": 20000, "signature": "d9729feb74992cc3482b350163a1a010" } ``` ### Response #### Success Response (200) - **result** (string) - "ok" indicates successful receipt of the payment request. This does not confirm the payment status itself. - **payment_id** (string) - The ID of the created payment. Present only if result is "ok". - **recurrent_id** (string) - ID of the linked card for subsequent recurrent payments. Present if result is "ok" and recurring payments are enabled. - **redirect_url** (string) - URL to redirect the payer. Present if result is "ok". #### Error Response - **result** (string) - Not "ok" indicates an error. - **error_description** (string) - Description of the error that occurred. Present only if result is not "ok". #### Response Example (Success) ```json { "result": "ok", "payment_id": "some_payment_id", "recurrent_id": "some_recurrent_id", "redirect_url": "https://example.com/payment_page" } ``` #### Response Example (Error) ```json { "result": "error", "error_description": "Invalid payment method" } ``` ``` -------------------------------- ### Example Items for Payment Widget Receipt Source: https://docs.mixplat.ru/widget-options Demonstrates the structure for providing item details for the payment widget's receipt. This is used for generating receipts and can include item name, quantity, sum, and VAT. ```json [ { "name": "Xiaomi MI", "quantity": 2, "sum": 3500000, "vat": "vat20" } ] ``` -------------------------------- ### Create Payment Form Request (JSON) Source: https://docs.mixplat.ru/methods Example of a JSON request to create a payment form. This includes essential details like project ID, amount, signature, and optional parameters for user information and redirects. ```json POST https://api.mixplat.com/create_payment_form { "api_version" : 3, "project_id" : 10001, "amount" : 50000, "signature" : "d9729feb74992cc3482b350163a1a010", "description" : "Оплата по договору №571 от 19.07.2022", "payment_method" : "card", "merchant_payment_id" : "571", "merchant_data" : "Договор №571", "merchant_fields" : { "Cookie" : "HunjV5LHOvDIF", "client-category" : "VIP", "Возраст" : 33 }, "user_email" : "email@mail.ru", "user_name" : "Дмитрий", "user_phone" : "79037652277", "user_comment" : "Договор №571 от 19.07.2022", "user_account_id" : "124522751", "url_success" : "https://site.ru/success.html", "url_failure" : "https://site.ru/failure.html", "utm_source" : "vkontakte" } ``` -------------------------------- ### setProcessCallback Source: https://docs.mixplat.ru/widget-options This function is called at the moment the payment initialization begins. It is intended for light scripts and cannot be used for redirection. ```APIDOC ## setProcessCallback ### Description Called at the moment payment initialization begins. Intended for light scripts. ### Method JavaScript function call ### Parameters - **callback** (function) - Required - A function to execute when payment processing starts. ### Request Example ```javascript M.setProcessCallback(function(o, i) { // actions at the moment of payment processing start console.log('pending'); }); ``` ``` -------------------------------- ### Error Confirm Payment Response Source: https://docs.mixplat.ru/methods An example of an error response from the Mixplat API when a payment confirmation fails, such as when the payment is not found. ```json { "result" : "error_payment_not_found", "error_description" : "Payment is not found" } ``` -------------------------------- ### Create Payment Source: https://docs.mixplat.ru/methods Initiates a payment by displaying the Mixplat payment form. The response includes a payment_id used for subsequent status updates. ```APIDOC ## create_payment_form ### Description Initiates a payment by displaying the Mixplat payment form. The response includes a payment_id used for subsequent status updates. ### Method POST (Assumed, as it initiates an action) ### Endpoint /create_payment_form (Assumed based on method name) ### Parameters #### Request Body (No specific parameters detailed in the source text) ### Response #### Success Response - **payment_id** (string) - The unique identifier for the payment, used for tracking status. ``` -------------------------------- ### Signature Generation Example Source: https://docs.mixplat.ru/methods Illustrates the process of generating the MD5 signature for verifying the authenticity of the payment status notification. The signature is formed by concatenating the payment ID and the merchant's API key. ```text md5( 707607041c23a4398db8ef7b3ae1f4b07aeeb7c54f8e3c7c9) ``` -------------------------------- ### Successful SMS Response Source: https://docs.mixplat.ru/extensions This is an example of a successful response from the Mixplat API after sending an SMS. It includes the result status and additional mobile-specific information. ```json { "result" : "ok", "mobile" : { "payment_system" : "mobile_ru_beeline", "mccmnc" : 25099, "sender" : "3443" } } ``` -------------------------------- ### Open Mixplat Widget in Modal Source: https://docs.mixplat.ru/widget-options Use this snippet to display the Mixplat payment form in a modal window when a button is clicked. It requires an HTML button element and JavaScript to initialize the widget and set callbacks. ```html MIXPLAT widget test ``` -------------------------------- ### Successful Refund Payment Response Source: https://docs.mixplat.ru/methods This is an example of a successful response from the Mixplat API after a refund payment request. It includes the result status and the unique refund_id. ```json { "result" : "ok", "refund_id" : 19872 } ``` -------------------------------- ### Create Payment Input Element Source: https://docs.mixplat.ru/widget-options An input element of type 'button' can also be used to initiate the payment process. ```html ```