### GET Request Signature Example (Conceptual) Source: https://api.payselection.com/index This example outlines the components for generating an X-REQUEST-SIGNATURE for a GET request. Unlike POST requests, GET requests do not have a request body, so it is omitted from the signature string calculation. The signature is calculated using the request method, URL, X-SITE-ID, and X-REQUEST-ID. ```text GET /orders/123456 999999 test123 ``` -------------------------------- ### Payment Verification Webhook Setup Source: https://api.payselection.com/index Guidance on setting up the payment verification webhook, which is activated by technical support for matching payment request data with order data. ```APIDOC ## Payment Verification Webhook Setup ### Description This webhook is activated by technical support to receive payment request data for matching with order data. It is distinct from standard payment result webhooks. ### Setup Process To enable, configure, and disable the payment verification webhook, contact support@payselection.com. In your email, provide: 1. The return URL where the webhook data will be sent. You can also pre-configure a static return URL in the "Websites" -> "Settings" section of your personal account. 2. The specific parameters from the request that need to be verified (these are all parameters included in the `create` method's payment request). ### Service Response After the payment verification webhook is connected and you send a request with the necessary parameters and return URL, your receiving service must respond with: 1. A 200 status code if the payment can proceed. 2. 4xx and 5xx status codes in various forms to interrupt the payment process. ``` -------------------------------- ### Initiate Payment with CardRSAToken in JavaScript Source: https://api.payselection.com/index This example demonstrates how to call the `CardRSAToken` function in JavaScript after the library is included. It defines a `pay` function that takes a public key and transaction/card data, then calls `CardRSAToken` to get a payment token. An event listener is attached to a button to trigger this function upon click. ```javascript function pay() { var key = 'LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQ1ZEQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FrRUFNSUlDUEFLQ0FqTU1lTy84Q1VRaUNQNDYxdXBsY0xCTAowb1BBYjAyM3dZNTFtT040eDJPd0xJTzd1NjR3djkyVE05cUhYbUdISkhnSHgyRG5FclZySXJBZXVhQ2V5eHBGClZvVndETUs2WmpKMUZmR3NESVNpRGNBQmFCbEQ3c2trcmdibTZUeWFnUUxjMDFBUDBPVVYrUVR0WUNuVVBVUy8KWllRUHNDMU9IRFg1eGsvd1FMVXdCemM1NWdXemFKT20ydWtNQ09lWURvNjNaSklhdEVOdXJ6bDhKSUd6YTRtdAp4S1YxTDdXN3FHYzFBRWNXK2NmaEVRaFo0ZWpkbVFsWnJyK1NhYVhPdjBsenRUeTZOU0prZWEwNksxT3l4Mk9aCnU0anh0R1A2QmhRU0FZLys3TTlDMDMwMjZXbTdJeS9tZUhKUTNTSHVDZ0s4dzdlUjBnTDd1S0UyR0psSmI5aFYKVzlOZ3hTRS9Ed0pVZUpsWVpUTHVxclo0SnExQUU4alBrUzF5MXdDNjUrM2pmZ2l4dG0ySit0cXYzWEhwZVFCUgo4T1BJODJhK3hHbkFIelRpZk5NMjlaeWpaV0ZLNGsrdHpWdW04TXlxcTRNMnlDbGFwT2VoZ1Y1UlVLUUVZNVpsCnZxbzJGbkZVL09WM2F6RDBrRU5GTmNnTGRZU1dnM3pKK1EvWDdhSTJtUzZZWWdvbnpPT0h2eGJUQU5uNWFMeDIKWU01Y2VvWk5TbWxveTM1UEliTXJJSjN5SGtaU1RJN0JQaFVIT3dTVTB6eGdqQmhETkpCZ3RTVTZyMkdvNmhGTApGZnpNM1NERDltMVBBWDNIQmRpcHVnUWtpTUgxYVVVY3RaR0ovczU5Y0wzQkZuVStTRk9pbVArRUl6L0NGN1RkCmpNSVlpcmFEbElsZy9qL1FiNitMTGNJYW1RODYzRkdtR3NqLzU1bit3WGF1a2E1YmFRRjl3c1YwL2ppTTBwb3UKT1pFUUQwK25FbjFRVS9qQ2FUdm8reUl3QndJREFRQUIKLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0t'; var data = { TransactionDetails: { Amount: '100', Currency: 'RUB', }, PaymentDetails: { CardholderName: 'Card Holder', CardNumber: '4111111111111111', CVC: '600', ExpMonth: '05', ExpYear: '25', } }; CardRSAToken(key, data).then(function(token) { // DO SOMETHING WITH token }); } var button = document.getElementById("pay-btn"); button.onclick = pay; ``` -------------------------------- ### POST Request Signature Example (Python) Source: https://api.payselection.com/index This Python code snippet demonstrates how to generate the X-REQUEST-SIGNATURE for a POST request. It constructs the signature string using the request method, URL, X-SITE-ID, X-REQUEST-ID, and the request body, then calculates the HMAC-SHA256 hash. Ensure the `secretKey` or `publicKey` is correctly set for your account. ```python import hashlib import hmac # Задайте параметры запроса request_method = "POST" # Метод запроса url = "https://example.com" # Адрес запроса или адрес сайта x_site_id = "99999" # X-SITE-ID (тест) x_request_id = "1qazxsw23edc" # X-REQUEST-ID (тест) request_body = '{ "MetaData": { "PaymentType": "Pay", "TypeLink": "Reusable", "PreviewForm": false }, "PaymentRequest": { "OrderId": "12323", "Amount": "5", "Currency": "RUB", "Description": "string", "RebillFlag": true, "ExtraData": { "WebhookUrl": "https://webhook.site/382e2f42-e266-406f-95a9-839834098ccd", "TestInfo": "TestInfo123" } }, "CustomerInfo": { "Email": "i.frolov@payselection.com", "ReceiptEmail": "i.frolov@payselection.com", "Phone": "+79059992255", "Language": "ru", "Address": "Russia", "Town": "Moscow", "ZIP": "123321", "Country": "RUS" } }' # Задайте ваш секретный ключ или публичный ключ (тест) site_secret_key = "fLdy7fSenC6KVDKm" # Создайте строку для вычисления сигнатуры signature_string = f"{request_method}\n{url}\n{x_site_id}\n{x_request_id}\n{request_body}" # Вычислите HMAC-SHA256 хэш request_signature = hmac.new(site_secret_key.encode('utf-8'), signature_string.encode('utf-8'), hashlib.sha256).hexdigest() # Выведите результат print(f"Request Signature: {request_signature}") ``` -------------------------------- ### Request Signature Generation Source: https://api.payselection.com/index Details on how to generate the X-REQUEST-SIGNATURE for secure API requests. This includes the components used in the signature string and an example using Python. ```APIDOC ## Request Signature Generation **Description**: The `X-REQUEST-SIGNATURE` is a security measure to ensure the integrity and authenticity of API requests. It is generated using a secret or public key and specific request parameters. **Components for Signature String**: 1. Request method (e.g., POST, GET) 2. URL of the request 3. `X-SITE-ID` (Site ID from your Personal Account) 4. `X-REQUEST-ID` (Unique identifier generated by the merchant) 5. Request body (if applicable, with exact formatting) **Security Keys**: - `secretKey`: Used for payment operations and recurring payments. - `publicKey`: Used for PayWidget integration and PayLink methods. **Hashing Algorithm**: SHA256 (output in lowercase hexadecimal format). ### Request Example (Python) ```python import hashlib import hmac # Request parameters request_method = "POST" url = "https://example.com/payments/requests/single" x_site_id = "99999" x_request_id = "1qazxsw23edc" request_body = '{ "Amount": "123", "Currency": "RUB", "ExtraData": { "custom": "field", "key": "value" }, "CustomerInfo": { "Address": "string", "Country": "string", "Email": "string", "Language": "string", "Phone": "string", "Town": "string", "ZIP": "string" }, "Description": "string", "OrderId": "string", "PaymentMethod": "card", "PaymentDetails": { "CardholderName": "string", "CardNumber": "4111111111111111", "CVC": "987", "ExpMonth": "12", "ExpYear": "22" }, "RebillFlag": true }' # Your secret key (example) site_secret_key = "Tkrdjvb87630Uegp" # Create the string for signature calculation signature_string = f"{request_method}\n{url}\n{x_site_id}\n{x_request_id}\n{request_body}" # Calculate the HMAC SHA256 hash request_signature = hmac.new(site_secret_key.encode('utf-8'), signature_string.encode('utf-8'), hashlib.sha256).hexdigest() print(f"X-REQUEST-SIGNATURE: {request_signature}") ``` ### Important Notes - Parameter names are case-sensitive. - The `request_body` used for signature calculation must be identical in content and formatting to the actual request body. ``` -------------------------------- ### CardRSAToken Library Usage Source: https://api.payselection.com/index This section details the parameters required for the CardRSAToken library to generate a cryptogram. ```APIDOC ## CardRSAToken Library ### Description Library for encrypting card and transaction data using the public key via RSA-OAEP scheme and converting it into a Base64 encoded string cryptogram. To form the cryptogram, you will need: 1. **Script**: `https://cardcryptotoken.payselection.com/CardRSAToken.js` 2. **Information about card data and transaction data**: ### Parameters #### Request Body Parameters - **TransactionDetails** (Object) - Required - Contains details about the transaction. - **Amount** (String) - Required - Transaction amount. Example: `100` - **Currency** (String) - Required - Transaction currency code according to ISO 4217. Example: `RUB`, `USD`, `EUR`. Refer to your manager for supported currencies. - **PaymentDetails** (Object) - Required - Contains details about the payment. - **CardholderName** (String) - Required - Name of the cardholder. Example: `Card Holder` - **CardNumber** (String) - Required - Card number. Example: `4111 1111 1111 1111` - **CVC** (String) - Required - Card Verification Value. Example: `600` - **ExpMonth** (String) - Required - Card expiration month. Example: `05` - **ExpYear** (String) - Required - Card expiration year. Example: `25` - **MessageExpiration** (timestamp / number) - Optional - The expiration time of the cryptogram in milliseconds. Example: `Date.now()+86400000` (24 hours) ``` -------------------------------- ### Mobile SDK Integration Source: https://api.payselection.com/index Information on integrating the PayApp SDK into mobile applications for iOS and Android to handle payments and transaction statuses securely. ```APIDOC ## Mobile SDK Integration ### Description The PayApp SDK allows for the integration of payment acceptance into native iOS and Android applications. It supports creating orders, processing card payments, and retrieving transaction statuses, utilizing a cryptogram method for secure payment processing. ### Available Platforms: - **iOS**: Tools for building a custom payment form on iOS. Library available [here](link_to_ios_library). - **Android**: Tools for building a custom payment form on Android. Library available [here](link_to_android_library). - **Flutter**: Tools for building a custom payment form on Flutter. Library available [here](link_to_flutter_library). - **React Native**: Tools for building a custom payment form on React Native. Library available [here](link_to_react_native_library). ``` -------------------------------- ### CardCryptoToken Integration Source: https://api.payselection.com/index This section details how to integrate the CardCryptoToken JavaScript library into your HTML file to enable secure payment processing. ```APIDOC ## CardCryptoToken Integration ### Description This guide explains how to include the CardCryptoToken script in your HTML and use it to generate a payment cryptogram. ### Method JavaScript Function Call ### Endpoint N/A (Client-side script) ### Parameters #### Global Variables - **key** (string) - Required - Your public key for encryption. - **data** (object) - Required - An object containing transaction and payment details. - **TransactionDetails** (object) - Required - Details of the transaction. - **Amount** (string) - Required - The transaction amount. - **Currency** (string) - Required - The currency of the transaction (e.g., 'RUB'). - **PaymentDetails** (object) - Required - Details of the payment card. - **CardholderName** (string) - Required - The name of the cardholder. - **CardNumber** (string) - Required - The payment card number. - **CVC** (string) - Required - The CVC code of the card. - **ExpMonth** (string) - Required - The expiration month of the card (MM format). - **ExpYear** (string) - Required - The expiration year of the card (YY format). ### Request Example ```javascript function pay() { var key = 'YOUR_PUBLIC_KEY'; // Replace with your actual public key var data = { TransactionDetails: { Amount: '100', Currency: 'RUB', }, PaymentDetails: { CardholderName: 'Card Holder', CardNumber: '4111111111111111', CVC: '600', ExpMonth: '05', ExpYear: '25', } }; CardCryptoToken(key, data).then(function(token) { // Handle the generated token (cryptogram) console.log(token); }); } ``` ### Response #### Success Response (Promise resolves with token) - **token** (string) - The generated payment cryptogram. #### Response Example ```json { "signedMessage": "{\"encryptedMessage\":\"Iyta7R1RUYn3CxnwVv6PXY1ZBadNMut1pfc7rlhkA8BL9s5NbtYDZq18MUvs+SKuQisA6z9ju6mtxiAPtQu2FB2g2uYQ1wI5/NzAalY4LD2UXyIdXcwJI+Gz3PBSvALg+P1izr1VWhR8yoy+s8O8aWXawQWxqilEWPYB4cDQ16NIGt86Xj9xNL0yAiXrvWONyIrdssxZ+69PUHXe f1gZzX2rHwevcCb614OB6RtrUurDkP7gn8yyoMmgQESpwP9xfdE3Nk2skusEX9pqw851YW3m4SeprYM2fHAr63QYw7d4Zk1BjSrS2/8iUL LjyKxK+T\",\"ephemeralPublicKey\":\"BJ1w0qaP2pJfvPd wL/bXDCW1FSmkC5ZcfDkOv5uDj8gevPDC2VXKBholWFKpHcNr oMrzgRnmA7RYC8=\"}", "iv": "+F+sr4yyp sg7pi1kR/pD5g==", "tag": "owCN oKCbKNxm3gF+24k9Rjp sYbOP/R5HsvV3YEk24zm A=" } ``` ### Usage The generated cryptogram can be used in payment-related API endpoints (e.g., Pay, Public Pay, Block, Create) with `PaymentMethod = Cryptogram` and the cryptogram value in the `Value` parameter of `PaymentDetails`. ``` -------------------------------- ### Operational Webhooks Source: https://api.payselection.com/index Information about operational webhooks used to notify about various payment lifecycle events. ```APIDOC ## Operational Webhooks ### Description Operational webhooks are designed to inform about various events. The system sends a request to the merchant's URL with event information, and the merchant's service records the response. ### Event Types - **Payment**: Triggered after a successful payment (single-stage Pay or two-stage Charge) where authorization is obtained from the issuer. - **Block**: Triggered after successful funds holding in a two-stage payment. - **Fail**: Triggered when a transaction is declined. - **Refund**: Triggered after a successful full or partial refund. - **Cancel**: Triggered when a transaction is canceled within a two-stage payment. - **3DS**: Triggered after data is sent for 3D-Secure verification, including `AcsUrl`, `PaReq`, and `MD` parameters. - **Payout**: Triggered after a successful payout. - **Redirect3DS**: Triggered after data is sent for 3D-Secure verification, including `redirectMethod` and `redirectUrl` parameters. ### Header Parameters - **X-SITE-ID** (string) - Required - The merchant's site identifier. - **X-WEBHOOK-SIGNATURE** (string) - Required - Description of the notification signature. ``` -------------------------------- ### Encrypt Payment Data using Eccrypro NPM Package Source: https://api.payselection.com/index This Node.js snippet shows how to use the `eccrypto` library to encrypt card details. It requires installing the `eccrypto` NPM package and providing a raw public key. The output is a Base64 encoded string suitable for API use. ```javascript var eccrypto = require("eccrypto"); var rawPubKey = '0405397f7577bd835210a57708aafe876786dc8e2d12e6880917d61a4ad1d03a75068ea6bc26554c7a1bf5b50ed40105837eee001178579279eca57f89bdff5fc2' var pubkey = Buffer.from(rawPubKey, 'hex'); eccrypto.encrypt(pubkey, Buffer(JSON.stringify({ "TransactionDetails": { "Amount": "100", "Currency": "RUB" }, "PaymentMethod": "Card", "PaymentDetails": { "CardholderName":"TEST CARD", "CardNumber":"4111111111111111", "CVC":"123", "ExpMonth":"12", "ExpYear":"24" }, "MessageExpiration": Date.now()+86400000, //24 hours }))) .then((encrypted) => { var sendData = { "signedMessage": JSON.stringify( { "encryptedMessage": encrypted.ciphertext.toString("base64"), "ephemeralPublicKey": encrypted.ephemPublicKey.toString("base64") } ), "iv": encrypted.iv.toString("base64"), "tag": encrypted.mac.toString("base64") }; var finalString = window.btoa(JSON.stringify(sendData)); console.log(finalString) } ) ``` -------------------------------- ### Inject CardCryptoToken Script Source: https://api.payselection.com/index This snippet demonstrates how to dynamically inject the CardRSAToken.js script into an HTML document. It ensures the script is loaded asynchronously and becomes globally available for use. ```javascript function injectCryptoLibrary() { var script = document.createElement('script') script.src = 'https://cardcryptotoken.payselection.com/CardRSAToken.js' script.async = true document.body.appendChild(script) } injectCryptoLibrary() ``` -------------------------------- ### Include CardCryptoToken Library in HTML Source: https://api.payselection.com/index This snippet demonstrates how to include the CardCryptoToken JavaScript library in the `` section of an HTML file. It ensures the library is loaded before the page's interactive elements are processed. ```html Моя Веб-страница ``` -------------------------------- ### 3-D Secure Authentication Flow Source: https://api.payselection.com/index This section details the steps involved in 3-D Secure authentication for checkout pages, including handling different transaction states and redirecting users for verification. ```APIDOC ## 3-D Secure Authentication for Checkout Pages ### Description This endpoint describes the process of 3-D Secure authentication for checkout pages. It covers scenarios where a transaction requires additional verification (wait_for_3ds) or immediate redirection (redirect). ### Method POST (Implicit, for redirection to AcsUrl) ### Endpoint `/websites/api_payselection` (Conceptual endpoint for the overall process) ### Parameters #### Step 1: Initial Payment Request - **TransactionState** (string) - Indicates the current state of the transaction. Possible values include `wait_for_3ds` and `redirect`. #### Step 2: State Details (when TransactionState is `wait_for_3ds`) - **StateDetails.AcsUrl** (string) - The URL of the 3-D Secure authentication server. - **StateDetails.PaReq** (string) - The encrypted 3-D Secure authentication request. - **StateDetails.MD** (string) - The 3-D Secure authentication identifier. #### Step 3: Redirect to Issuer Bank (POST request to AcsUrl) - **TermUrl** (string) - The URL to redirect the user to after successful 3-D Secure authentication. The user will return here via POST with `PaRes` and `MD`. - **MD** (string) - The `MD` value received from the payment request. - **PaReq** (string) - The `PaReq` value received from the payment request. ### Request Example (Step 3 - Form Submission) ```html
``` ### Response #### Step 2 Response Example (Success) ```json { "TransactionState": "wait_for_3ds", "TransactionId": "PS00000000000001", "OrderId": "string", "StateDetails": { "AcsUrl": "string", "PaReq": "string", "MD": "string" } } ``` #### Step 4 Scenarios: - **Challenge Flow**: User is redirected to the issuer bank's site for authentication. Upon completion, the user is returned to `TermUrl` with `PaRes` and `MD`. A `Confirm` request is then needed. - **Frictionless Flow**: User is redirected to `ReturnUrl` without `PaRes`. No `Confirm` operation is required. If `ReturnUrl` is not provided, the user remains on the 3DS screen. ### Step 5: Handling `TransactionState=redirect` If `TransactionState` is `redirect` from Step 1, redirect the user to the URL specified in `RedirectUrl` using the `RedirectMethod`. **Note:** Always request the transaction status by `orderId` or `transactionId` to determine the correct processing scenario and whether a `Confirm` operation is necessary. ``` -------------------------------- ### POST /websites/api_payselection Source: https://api.payselection.com/index Creates a new recurring payment subscription. This endpoint allows for the registration of a new recurring payment with specified details such as amount, currency, schedule, and customer information. ```APIDOC ## POST /websites/api_payselection ### Description Registers a new recurring payment subscription. This endpoint is used to set up automatic payments based on a predefined schedule and amount. ### Method POST ### Endpoint /websites/api_payselection ### Parameters #### Request Body - **Event** (string) - Required - Description of the subscription event (e.g., RegisterRecurring, ChangeRecurringState, UnsubscribeRecurring, ChangeRecurringByMerchant). - **RebillId** (string) - Required - Recurring payment identifier (16 characters). - **Amount** (string) - Required - Transaction amount (1 to 12 characters, '.' as decimal separator). - **Currency** (string) - Required - ISO currency code (e.g., RUB, USD, EUR). - **Description** (string) - Optional - Payment purpose (1 to 250 characters). - **WebhookUrl** (string) - Optional - URL for receiving operation notifications. - **AccountId** (string) - Required - Customer identifier (1 to 100 characters). - **Email** (string) - Optional - Customer email for recurring payment notifications. - **StartDate** (string) - Required - Subscription start date and time in UTC (YYYY-MM-DDTHH:MM+0000). Must be within 1 year from the current date. If not provided, it's calculated as 'Current date + Interval*Period'. - **Interval** (string) - Required - Multiplier for increasing periods (1 to 366 characters). - **Period** (string) - Required - Enum: "day", "week", "month" - Billing frequency. - **MaxPeriods** (string) - Optional - Maximum number of possible subscription payments (1 to 999 characters). - **RecurringId** (string) - Required - Identifier for the registered recurring payment. - **RecurringStatus** (string) - Required - Possible values: new, active, completed, terminated, failed, overdue. - **ReceiptData** (object) - Optional - Receipt information. - **SplitData** (Array of objects) - Optional - Additional parameters for split operations. ### Request Example ```json { "Event": "RegisterRecurring", "RebillId": "a1b2c3d4e5f67890", "Amount": "100.50", "Currency": "USD", "AccountId": "cust123", "StartDate": "2023-12-01T10:00:00+0000", "Interval": "1", "Period": "month", "RecurringId": "rec98765" } ``` ### Response #### Success Response (201) - **Status** (string) - Indicates the success of the operation. - **Message** (string) - A message confirming the creation of the recurring payment. #### Response Example ```json { "Status": "Success", "Message": "Recurring payment registered successfully." } ``` ``` -------------------------------- ### POST /payments/requests/block Source: https://api.payselection.com/index Initiates a two-stage payment operation by holding funds on the card. The transaction must be completed within 5 days, otherwise, it will be automatically canceled. ```APIDOC ## POST /payments/requests/block ### Description Initiates a two-stage payment operation by holding funds on the card. The transaction must be completed within 5 days, otherwise, it will be automatically canceled. Funds can be charged using the Charge operation or released using the Cancel operation. ### Method POST ### Endpoint https://gw.payselection.com/payments/requests/block ### Parameters #### Header Parameters - **X-SITE-ID** (string) - Required - Identifier of the merchant's site. - **X-REQUEST-ID** (string) - Required - Unique identifier of the merchant's request. - **X-REQUEST-SIGNATURE** (string) - Required - Hash of the request signature with the secret key `secretKey`. #### Request Body - **OrderId** (string) - Required - Order identifier. Between 1 and 100 characters, using characters from \x20 to \x7E. - **Amount** (string) - Required - Transaction amount. Between 1 and 12 characters, using '.' as the decimal separator. - **Currency** (string) - Required - ISO currency code (e.g., RUB, USD, EUR). Contact your manager for supported currencies. - **Description** (string) - Required - Payment purpose. Between 1 and 250 characters. - **RebillFlag** (boolean) - Optional - Flag for recurring payments. - **CustomerInfo** (object) - Required - Buyer's information. - **ExtraData** (object) - Optional - Additional 3DS data. - **ReceiptData** (object) - Optional - Receipt information. - **SplitData** (Array of objects) - Optional - Additional parameters for split operations. - **PaymentMethod** (string) - Required - Payment method. Possible values: - "CryptogramRSA" or "Cryptogram" - Card payment - "Token" - Yandex Pay - "QR" - SBP (Faster Payments System) - "ExternalForm" - External payment methods - "SberPay" - Sberbank Online mobile app payment - "AlfaPay" - AlfaPay service payment - **PaymentDetails** (object) - Required - Payment details, dependent on the selected `PaymentMethod`. ### Request Example ```json { "OrderId": "order_12345", "Amount": "100.50", "Currency": "RUB", "Description": "Payment for goods", "RebillFlag": false, "CustomerInfo": { "Phone": "+79001234567" }, "PaymentMethod": "Cryptogram", "PaymentDetails": { "CardCryptogram": "..." } } ``` ### Response #### Success Response (201) - **Status** (string) - Indicates the status of the operation. - **OrderId** (string) - The identifier of the order. - **TransactionId** (string) - The unique identifier of the transaction. #### Response Example ```json { "Status": "Created", "OrderId": "order_12345", "TransactionId": "txn_abcdef123456" } ``` #### Error Responses - **400** Bad Request: Invalid request parameters. - **403** Forbidden: Method unavailable or IP address not whitelisted. - **409** Conflict: A conflict occurred during the operation. ``` -------------------------------- ### JSON Response Sample for Payselection API Source: https://api.payselection.com/index This snippet shows a sample JSON response for a successful operation, likely indicating a recurring payment identifier. It's a basic structure used for communication between systems. ```json { "RecurringId": "1173" } ``` -------------------------------- ### Include Payselection JS Library in HTML Source: https://api.payselection.com/index This snippet shows how to include the CardRSAToken.js library by adding a script tag to the `` section of an HTML file. This makes the library's functionality available for use within the page. ```html Моя Веб-страница ``` -------------------------------- ### Generate RSA Cryptogram with CardRSAToken Source: https://api.payselection.com/index This JavaScript code illustrates how to use the injected CardRSAToken function to generate an RSA cryptogram. It requires a public key and transaction/payment details as input, returning a promise that resolves with the cryptogram. ```javascript function pay() { var key = 'LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQ1ZEQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FrRUFNSUlDUEFLQ0FqTU1lTy84Q1VRaUNQNDYxdXBsY0xCTAowb1BBYjAyM3dZNTFtTjR4MjVPd0xJTzd1NjR3djkyVE05cUhYbUdISkhnSHgyRG5FclZySXJBZXVhQ2V5eHBGClZvVndETUs2WmpKMUZmR3NESVNpRGNBQmFCbEQ3c2trcmdibTZUeWFnUUxjMDFBUDBPVVYrUVR0WUNuVVBVUy8KWllRUHNDMU9IRFg1eGsvd1FMVXdCemM1NWdXemFKT20ydWtNQ09lWURvNjNaSklhdEVOdXJ6bDhKSUd6YTRtdAp4S1YxTDdXN3FHYzFBRWNXK2NmaEVRaFo0ZWpkbVFsWnJyK1NhYVhPdjBsenRUeTZOU0prZWEwNksxT3l4Mk9aCnU0anh0R1A2QmhRU0FZLys3TTlDMDMwMjZXbTdJeS9tZUhKUTNTSHVDZ0s4dzdlUjBnTDd1S0UyR0psSmI5aFYKVzlOZ3hTRS9Ed0pVZUpsWVpUTHVxclo0SnExQUU4alBrUzF5MXdDNjUrM2pmZ2l4dG0ySit0cXYzWEhwZVFCUgo4T1BJODJhK3hHbkFIelRpZk5NMjlaeWpaV0ZLNGsrdHpWdW04TXlxcTRNMnlDbGFwT2VoZ1Y1UlVLUUVZNVpsCnZxbzJGbkZVL09WM2F6RDBrRU5GTmNnTGRZU1dnM3pKK1EvWDdhSTJtUzZZWWdvbnpPT0h2eGJUQU5uNWFMeDIKWU01Y2VvWk5TbWxveTM1UEliTXJJSjN5SGtaU1RJN0JQaFVIT3dTVTB6eGdqQmhETkpCZ3RTVTZyMkdvNmhGTApGZnpNM1NERDltMVBBWDNIQmRpcHVnUWtpTUgxYVVVY3RaR0ovczU5Y0wzQkZuVStTRk9pbVArRUl6L0NGN1RkCmpNSVlpcmFEbElsZy9qL1FiNitMTGNJYW1RODYzRkdtR3NqLzU1bit3WGF1a2E1YmFRRjl3c1YwL2ppTTBwb3UKT1pFUUQwK25FbjFRVS9qQ2FUdm8reUl3QndJREFRQUIKLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0t'; var data = { TransactionDetails: { Amount: '100', Currency: 'RUB', }, PaymentDetails: { CardholderName: 'Card Holder', CardNumber: '4111111111111111', CVC: '600', ExpMonth: '05', ExpYear: '25', } }; CardRSAToken(key, data).then(function(token) { // DO SOMETHING WITH token }); } var button = document.getElementById("pay-btn"); button.onclick = pay; ``` -------------------------------- ### Simple Payment Form Integration (HTML and JavaScript) Source: https://api.payselection.com/index This snippet demonstrates a basic payment form using HTML and JavaScript. It utilizes the Payselection widget library to handle payment initiation. The form includes fields for amount, currency, language, and description, with a submit button to initiate the payment process. It requires the pay-widget.js library. ```html Webpack Typescript Starter

Обычная оплата