Payments - Stripe#

These endpoints support payment integration with Stripe.

  • /api/payment/stripe/checkout/
  • /api/payment/stripe/webhook/

Checkout Page#

/api/payment/stripe/checkout/

Use this endpoint to send chart data for an astrological report and redirect the user to Stripe's checkout page. This endpoint checks the validity of the chart data and then redirects the user to the checkout page.

Request#

Method: GET

Parameter Type Required Comment
date str yes Should have the format YYYY-MM-DD.
time str yes Should be in HH:MM 24-hour format.
tz float yes Timezone (UTC offset in hours), e.g., -3.5 means minus 3 hours and 30 minutes.
ln_d int yes Longitude degrees (0..180).
ln_m int yes Longitude minutes (0..59).
dir_ln str yes East-west direction. Can be e or w.
lt_d int yes Latitude degrees (0..90).
lt_m int yes Latitude minutes (0..59).
dir_lt str yes North-south direction. Can be n or s.
report_id str yes See the table below.
lang str no 'ru' or 'en' - the language of the email confirmation after payment.
partner str no A partner's ID for the partner program. All payments processed with the given partner's ID are kept in the database.

The report_id parameter can have one of several values, which correspond to particular astrological reports:

Value Report URL Report Description
relocation /api/reading/relocation/ Should I Move to a New Location?
feelings /api/reading/feelings/ What Does He Feel for Me?
relations /api/reading/relations/ What is the Future of Our Relations?
newjob /api/reading/newjob/ When Will I Find a New Job?
career /api/reading/career/ What are My Career Prospects for That Job?
jobchange /api/reading/jobchange/ Should I Change My Current Job?
meeting /api/reading/meeting/ When Will I Meet My Future Husband?
newchild /api/reading/newchild/ When Will I have a Child?
marriage /api/reading/marriage/ What Will my Marriage be Like?
stones-1 /api/reading/stones/1/ Which Gemstones to Choose to Improve My Health?
stones-2 /api/reading/stones/2/ Which Gemstones to Choose to Attract Money?
stones-5 /api/reading/stones/5/ Which Gemstones to Choose to Get Pregnant Faster?
stones-7 /api/reading/stones/7/ Which Gemstones to Choose to Attract Good Luck in My Relationship?
stones-10 /api/reading/stones/10/ Which Gemstones to Choose to Attract Good Luck in My Career and Business?
stones-11 /api/reading/stones/11/ Which Gemstones to Choose to Improve My Income?

Response - Success#

After a successful payment, the user is redirected back to the front-end app's page from which the request was made. The return URL will have the following key-value arguments:

  • success=true - indicates that the payment was processed successfully.
  • date=2023-9-24&time=3:17&tz=5.0&ln_d=69&ln_m=13&dir_ln=e&lt_d=41&lt_m=16&dir_lt=n&hash=XXX - data for getting the astrological report, signed by the hash.
  • report_id=feelings - the report ID.

After receiving this data, you should

  • either redirect the user to the report URL (which corresponds to the given report_id, see the table above), adding the hash-signed coordinates, for example, /api/reading/feelings/?date=2023-9-24&time=3:17&tz=5.0&ln_d=69&ln_m=13&dir_ln=e&lt_d=41&lt_m=16&dir_lt=n&hash=XXXX.
  • or if you use the chatbot you should provide it with the data for getting the astrological report with the hash which you have just received see here

Response - Failure#

In case of payment failure or cancellation, the user will be redirected back to the page from which they made the request with the following key-value pair in the URL: success=false. Your frontend app should take appropriate action after receiving these parameters.

Webhook Endpoint#

/api/payment/stripe/webhook/

This is a technical endpoint for Stripe callbacks. It is not used by the app.