Get your credentials from YooKassa
Open your shop
Open the API keys
Copy the credentials
Set up notifications in YooKassa
Open HTTP notifications
Enter the URL
Select the events
payment.succeeded and payment.canceled.Add the credentials in MagicPost
Open the YooKassa card
Enable it
Paste the credentials
- Live Yookassa Shop ID
- Live Yookassa Secret Key
- Sandbox Yookassa Shop ID
- Sandbox Yookassa Secret Key
Save
How payments work
MagicPost creates a YooKassa payment for the plan price, captures it automatically, and redirects the customer to YooKassa’s confirmation page. Each payment includes a receipt for the customer’s email, with the plan as one service line, payment mode full prepayment and VAT code 1. When the customer returns, MagicPost fetches the payment and records the order only if its status issucceeded. For Lifetime plans it also creates the subscription. The payment.succeeded webhook records the same payment if the customer never came back, provided the payment still carries the user and plan details MagicPost attached. payment.canceled is written to the log and changes nothing else.
Subscriptions
For a Monthly or Yearly plan, MagicPost asks YooKassa to save the customer’s payment method on the first payment. When the payment succeeds, MagicPost creates the subscription and stores the saved payment method on it. YooKassa has no plan objects, so there is nothing to create in YooKassa ahead of time.Currency
MagicPost sends the plan’s currency in uppercase and the price with two decimals. Your YooKassa shop must be able to accept the plan’s currency.Test mode
YooKassa uses the same API address for test and live shops. Mode only chooses which credential pair MagicPost sends. Put the test shop’s Shop ID and Secret key in the two Sandbox fields, select Sandbox and save. Switch Mode back to Live before you sell.Common errors
This payment method is not available right now.
This payment method is not available right now.
We could not start the payment. Please try again or contact support.
We could not start the payment. Please try again or contact support.
YooKassa could not start the payment. Please try again. / YooKassa returned an unexpected response.
YooKassa could not start the payment. Please try again. / YooKassa returned an unexpected response.
storage/logs/laravel.log.YooKassa did not return a confirmation URL.
YooKassa did not return a confirmation URL.
storage/logs/laravel.log.We could not prepare this plan for YooKassa billing. Please contact support.
We could not prepare this plan for YooKassa billing. Please contact support.
Missing YooKassa session reference. / YooKassa payment lookup failed. / Payment was not completed.
Missing YooKassa session reference. / YooKassa payment lookup failed. / Payment was not completed.
succeeded.
