Payments - CloudPayments (not in use at the moment)#
These endpoints support payment integration with CloudPayments.
/api/payment/cloudpayments/success/
/api/payment/cloudpayments/webhook/
Successful Payment#
/api/payment/cloudpayments/success/
Request this endpoint after a successful payment. By default the CloudPayments frontend script runs a callback function after the successful payment, which can send a request to this endpoint.
The endpoint checks that astrological data in request is valid. It also checks if the invoice with a given ID was actually paid within the last 10 minutes. For that purpose, it sends a request to the CloudPayment API.
In case of success it returns the URL to a purchased astrological report.
Request#
Method: GET
It has the same parameters as the /api/payment/stripe/checkout/
(see details), plus it has one required parameter - invoice_id
. It is the ID of the order, which is passed by the frontend app to the CloudPayments script.
The endpoint requests CloudPayments to check if this endpoint was successfully paid within the last 10 minutes. It also checks the validity of chart data for the astrological report, returns the report URL, adds transaction into internal DB and sends email to the user with the link to the report.
Response#
{
"report_url": "http://...."
}
Use this report URL in the last stage of chat bot conversation see here
Webhook Endpoint#
/api/payment/cloudpayments/webhook/
This is a technical endpoint for CloudPayments callbacks. It is not used by the app. Awaits for payload from CloudPayments and returns 200 OK if the payload is correct.