# Payment services

Test cards, Postman collection and sandbox features for accepting payments, payouts to cards, tokenization, two-stage payment, recurrent and refunds.

# Test cards

Card data for all payment requests in a test (sandbox) environment.

Parameter Value Comment
Validity period Any Later than the current month in MM/YY format
Card Holder Name CARD HOLDER
CVV 123
Card number 4929509947106878 To simulate successful transactions without 3DSecure
Card number 4692065455989192 To simulate successful transactions with 3DSecure
Card number 4485913187374384 To simulate unsuccessful transactions without 3DSecure
Card number 4556058936309366 To simulate unsuccessful transactions with 3DSecure
Card number 5192618384533242 To simulate interactive payment with forced transfer of the card to payout-only

# Collection for Postman

To make the process of testing and familiarizing yourself with the capabilities of the payment API more convenient, we have prepared collections for Postman. To work with them you need to go through the following steps:

  1. Download and save the collection mandarin_api (opens new window) as a file.

  2. Install and run the program Postman (opens new window).

  3. Import the collectionmandarin_api.postman_collection.jsonby selecting "File" -> "Import..."

File -> Import...

Then click on the "Upload Files" button and select the saved collection file.

Upload Files

  1. Register your authorization data in collection variables. To do this, click on the “breadcrumbs” next to the collection name, then select the “Edit” menu item.

Edit

In the window that opens, you need to go to the "Variables" tab and write next to the variablesmerchant_idAndsecret"Merchant id" and "Secret" values ​​from your personal account.

If you enter authorization data from a test personal account, the transaction will be performed in a test (sandbox) environment, and if from a production environment, then in a production environment.

Editing collection variable values

Finally, you need to save the changes with the "Update" button.

  1. You can send requests!

We recommend running them in order (by clicking on the "Send" button). However, some queries have a prefix with an exclamation mark in their names:

  • ! One-step payment.
  • ! Two-stage payment - Authorization.
  • ! Tokenization of complete card data.

To successfully complete such requests, you need to open the link in the browser, which will be returned in the response parameteruserWebLink. Otherwise, some subsequent queries will fail because their results are referenced.

Sending a request, receiving

  1. Open the link in your browseruserWebLink.

You will need to enter your card details:

  • For test environment: use card number4692065455989192for a successful operation, the remaining data is any.

  • For a combat environment: enter the details of your real map. In this case, funds will be debited from her.

Then click on the "Payment" button.

Filling in card details on the payment page

If you requested tokenization, then the process is complete.

If you made a payment, a page with a successful payment status will open.

Successful status

  1. The test terminal does not support authorization using a card token. Therefore, the request "% Two-Step Payment - Authorization using a card token" will be unsuccessful. You can discuss the possibility of authorization using a card token with your manager when opening a combat terminal.

  2. If you are satisfied with the result of the request in Postman, then you can easily generate code for sending this request in any programming language using Postman.

To do this, click on the "Code" button on the right side of the window (as in the figure below). In the window that opens, select a programming language and copy the source code.

Generating code snippet

# Checking balance for payments

The method allows you to obtain information on the balance of funds in the account for payments.

Authorization - OAuth 2.0 (Bearer). Required scope: pay_bank_account_balance.read, which must be requested during authentication.

Request

curl --request GET \
  --url https://api.psp.io/balance/v3/client/{client_id}/balance \
--header 'Authorization: Bearer {{access_token}}'

As a value{client_id}you need to pass your client id.

For more information about the response format, see the Method for requesting balance.