Scenarios for receiving payments using Yandex.Checkout
There are two scenarios for using Yandex.Checkout to receive payments in mobile apps: using Yandex.Checkout payment forms, or using the API for Apps. Payment forms are easier to integrate, and they allow you to receive payments in all the ways that are available according to your agreement with Yandex.Checkout. However, you can only get data from Yandex.Money on the server or by email. The API only lets you receive payments from a user's Wallet or from bank cards, but it allows you to process payment information directly in the app.
You can combine these scenarios.
- Yandex.Checkout is a payment service for business entities and sole proprietors. To activate it, you need to submit an activation request and sign an agreement with Yandex.Money.
- The parameters for accepting payments are independent of the scenario.
Receiving payments using forms
- Initializing WebView with POST parameters according to the payment form.
- Processing redirects from the payment information page when clicking the "Go to the store's site" button (WebView closes).
You can turn on automatically redirecting the user from the successful payment and error pages, a few seconds after payment. To find out how to turn on redirection, contact a Yandex.Checkout manager.
- Payment process
A user initiates a payment (for example, clicks the Pay button when making an order) and is shown the page with information about the payment.
Payment from an external (arbitrary) bank card Payment from an account Payment from an external (arbitrary) bank card Payment from an account
After the user clicks Pay, Yandex.Money sends an order verification request to the store and sends a notification of payment (if required). The HTTP order verification request checks the validity of payment parameters, and the notification of payment informs the store of successful payment. After payment, the user sees the success or error page.
Payment completed successfully Payment failed Payment completed successfully Payment failed
Receiving payments using the API for Apps
Integration using the API for Apps lets you control the payment process within the app, get the payment status from the Yandex.Money server, and store user data for future payments. You can use this scenario to receive payments in two ways: from a Yandex.Money Wallet or from an arbitrary bank card.
The integration process depends on the payment method.
In any case, you first need to register the app in a Yandex.Money Wallet (you can create a Wallet just for registration).
Payments from the Yandex.Money wallet
To make a payment this way, the user must log in on the Yandex.Money site. The user can pay from the Wallet or using bank cards that are linked to it. To complete the payment, the app must:
- Initialize a payment using the request-payment method.
Payments from bank cards
For this type of payment, the user doesn't need to register on the Yandex.Money site. The user can pay with any bank card. To complete the payment, the app must:
The process of paying with a bank card looks the same as when paying through a payment form (see above).
The payment parameters in the request-payment and request-external-payment methods generally match the parameters in payment forms. Exceptions: You don't need to pass shopId and paymentType, but you must pass scid in pattern_id. The other parameters are passed the same way as for integration with a payment form.
If you have already activated Yandex.Checkout, you don't need to contact your manager and fill out additional paperwork. You can use the API for Apps for integration in individual cases, as described in the introduction.
You can use the libraries for programmatic implementation of the API for Apps:
All the branches have links to documentation.