Enabling sending payment notifications
To receive notifications about changes in payment statuses in your app, configure, test, and enable sending via RuStore Console.
If your app uses Pay SDK, notifications about subscription events are also available.
Before enabling notifications
-
Set up the server to receive notifications from RuStore.
-
Make sure the company is not blocked, monetization is enabled for it, and the app allows making purchases.
Configuring notification delivery
- Open RuStore Console and go to your app.
- In the left menu, select Monetization > Server notifications and click Connect.
- Specify the URL of your server that will receive notifications.
The address must start with
https://.
https://www.notification-payment-server.my-company.ru
-
Select the notification type: payment, subscription, or both.
-
Copy and save the key for decrypting notifications. You need to add it to the symmetric encryption mechanism on your server.
Configuring notification types
In the Notification type block, you can enable and disable sending server notifications about:
- Payment statuses
- Subscription events
Testing notification delivery
Before enabling sending notifications, test the server configuration. To do this, click Check in the Connection check row. Your server will receive a test notification.
It is not covered by delivery guarantees. You can send a test notification no more often than once every 30 seconds.
The server response will be displayed in RuStore Console. If it differs from Notification successfully delivered, you need to check the server configuration and network connectivity between RuStore and the server. The table below lists possible server responses.
| Server response | Error | Description |
|---|---|---|
| HTTP code 4xx or 5xx | Not Found, Unauthorized, and others | Text error codes are shown according to RFC 7231. |
| Request timed out | Read timed out | There is a time limit for executing the request from RuStore to your server Backend. If this limit is exceeded, this error appears. The limit is 3 seconds if nothing is written to the socket, but no more than 5 seconds of total response wait time. |
| Connection reset by developer BE | Connection reset | The Backend of your server reset the connection. |
| SSL issues | Unsupported or unrecognized SSL message | SSL issues — check the server certificate. |
| Name or service not known | A non-existent server address is specified. |
Enabling notification delivery
Once you make sure the server correctly receives notifications and sends delivery acknowledgements, enable Notify about real payments. The service will start sending real-time notifications according to the selected notification type.
- Payments
- Subscriptions
Notifications are sent in cases when a payment status changes.
| Scenario | Payment status change |
|---|---|
| A new payment is created (assumption) | The payment status becomes CREATED |
| The user selects a payment method in the app, the payment is being processed | The payment status appears/changes to EXECUTED |
| The user cancels the payment | The payment status changes to CANCELLED |
| User funds are reserved, the invoice is awaiting confirmation (only for purchasing consumable products) | The payment status changes to PAID |
| The payment is successful | The payment status changes to CONFIRMED |
| Funds are refunded to the buyer | The payment status changes to REFUNDED |
| A reservation cancellation occurs | The payment status changes to REVERSED |
| The payment attempt is rejected (insufficient funds, invalid CVC, etc.) | The payment status changes to REJECTED |
| The time allocated for payment has expired | The payment status changes to EXPIRED |
| A refund is initiated, the request is sent to the acquirer | The payment status changes to REFUNDING |
Notifications are sent in cases when changes occur in a subscription (activation, renewal, payment issues, or closure).
| Scenario | Subscription status change and event |
|---|---|
| The user starts a subscription, the first payment is successful | The notification has subscription_event_type = ACTIVATED, and the subscription status becomes ACTIVE. The subscription period changes. |
| The subscription is successfully renewed, the recurring payment is successful | The notification has subscription_event_type = RENEWED, and the subscription status remains ACTIVE. In certain cases, the subscription period changes. |
| The user turns off auto-renewal | The notification has subscription_event_type = CANCELLED, the subscription runs through the paid period, then moves to the final status (usually CLOSED). |
| The user resumes auto-renewal | The notification has subscription_event_type = RESUMED, and the subscription status becomes or remains ACTIVE. |
| The next charge attempt fails, the subscription is not closed | The notification has subscription_event_type = PAYMENT_FAILED, the subscription moves to the grace period GRACE or the hold period HOLD (the status may become PAUSED). |
| The subscription is closed after auto-renewal is turned off or due to payment issues | The notification has subscription_event_type = CLOSED, and the subscription status moves to the final CLOSED or TERMINATED. |
If your server returns an error in response to a notification, RuStore will try to resend the notification. See Delivery guarantees for notifications.
What’s next
Right after enabling: make sure the information from the notification payload is decrypted correctly.
This is where the data about the app, the purchased product, and the new and previous statuses is stored.
Later:
- During outages or maintenance on the server, you can temporarily disable sending notifications.
- If the URL for receiving notifications has changed, change it in RuStore Console.
- If the encryption key is lost or compromised, get a new key and update it on your server.