MONETA.Assistant API Reference
Contents 2 Contents Abstract...3 Chapter 1: MONETA.Assistant Overview...4 Payment Processing Flow...4 Chapter 2: Quick Start... 6 Sandbox Overview... 6 Registering Demo Accounts... 6 Merchant Account Settings...7 Chapter 3: Payment Request...9 Payment Request Parameters...9 Creating a Signature for a Payment Request... 11 Sample Payment Requests... 11 Chapter 4: Processed Payment Reports... 14 Parameters of a Processed Payment Report... 14 Payment Report Signature... 15 Response to a Processed Payment Report...15 Plain Text Response to a Processed Payment Report... 15 XML Response to a Processed Payment Report...16 Sample Processed Payment Report... 17 Chapter 5: Status Requests...19 Status Request Parameters... 19 Status Request Signature...20 Response to a Status Request...21 Creating a Signature for a Response to a Status Request... 22 Response Codes for Status Requests...22 Sample Status Requests... 23 Chapter 6: Customizing MONETA.Assistant Checkout... 24 Additional Payment Request Parameters...24 Sample Requests for Payment... 25 Appendix A: Error Codes...27
Abstract This document describes the Moneta Assistant Application Programming Interface for accepting payments for goods and services. This document is intended for programmers familiar with basic HTML and wishing to set up payment processing via MONETA.RU.
MONETA.Assistant Overview 4 Chapter 1 MONETA.Assistant Overview Topics: Payment Processing Flow MONETA.Assistant interface is an application for processing online payments via various payment methods. Thus, an online merchant only needs to implement a single MONETA.Assistant interface while online shoppers will be able to make payments from any of the payment systems aggregated by MONETA.RU. With the help of MONETA.Assistant interface it is possible to link the merchant s internal order processing system with MONETA.RU system. Based on the formed order the merchant will create a payment request for MONETA.RU and receive back a report from MONETA.RU about processed payment with its internal parameters saved (e.g. order ID in the system or other information fields). To enable the interface on the website it is necessary to create a special form with the payment parameters and also a controller that will receive processed payment reports. Payment Processing Flow Payment procedure without user's opening an account in MONETA.RU: 1. A customer selects items for purchase and initiates the checkout process. 2. The online store registers the order. 3. The customer selects a payment method on the MONETA.Assistant web page. 4. MONETA.RU generates the payment form. 5. The customer confirms the payment via the selected payment method. 6. The external payment system notifies MONETA.RU of the completed payment. 7. MONETA.RU sends a processed payment report to the merchant. 8. MONETA.RU system notifies the customer about the transaction result and prompts the customer to return to the merchant's web page. The following image shows the checkout flow:
Steps 3, 4, 6 take place only if the customer uses payment methods other than MONETA.RU. MONETA.Assistant Overview 5
Quick Start 6 Chapter 2 Quick Start Topics: Sandbox Overview Registering Demo Accounts Merchant Account Settings Sandbox Overview The MONETA.RU sandbox is a testing environment that copies the real MONETA.RU production environment. You can use the MONETA.RU sandbox server at https://demo.moneta.ru to test all of the requests to the MONETA.RU APIs. Registering Demo Accounts Before you can start, you must register two demo accounts: a merchant account to accept payments and a regular MONETA.RU account to pay with. Use different email addresses to register each account. 1. Create a demo merchant account. Perform one of the following steps: If your company is based in Russia, use the following link: https://demo.moneta.ru/locale.htm?moneta.locale=en&redirect=/partnerregistration.htm If your company is based in other countries, use the following link: https://demo.moneta.ru/locale.htm?moneta.locale=en&redirect=/partnerregistrationold.htm 2. Create a regular MONETA.RU account. Use the following link: https://demo.moneta.ru/locale.htm?moneta.locale=en&redirect=/register.htm 3. Contact MONETA.RU support and request to complete your registration and to add virtual money to your regular demo account. Note: To identify your accounts, include the email addresses that you used to register your demo accounts. 4. After the support team completes your registration, add an advanced account for your merchant account. Perform the following substeps: a) Open https://demo.moneta.ru and log in to your merchant account. b) Go to My account > Account management. c) Under Advanced accounts, click Add account. d) Complete the form and click Save.
Quick Start 7 Merchant Account Settings In account management section («Management» link in the «Accounts» block on the left part of the review page) the authorized personnel of the merchant can set the parameters of interaction between the merchant registration system and MONETA.RU system. Setting Required? Description Test mode Payment method IDs Default payment method Indicates whether your merchant account works in test mode. In test mode, Moneta.Assistant does not create transactions to transfer payments to your merchant account. Use this mode to test status requests and processed payment reports. Specifies a comma-separated list of payment method IDs that a customer can use for payment. For example, "1015,1017" resulting payment options list will be limited to "MONETA.RU" and "WebMoney". Specifies the default payment method for the payment. For example, 1015 MONETA.RU, 1020 Yandex.Money, 1017 WebMoney, etc. The list of available payment methods for account number you can find in section "Merchant back office / Payment methods". Check URL no Specifies the address of the script in your online store that processes status requests from MONETA.Assistant. If you specify the Check URL field, MONETA.Assistant sends status requests to the specified address. For more information about status requests, see Status Requests on page 19. Important: The web address must include the URI scheme. For example, http://www.yourstore.com/check_url.php Pay URL yes Specifies the address of the script in your online store that processed payment reports from MONETA.Assistant. For more information about processed payment reports, see Processed Payment Reports on page 14" Important: The web address must include the URI scheme. For example, http://www.yourstore.com/pay_url.php HTTP Method Code of data integrity verification Mandatory payment form signature yes Specifies the HTTP request method that MONETA.Assistant uses to pass parameters to the pages which addresses you specify in Check URL and Pay URL fields. Options are: GET POST Specifies a character string that MONETA.Assistant and your online store must use to generate a unique signature for each request and response. You must keep this code secret. Indicates whether MONETA.Assistant requires the MNT_SIGNATURE parameter in payment requests from the payment form. Options are: Yes. MONETA.Assistant requires the MNT_SIGNATURE parameter in payment requests. If the payment form sends a request to MONETA.Assistant without the MNT_SIGNATURE parameter or this parameter has a wrong value, MONETA.Assistant returns an error. No. MONETA.Assistant does not require the MNT_SIGNATURE parameter in payment requests. Note: This option is not secure.
Quick Start 8 Setting Required? Description URL settings can be reset Success URL Fail URL Indicates whether you can redefine the Success URL, InProgress URL, Return URL, and Fail URL addresses by using the MNT_SUCCESS_URL, MNT_INPROGRESS_URL, MNT_RETURN_URL, and MNT_FAIL_URL parameters in a payment request. Options are: Yes. You can redefine the Success and Fail URLs in payment requests. No. MONETA.Assistant always uses the values that you specify in your merchant account settings. Specifies the address of a web page to which MONETA.Assistant redirects a customer after completing the checkout successfully. The customer is redirected to this web page even if the merchant does not receive a processed payment report. Important: The web address must include the URI scheme. For example, http://www.yourstore.com/success_url.php Specifies the address of a web page to which MONETA.Assistant redirects a customer if the external payment system cannot process the payment. In this case, MONETA.Assistant does not send a processed payment report to the merchant. Important: The web address must include the URI scheme. For example, http://www.yourstore.com/fail_url.php InProgress URL no Specifies the address of a web page to which MONETA.Assistant might redirect a customer after a successful funds authorization request, before the payment is confirmed and transferred to the merchant account. This parameter affects only some of the payment methods. MONETA.Assistant redirects a customer to this page even if the merchant does not receive the processed payment report. If you do not specify the InProgress URL, MONETA.Assistant uses the default page to show the payment progress. Important: The web address must include the URI scheme. For example, http://www.yourstore.com/inprogress_url.php Return URL Specifies the address of a web page to which MONETA.Assistant might redirect customers after they decide to cancel a payment and return to the web store. In this case, MONETA.Assistant does not send a processed payment report to the merchant. Important: The web address must include the URI scheme. For example, http://www.yourstore.com/return_url.php
Chapter 3 Payment Request Topics: Payment Request Parameters Creating a Signature for a Payment Request Sample Payment Requests To initiate a checkout process, your online store must show an HTML form that will send a request for payment to MONETA.Assistant. When a customer clicks the button, the form submits the payment request to https:// www.moneta.ru/assistant.htm. To use the sandbox, the form must submit a request for payment to https://demo.moneta.ru/assistant.htm. Payment Request Parameters A request for payment to MONETA.Assistant might include the following parameters: Mandatory Parameters MNT_ID Specifies the unique identifier of the merchant (Merchant ID) in the MONETA.RU system. Merchant ID matches the account number. MNT_TRANSACTION_ID Specifies the unique identifier of the order in your online store. Maximum length: 255 characters. MNT_CURRENCY_CODE The ISO 4217 code of the currency which is used for this payment. The currency code must match the currency of the merchant account (MNT_ID) that receives the payment. Valid values are: EUR RUB USD MNT_AMOUNT Amount of payment. Use a period (.) as a decimal separator. The fractional part must have a maximum of two digits. The MNT_AMOUNT value in the payment request is a recommended value, and a customer can change it. If you specified an address in the Check URL field in your merchant account settings, the MNT_AMOUNT parameter is optional. If you do not specify this parameter in a payment request, MONETA.Assistant requests this value in a status request. If the amount of payment in the request does not match the amount that is specified by a customer, your Check URL script can return an error to MONETA.Assistant. Optional Parameters MNT_TEST_MODE Indicates whether MONETA.Assistant processes the payment in Test mode. Valid values are: 0. MONETA.Assistant processes this payment in Real mode. 1. MONETA.Assistant processes this payment in Test mode. Debit and credit operations will be skipped. Default value: 0
Payment Request 10 MNT_DESCRIPTION Note: Also, MONETA.Assistant processes payment requests in test mode if you selected the Test Mode option in your merchant account settings. Specifies a payment description. Maximum description length is 500 characters. MNT_SUBSCRIBER_ID MNT_SIGNATURE Specifies a unique alphanumeric identifier of the customer in the merchant online store. Specifies a unique signature for the payment request that can be used to identify the sender and verify data integrity. If you include this parameter in a payment request, MONETA.Assistant stops processing the payment if signature verification fails. This parameter is required if you selected the Mandatory payment form signature option in your merchant account settings. For more information, see Creating a Signature for a Payment Request on page 11 MNT_CUSTOM1, MNT_CUSTOM2, MNT_CUSTOM3 Specifies additional parameters. MONETA.Assistant ignores these parameters when processing the payment request and returns these parameters in a processed payment report. MNT_SUCCESS_URL If you selected the URL settings can be reset option in your merchant account settings, specifies the address of a web page to which MONETA.Assistant redirects a customer after completing the checkout successfully. The customer is redirected to this web page even if the merchant does not receive a processed payment report. If you did not select the URL settings can be reset option or you did not specify the MNT_SUCCESS_URL parameter, MONETA.Assistant uses the value of the Success URL field in your merchant account setting. If you did not include the MNT_SUCCESS_URL parameter in the payment request, the Success URL field is not specified and the URL settings can be reset option is selected in your merchant account settings, MONETA.Assistant uses the following address as a Success URL: https://www.moneta.ru/paymentsuccess.htm. Note: MONETA.Assistant passes the MNT_TRANSACTION_ID parameter to the script at the Success URL. MNT_INPROGRESS_URL MNT_FAIL_URL If you selected the URL settings can be reset option in your merchant account settings, specifies the address of the web page to which MONETA.Assistant redirects a customer after a successful funds authorization request before the payment is confirmed. A limited number of payment methods support this parameter. The redirection occurs even if the merchant account does not receive the payment or processed payment report. If you did not select the URL settings can be reset option in your merchant account settings or you did not include the MNT_INPROGRESS_URL parameter in the payment request, MONETA.Assistant uses the value of the InProgress URL field in your merchant account settings. Note: MONETA.Assistant passes the MNT_TRANSACTION_ID parameter to the script at the InProgress URL. If you selected the URL settings can be reset option in your merchant account settings, specifies the address of the web page to which MONETA.Assistant redirects a customer after canceling the payment. In this case, a processed payment report is not sent to the merchant. If you did not select the URL settings can be reset option in your merchant account settings or did not include the MNT_FAIL_URL parameter in the payment request, MONETA.Assistant uses the address that is specified in the Fail URL field in your merchant account settings. If you did not include the MNT_FAIL_URL parameter in the payment request, the Fail URL field is not specified and the URL settings can be reset option is selected in your merchant account settings, MONETA.Assistant uses the following address as a Fail URL: https://www.moneta.ru/ paymentfail.htm. MNT_RETURN_URL Note: MONETA.Assistant passes the MNT_TRANSACTION_ID parameter to the script at the Fail URL.
Payment Request 11 moneta.locale If you selected the URL settings can be reset option in your merchant account settings, specifies the address of the web page to which MONETA.Assistant redirects a customer after the customer does not confirm the payment. In this case, MONETA.Assistant does not send a processed payment report to the merchant. If you did not select the URL settings can be reset option in your merchant account settings or the MNT_RETURN_URL parameter is not included into the payment request, MONETA.Assistant uses the web address that you specified in the Return URL field in your merchant account settings. Note: MONETA.Assistant passes the MNT_TRANSACTION_ID parameter to the script at the Return URL. Specified the language of the checkout wizard. Valid values are: en. Use the English language. ru. Use the Russian language. paymentsystem.unitid Specifies the default payment method for the payment. For the complete list of supported payment methods, see https://www.moneta.ru/viewpaymentmethods.htm. This page is available only to authenticated users who have merchant accounts. paymentsystem.limitids Specifies a comma-separated list of payment method IDs that a customer can use for this payment. Creating a Signature for a Payment Request You can add the MNT_SIGNATURE parameter with an encrypted signature to a payment request for identification and data verification. Use the following formula to create the signature for a payment request: MNT_SIGNATURE = MD5( MNT_ID + MNT_TRANSACTION_ID + MNT_AMOUNT + MNT_CURRENCY_CODE + MNT_SUBSCRIBER_ID + TEST_MODE + DATA_INTEGRITY_CODE ) The command concatenates the specified payment request parameters and data integrity code. Then the command uses the Message Digest 5 (MD5) RFC 1321 algorithm to generate a 128-bit hash value. MONETA.Assistant uses this signature to verify your payment request. The system recreates the signature by using the same formula and them compares it with the signature in your payment request. Review the following considerations: Do not add, remove, or change the order of parameters in this formula. For the MNT_AMOUNT value, use a numeral with a decimal point and a scale of two. For example, "1.23" or "123.00". If you do not specify the MNT_SUBSCRIBER_ID parameter in the payment request, omit this parameter when creating the signature. Do not use a null value, null, zero, or a space character for a missing parameter value. Use the TEST_MODE value of 1 if either the MNT_TEST_MODE request parameter is set to 1 or the Test mode parameter in your merchant account settings is set to 1. In other cases, use the TEST_MODE value of 0. Note: If you include the MNT_SIGNATURE parameter in a payment request, MONETA.Assistant uses the same formula to recreate the signature. If these signatures do not match, MONETA.Assistant does not process the payment request. Sample Payment Requests Review the following sample payment requests:
Payment Request 12 Example 1 The following HTML form submits a minimal payment request: <form method="post" action="https://www.payanyway.ru/assistant.htm"> <input type="hidden" name="mnt_id" value="00000001"> <input type="hidden" name="mnt_transaction_id" value="ff790abcd"> <input type="hidden" name="mnt_currency_code" value="rub"> <input type="hidden" name="mnt_amount" value="120.25"> <input type="submit" value="pay order"> </form> This form submits a payment request for the order FF790ABCD, 120.25 rubles, to the merchant account 00000001. You can use such a form only if you specified the Success URL, Fail URL, and Return URL fields in your merchant account settings. Example 2 The following HTML form submits a payment request for the same order as in Example 1 in Test mode. The form also overrides web addresses for Success, Fail, Return, and In Progress URLs, and passes custom parameters to MONETA,Assistant. <form method="post" action="https://www.payanyway.ru/assistant.htm"> <input type="hidden" name="mnt_id" value="00000001"> <input type="hidden" name="mnt_transaction_id" value="ff790abcd"> <input type="hidden" name="mnt_currency_code" value="rub"> <input type="hidden" name="mnt_amount" value="120.25"> <input type="hidden" name="mnt_test_mode" value="1"> <input type="hidden" name="mnt_success_url" value="https://www.magazin.ru/success.htm"> <input type="hidden" name="mnt_fail_url" value="https://www.magazin.ru/failure.htm"> <input type="hidden" name="mnt_return_url" value="https://www.magazin.ru/payment.htm"> <input type="hidden" name="mnt_inprogress_url" value="https://www.magazin.ru/processing.htm"> <input type="hidden" name="mnt_custom1" value="1234567890"> <input type="hidden" name="mnt_custom2" value="abcdefghij"> <input type="hidden" name="mnt_custom3" value="somebody@somewhere.com"> <input type="submit" value="pay order"> </form> Example 3 The following HTML form submits the same request for payment as in Example 1. The language of the checkout wizard is set to English. This request sets the default payment method to Webmoney. <form method="post" action="https://www.payanyway.ru/assistant.htm"> <input type="hidden" name="mnt_id" value="00000001"> <input type="hidden" name="mnt_transaction_id" value="ff790abcd"> <input type="hidden" name="mnt_currency_code" value="rub"> <input type="hidden" name="mnt_amount" value="120.25"> <input type="hidden" name="moneta.locale" value="en"> <input type="hidden" name="paymentsystem.unitid" value="1017"> <input type="submit" value="pay order"> </form> Example 4 The following HTML form submits a payment request that includes a signature. <form method="post" action="https://www.payanyway.ru/assistant.htm"> <input type="hidden" name="mnt_id" value="54600817"> <input type="hidden" name="mnt_transaction_id" value="ff790abcd"> <input type="hidden" name="mnt_currency_code" value="rub">
Payment Request 13 <input type="hidden" name="mnt_amount" value="120.25"> <input type="hidden" name="mnt_signature" value="c8222aef6362c7f1239ccdc729d1a200"> <input type="submit" value="pay order"> </form> The MNT_SIGNATURE parameter value is calculated as follows: MNT_SIGNATURE = md5(54600817ff790abcd120.25rub0qwerty) Where QWERTY is the data integrity code that is specified in the merchant account settings.
Processed Payment Reports 14 Chapter 4 Processed Payment Reports Topics: Parameters of a Processed Payment Report Payment Report Signature Response to a Processed Payment Report Sample Processed Payment Report MONETA.Assistant sends processed payment report to the specified merchant s webpage «Pay URL» as an HTTP form by GET or POST method. The status of receipt of the report must be returned as a response to a HTTP request. For identification of the report sender a «Data integrity code» is used that is known only to MONETA.RU and the registration system of the merchant. This code as well as other report data is used for generation of a signature that uniquely identifies the sender and at the same time makes possible to verify the integrity of the sent data. If MONETA.RU does not receive a response to the sent payment report (e.g. due to technical problems and unavailability of the merchant registration system), the consecutive attempts to send the report will be made in automatic mode during next 24 hours. Regardless of receipt or non-receipt of a processed payment report, right after the payment the buyer will be redirected to the webpage, indicated in MNT_SUCCESS_URL or in the account settings of the merchant, therefore, the merchant must have a mechanism in place for the soonest resolution of such situations. Parameters of a Processed Payment Report MNT_ID Merchant ID in MONETA.RU system. MNT_TRANSACTION_ID Merchant's internal identifier of the order. It strictly determines the order at the merchant web store. MNT_OPERATION_ID MNT_AMOUNT Number of operation in Moenta.ru system. Initial amount requested for payment of the order, i. e. non-inclusive of the MONETA.RU service fees. MNT_CURRENCY_CODE ISO currency code which is used for payment of the order. MNT_SUBSCRIBER_ID MNT_TEST_MODE MNT_SIGNATURE MNT_USER Merchant's internal client identifier that strictly determines a customer at the merchant web store. If payment was processed in test mode, this parameter contains «1», if in real mode - «0». The code for identification of the sender and verification of data integrity.
Processed Payment Reports 15 User account number if the payment was made from an account in MONETA.RU. paymentsystem.unitid The payment system identification number if payment was made not from user s account in MONETA.RU. MNT_CORRACCOUNT Payer account number. The value of MNT_USER parameter duplicates MNT_CORRACCOUNT s value if payment was made from user s account. MNT_CUSTOM1, MNT_CUSTOM2, MNT_CUSTOM3, Other parameters Parameters that were transferred in a payment request via MONETA.Assistant. Payment Report Signature The encryption of the signature is done by concatenation in one line of the report parameters and data integrity code, using Message Digest 5 (MD5) - RFC 1321 algorithm and presenting byte massive as a line of hexadecimal figures: MNT_SIGNATURE = MD5( MNT_ID + MNT_TRANSACTION_ID + MNT_OPERATION_ID + MNT_AMOUNT + MNT_CURRENCY_CODE + MNT_SUBSCRIBER_ID + MNT_TEST_MODE + DATA INTEGRITY CODE ) The value of parameter MNT_AMOUNT must be formatted with 2 decimal digits separated by dot, for example, 1.23 or 123.00. If parameter MNT_SUBSCRIBER_ID is not present, value must be omitted in signature (must not be used as null, 0 or space symbol). Encryption is one-way, that s why for verification it is necessary for a merchant to form a line based on its data and report s fields, encrypt it, transform into a line of hexadecimal figures and compare the code with that in the report. Response to a Processed Payment Report After MONETA.Assistant sends a processed payment report to the Pay URL page, your script at this address must send a response to notify MONETA.Assistant that you received the processed payment report. MONETA.Assistant continuously sends the processed payment report in the following cases: If MONETA.RU does not receive a response from the merchant If the merchant server is not available If the merchant response starts with the word FAIL Note: You must send a response to each processed payment report even if MONETA.Assistant sends duplicate reports. You can send a response in one of the following formats: A plain text response in UTF-8 format. This response must not include HTML tags. A response in XML format. Plain Text Response to a Processed Payment Report You can send a plain text response to a processed payment report. A plain text response must be in UTF-8 format. Valid responses are: SUCCESS. The merchant received the processed payment report. MONETA.Assistant registers that the merchant received the report and completes the funds transfer. FAIL. The merchant could not process the payment report. MONETA.Assistant resends the processed payment report.
Processed Payment Reports 16 XML Response to a Processed Payment Report You can send a response to a processed payment report in XML format. The XML response format is identical to the format of responses to status requests. Response Format The following XML listing shows a valid format of a response to a processed payment report: <?xml version="1.0" encoding="utf-8"?> <MNT_RESPONSE> <MNT_ID></MNT_ID> <MNT_TRANSACTION_ID></MNT_TRANSACTION_ID> <MNT_RESULT_CODE></MNT_RESULT_CODE> <MNT_DESCRIPTION></MNT_DESCRIPTION> <MNT_AMOUNT></MNT_AMOUNT> <MNT_SIGNATURE></MNT_SIGNATURE> <MNT_ATTRIBUTES> <ATTRIBUTE> <KEY></KEY> <VALUE></VALUE> </ATTRIBUTE> </MNT_ATTRIBUTES> </MNT_RESPONSE> Response Parameters MNT_ID Specifies the unique identifier of the merchant (Merchant ID) in the MONETA.RU system. MNT_TRANSACTION_ID Specifies the unique identifier of the order in your online store. MNT_RESULT_CODE Specifies a response code for the processed payment report. For the list of valid response codes, see Response Codes for Processed Payment Reports on page 17. MNT_DESCRIPTION MNT_AMOUNT MNT_SIGNATURE Specifies a description of the order status. Specifies the amount of payment. Specifies the signature that MONETA.Assistant uses to identify the sender of the response and to verify data integrity. For more information about creating the response signature, see Creating a Signature for a Response to a Processed Payment Report on page 16 MNT_ATTRIBUTES ATTRIBUTE KEY VALUE Specifies custom attributes that MONETA.Assistant stores within the transaction. Note: This parameter is optional. Represents one custom attribute container. Specifies a unique name for a custom attribute. The maximum KEY length is 32 characters. Specifies a value for the custom attribute. Creating a Signature for a Response to a Processed Payment Report If you send a response to a processed payment report in XML format, you must include the encrypted signature. Use the following formula to create the signature for your response to the processed payment report: MNT_SIGNATURE = MD5(
Processed Payment Reports 17 ) MNT_RESULT_CODE + MNT_ID + MNT_TRANSACTION_ID + DATA_INTEGRITY_CODE This command concatenates the specified request parameters and data integrity code and then uses the Message Digest 5 (MD5) RFC 1321 algorithm to generate a 128-bit hash value. Warning: Do not add, remove, or change the order of parameters in this formula. MONETA.Assistant uses this signature to verify your response. The system recreates the signature by using the same formula and then compares it with the signature in your response. Response Codes for Processed Payment Reports MONETA.Assistant sends processed payment reports to the web address that you specified in the Pay URL field in your merchant account settings. The following table describes the response codes that you can use in XML responses to processed payment reports: Code Description 200 The order is paid. The report is delivered to the merchant. After getting this response code, MONETA.Assistant sets the transaction status to 'Completed'. 302 Your service is still processing the order and cannot determine its payment status. After getting this response code, MONETA.Assistant attempts to deliver the request multiple times for 24 hours and then stops sending the request. In this case, the payment is listed in your merchant account but this sum is locked. The payment status is set to 'Notification not sent'. Contact MONETA.RU to resolve the issue. 500 Invalid order. For example, return this response code if the order is canceled. After getting this reponse code, MONETA.Assistant cancels the transaction if it was not already completed. If MONETA.Assistant cannot cancel the transaction, the payment is listed in your merchant account but this sum is locked. The payment status is set to 'Notification not sent'. The MONETA.RU support team waits for a user call to return the money. Sample Processed Payment Report Review the following sample request that MONETA.Assistant sends to the web page that you specified in the Pay URL field in the merchant account settings: Processed Payment Report payurl? MNT_ID=54600817&MNT_TRANSACTION_ID=FF790ABCD&MNT_OPERATION_ID=123456&MNT_AMOUNT=120.25& MNT_CURRENCY_CODE=RUB&MNT_TEST_MODE=0&MNT_SIGNATURE=69bdf9bd91820b8f7b4c4b25d3d22dfa This processed payment report includes the following information: Merchant account: 54600817 Merchant order ID: FF790ABCD MONETA.RU transaction ID: 123456 Payment amount: 120.25 rubles Test mode: no Signature: 69bdf9bd91820b8f7b4c4b25d3d22dfa The signature is the md5 hash of a concatenated string that includes all of these values and a data integrity verification code (QWERTY). You can specify this code in your merchant account settings in in the Code of data integrity verification field: MNT_SIGNATURE = md5(54600817ff790abcd123456120.25rub0qwerty)
Processed Payment Reports 18 Response The online store must send one of the following responses to MONETA.Assistant to confirm that the processed payment report was received: Plain text response: SUCCESS XML Response: <?xml version="1.0" encoding="utf-8"?> <MNT_RESPONSE> <MNT_ID>54600817</MNT_ID> <MNT_TRANSACTION_ID>FF790ABCD</MNT_TRANSACTION_ID> <MNT_RESULT_CODE>200</MNT_RESULT_CODE> <MNT_SIGNATURE>29807c8e5d82198b5c4360e6ec711cce</MNT_SIGNATURE> </MNT_RESPONSE> The signature for the response to the processed payment report is calculated as follows: MNT_SIGNATURE = md5(20054600817ff790abcdqwerty) where QWERTY is a data integrity verification code. Important: The signature that you generate for the response must match the MNT_SIGNATURE value in the processed payment report. If the signatures do not match, the processed payment report might be a fake.
Chapter 5 Status Requests Topics: Status Request Parameters Status Request Signature Response to a Status Request Creating a Signature for a Response to a Status Request Response Codes for Status Requests Sample Status Requests If you specified a URL in the Check URL field in the merchant account settings, MONETA.Assistant sends status requests to this URL. Status requests verify the following properties of an order: Verify that the order exists, is not paid yet, and is not expired. Specify the payment amount if the merchant did not specify the amount in the HTML form. Verify the order status if the order is already paid. MONETA.Assistant sends status requests to the web page that is specified in the Check URL field in merchant account settings by using either the GET or POST method. The response to this HTTP request must be in XML format. MONETA.Assistant can send status requests to your web store multiple times when processing a single order. Status Request Parameters A status request from MONETA.Assistant might include the following parameters: MNT_COMMAND MNT_ID Indicates a status request. This parameter is not used in processed payment reports. Valid option: CHECK. Specifies the unique identifier of the merchant (Merchant ID) in the MONETA.RU system. MNT_TRANSACTION_ID Specifies the unique identifier of the order in your online store. MNT_OPERATION_ID MNT_AMOUNT Specifies the transaction ID in the MONETA.RU system. MONETA.Assistant does not include this parameter in the status request if the operation is not created in MONETA.RU yet. Note: This is an optional parameter. Specifies the amount of money that MONETA.RU received in payment for the order. This value does not include the MONETA.RU service fees. If the merchant did not specify the amount of payment in the HTML form, MONETA.Assistant might not include this parameter. If the status request does not include this parameter, the merchant must return the amount of payment in response to this request. Otherwise, MONETA.Assistant ends processing this transaction with an error. Note: This is an optional parameter. MNT_CURRENCY_CODE Specifies the currency code which is used in this transaction. For valid alphabetic currency codes, see ISO 4217. MNT_SUBSCRIBER_ID Specifies a unique identifier of the customer in the merchant online store.
Status Requests 20 MNT_TEST_MODE MNT_SIGNATURE MNT_USER Indicates whether MONETA.Assistant processes the payment in Test mode. Valid values are: 0. MONETA.Assistant processes this payment in Real mode. 1. MONETA.Assistant processes this payment in Test mode. Specifies a unique signature for the status request that can be used to identify the sender and to verify data integrity. See Status Request Signature on page 20. If the customer uses the MONETA.RU payment method, specifies the MONETA.RU account number of the customer. MONETA.Assistant might not include this parameter if the payment system is not specified. paymentsystem.unitid If the customer uses a payment method other than MONETA.RU, specifies the unique identifier of the payment method. MONETA.Assistant might not include this parameter if the payment system is not specified. MNT_CORRACCOUNT Specifies the correspondent account number. If customers use their own accounts to make the payment, this parameter value matches the MNT_USER value. MONETA.Assistant might not include this parameter if the payment system is not specified. MNT_CUSTOM1, MNT_CUSTOM2, MNT_CUSTOM3, Other parameters Specifies parameters that MONETA.Assistant received in a payment request. Status Request Signature Each status request that MONETA.Assistant sends to the Check URL address includes the MNT_SIGNATURE parameter with an encrypted signature. To verify the signature, recreate the signature and compare it with the signature from the status request. Use the following formula to recreate the signature: MNT_SIGNATURE = MD5( MNT_COMMAND + MNT_ID + MNT_TRANSACTION_ID + MNT_OPERATION_ID + MNT_AMOUNT + MNT_CURRENCY_CODE + MNT_SUBSCRIBER_ID + MNT_TEST_MODE + DATA INTEGRITY CODE ) This command concatenates the specified request parameters and data integrity code and then uses the Message Digest 5 (MD5) RFC 1321 algorithm to generate a 128-bit hash value. Review the following considerations: Do not add parameters or change the order of parameters in this formula. Use the following format for the MNT_AMOUNT value: N.N where N is a decimal value. For example, "1.23" or "123.00". If the MNT_OPERATION_ID, MNT_AMOUNT, or MNT_SUBSCRIBER_ID parameter is not specified in the status request, omit these parameters when recreating the signature. Do not use a null value, null, zero, or a space character for missing parameter values. For example, if MNT_OPERATION_ID, MNT_AMOUNT, and MNT_SUBSCRIBER_ID parameters are not included in the status request, MONETA.Assistant uses the following formula to generate the signature for the status request: MNT_SIGNATURE = MD5( MNT_COMMAND + MNT_ID + MNT_TRANSACTION_ID + MNT_CURRENCY_CODE + MNT_TEST_MODE + DATA INTEGRITY CODE )
Status Requests 21 Response to a Status Request You must send a response in XML format to each status request that MONETA.Assistant sends to the Check URL address. MONETA.Assistant analyzes all of the parameters of the response to the status request. MONETA.Assistant stops processing the payment in the following cases: MONETA.Assistant does not receive a response to the status request. The response to the status request has an invalid format. The MNT_ID or MNT_TRANSACTION_ID values in the response do not match the values in the status request. The MNT_RESULT_CODE parameter does not contain a valid response code. The MNT_SIGNATURE value in the response does not match the signature that is generated by MONETA.Assistant. Response Format The following XML listing shows a valid format of a response to a status request: <?xml version="1.0" encoding="utf-8"?> <MNT_RESPONSE> <MNT_ID></MNT_ID> <MNT_TRANSACTION_ID></MNT_TRANSACTION_ID> <MNT_RESULT_CODE></MNT_RESULT_CODE> <MNT_DESCRIPTION></MNT_DESCRIPTION> <MNT_AMOUNT></MNT_AMOUNT> <MNT_SIGNATURE></MNT_SIGNATURE> <MNT_ATTRIBUTES> <ATTRIBUTE> <KEY></KEY> <VALUE></VALUE> </ATTRIBUTE> </MNT_ATTRIBUTES> </MNT_RESPONSE> Response Parameters MNT_ID Specifies the unique identifier of the merchant (Merchant ID) in the MONETA.RU system. MNT_TRANSACTION_ID Specifies the unique identifier of the order in your online store. MNT_RESULT_CODE Specifies a response code for the status request. For the list of valid response codes, see Response Codes for Status Requests on page 22. MNT_DESCRIPTION MNT_AMOUNT MNT_SIGNATURE Specifies a description of the order status. Specifies the amount of payment. Specifies the signature that MONETA.Assistant uses to identify the sender of the response and to verify data integrity. For more information about creating the response signature, see Creating a Signature for a Response to a Status Request on page 22 MNT_ATTRIBUTES ATTRIBUTE Specifies custom attributes that MONETA.Assistant stores within the transaction. Note: This parameter is optional.
Status Requests 22 KEY VALUE Represents one custom attribute container. Specifies a unique name for a custom attribute. The maximum KEY length is 32 characters. Specifies a value for the custom attribute. Creating a Signature for a Response to a Status Request When MONETA.Assistant sends a status request to the Check URL address, you must send a response that includes the encrypted signature. Use the following formula to create the signature for your response to the status request: MNT_SIGNATURE = MD5( MNT_RESULT_CODE + MNT_ID + MNT_TRANSACTION_ID + DATA_INTEGRITY_CODE ) This command concatenates the specified request parameters and data integrity code and then uses the Message Digest 5 (MD5) RFC 1321 algorithm to generate a 128-bit hash value. Warning: Do not add, remove, or change the order of parameters in this formula. MONETA.Assistant uses this signature to verify your response. The system recreates the signature by using the same formula and then compares it with the signature in your response. Response Codes for Status Requests If you specify a web address in the Check URL field in your merchant account settings, MONETA.Assistant sends status requests to the specified web page. The following table describes the response codes that you can use in XML responses to status requests: Code Description 100 The response includes the payment amount. Use this response code if the MNT_AMOUNT parameter was not specified in the status request or if you want to change the payment amount. 200 The order is paid. The report is delivered to the merchant. If MONETA.Assistant gets this code before completing the transaction, this code indicates that an error occurred. In this case, MONETA.Assistant stops processing the transaction and does not send the processed payment report. 302 Your service is still processing the order and cannot determine its payment status. After getting this response code, MONETA.Assistant cancels the transaction. If a customer attempts to pay for the same order again, MONETA.Assistant resumes processing the transaction. 402 The order is ready for payment. Use this response code if a valid MNT_AMOUNT value is specified in the status request. 500 Invalid order. For example, return this response code if the order is canceled. After getting this response code, MONETA.Assistant cancels the transaction if it was created and stops processing the payment. Use response codes 100 and 402 to proceed with checkout. Use the other response codes if an error occurs.
Status Requests 23 Sample Status Requests Here is an example of a status request to the address that is specified in the Check URL field in merchant account settings for order «FF790ABCD» at «MAGAZIN.RU» merchant (account number 54600817) in the amount of 120.25 Rubles without indication of the number of operation in MONETA.RU system. Checking request to the merchant: checkurl? MNT_COMMAND=CHECK&MNT_ID=54600817&MNT_TRANSACTION_ID=FF790ABCD&MNT_AMOUNT=120.25& MNT_CURRENCY_CODE=RUB&MNT_TEST_MODE=0&MNT_SIGNATURE=ea2d49048bdf11857f1b50270aedbc8d MNT_SIGNATURE of the checking request is calculated as follows: MNT_SIGNATURE = md5(check54600817ff790abcd120.25rub0qwerty) where QWERTY is a code of verification of data integrity. Response of the merchant: <?xml version="1.0" encoding="utf-8"?> <MNT_RESPONSE> <MNT_ID>54600817</MNT_ID> <MNT_TRANSACTION_ID>FF790ABCD</MNT_TRANSACTION_ID> <MNT_RESULT_CODE>402</MNT_RESULT_CODE> <MNT_DESCRIPTION>Order created, but not paid</mnt_description> <MNT_AMOUNT>120.25</MNT_AMOUNT> <MNT_SIGNATURE>5ebb58862cf8781b62bcc2cc8d66913e</MNT_SIGNATURE> <MNT_ATTRIBUTES> <ATTRIBUTE><KEY>name</KEY><VALUE>John Smith</VALUE></ATTRIBUTE> <ATTRIBUTE><KEY>email</KEY><VALUE>John.Smith@gmail.com</VALUE></ATTRIBUTE> </MNT_ATTRIBUTES> </MNT_RESPONSE> MNT_SIGNATURE of the response to the checking request is calculated as follows: MNT_SIGNATURE = md5(40254600817ff790abcdqwerty) Where QWERTY is a code of verification of data integrity. Custom attributes name and email from MNT_ATTRIBUTES element will be stored within the transaction.
Customizing MONETA.Assistant Checkout 24 Chapter 6 Customizing MONETA.Assistant Checkout Topics: Additional Payment Request Parameters Sample Requests for Payment You can specify additional parameters in your payment requests to MONETA.Assistant that change the behavior and flow of the checkout process. By default, a customer must go through the following steps before MONETA.Assistant redirects the customer to the web site of the selected payment system: 1. Select a payment method. 2. Specify required parameters for the selected payment method. 3. Review the transaction details. 4. A customer is redirected to the web site of the selected payment method to make the payment. For example, a customer selects the WebMoney payment method, then selects WebMoney WMR as a source of funding, and reviews the transaction details. Only after these steps the customer is redirected to the WebMoney page to make the payment. However, you can suppress these steps by specifying a payment method and required parameters for the selected payment method in a payment request. Additional Payment Request Parameters The following table describes additional payment request parameters: Parameter followup paymentsystem.unitid Description Indicates whether to skip some of the steps in the checkout process by specifying checkout parameters for a customer. You must specify a payment system and fill in the parameters for the specified payment system if necessary. Valid values are: true. Use additional parameters in the request for payment to skip MONETA.Assistant steps. false. Let the customer complete all of the checkout steps. Default value: false Specifies the default payment method for the payment. For the complete list of supported payment methods, see https://www.moneta.ru/viewpaymentmethods.htm
Customizing MONETA.Assistant Checkout 25 Parameter javascriptenabled paymentsystem.accountid Description Indicates whether MONETA.Assistant can use JavaScript to process the checkout forms. Use javascriptenabled in combination with the followup parameter. Valid values are: true. Use JavaScript to process the checkout forms. Note: Ensure that you specify true only if JavaScript is enabled in the customer's browser. If you specify true and JavaScript is disabled in the customer's browser, the browser shows an empty page. false. Do not use JavaScript. The unique identifier of the account in the payment system that is specified by the paymentsystem.unitid parameter. For example, WebMoney purse type: 2 for WMR, 3 for WMZ, 4 for WME. Sample Requests for Payment Review the following sample payment requests that include additional parameters to customize the checkout process: Example 1 The following HTML form submits a request for payment to the merchant account 00000001. The unique identifier of the order in the online store is FF790ABCD. Payment amount is 120.25 Rubles. This code also sets the followup parameter to true to use the values specified in this payment request instead of the customer input. This payment request transfers the payment from a WebMoney WMR purse. The customer is immediately redirected to the WebMoney payment web page. <form method="post" action="https://www.payanyway.ru/assistant.htm"> <input type="hidden" name="mnt_id" value="00000001"> <input type="hidden" name="mnt_transaction_id" value="ff790abcd"> <input type="hidden" name="mnt_currency_code" value="rub"> <input type="hidden" name="mnt_amount" value="120.25"> <input type="hidden" name="paymentsystem.unitid" value="1017"> <input type="hidden" name="paymentsystem.accountid" value="2"> <input type="hidden" name="javascriptenabled" value="true"> <input type="hidden" name="followup" value="true"> <input type="submit" value="pay with Webmoney WMR"> </form> If the customer disabled JavaScript in the browser and the payment request sets javascriptenabled to false, the customer is redirected to the MONETA.Assistant page with transaction details, the last step of MONETA.Assistant. To proceed to WebMoney, the customer must click Continue. Example 2 The following HTML form submits the same request for payment and sets the payment method to Yandex.Money. <form method="post" action="https://www.payanyway.ru/assistant.htm"> <input type="hidden" name="mnt_id" value="00000001"> <input type="hidden" name="mnt_transaction_id" value="ff790abcd"> <input type="hidden" name="mnt_currency_code" value="rub"> <input type="hidden" name="mnt_amount" value="120.25"> <input type="hidden" name="paymentsystem.unitid" value="1020"> <input type="hidden" name="followup" value="true"> <input type="submit" value="pay with Yandex.Money">
</form> Customizing MONETA.Assistant Checkout 26
Appendix A Error Codes The following table describes error codes that MONETA.RU might return to user requests: Error Code Description 302 Invalid response to a status request. Your service might have returned an empty string, a standard HTML page, or an error page. Ensure that your service is accessible at the address that you specified in Check URL field in your merchant account settings. Also, ensure that your service responds with a wellformed XML that uses the correct format. -600 Could not send a notification request. This error occurs if MONETA.Assistant does not get a response from your service or your service redirected MONETA.Assistant to another address (HTTP Status 301 or 302). Ensure that you specified correct URLs for the Check URL and Pay URL fields in your merchant account settings. The following example shows a valid URL: http://www.merchant-site.com/script These addresses must be accessible to MONETA.Assistant. Do not use local addresses, such as localhost or my-pc. -700 Could not parse the response because of the invalid XML format. Ensure that your service sends a well-formed XML response that has the correct format. Also, ensure that the data integrity code in the XML response matches the data integrity code that you specified in the merchant account settings.