1. Payments
Freedom Pay
  • Overview
  • Gateway API
    • Overview
    • Sync API
      • Overview
      • Card data encryption
      • Payments
        • Overview
        • Pay by card
        • Pay by card: complete 3DS
        • Pay with Apple Pay
        • Pay with Google Pay
        • Pay by recurring profile
        • Create payment page
        • Create payment page with any amount
        • Capture payment (clearing)
        • Cancel payment
        • Refund payment
        • Get payment status
      • Payouts
        • Overview
        • Pay out to card
        • Pay out to IBAN
        • Get payout balance
        • Get payout status
      • Transfers
        • Overview
        • Transfer from card to card
        • Transfer from card to card: complete 3DS
        • Get exchange rates
        • Get transfer status
      • Saved cards
        • Overview
        • Save card
        • Save card: complete 3DS
        • List saved cards
        • Remove saved card
        • Pay by card token
        • Pay out to card token
        • Get payment status
    • Async API
      • Overview
      • Create
        • Create payment
        • Save card without a charge
      • Read
        • Get payment status
        • Get request result
      • Edit
        • Capture payment (clearing)
        • Cancel payment (reverse)
        • Refund payment
  • Merchant API
    • Overview
    • Payments
      • Overview
      • Checkout
      • Pay by saved card
        • Overview
        • Create payment
        • Confirm payment with CVC
        • Confirm payment without the client
      • Create payment
        POST
      • Create payment with a payment page template
        POST
      • Create payment in a payment frame
        POST
      • Create payment with any amount
        POST
      • Create recurring payment
        POST
      • Capture payment (clearing)
        POST
      • Cancel payment
        POST
      • Refund payment
        POST
      • Get payment status
        POST
    • Payouts
      • Overview
      • Create payout page
      • Pay out to saved card
      • Pay out to IBAN
      • Get payout status
      • Get payout balance
    • Saved cards
      • Get saved cards
      • Save card
      • Save card for payouts
      • Delete saved card
      • Save card without a charge
    • Mobile balance
      • Overview
      • Create mobile balance payment
      • Charge mobile balance
      • Get mobile balance payment status
      • Confirm payment with SMS code
      • Resend SMS code
    • Invoices
      • Overview
      • Recurring payments
        • Overview
        • Create recurring profile
        • Get recurring profile
        • Charge by recurring profile
        • Cancel recurring profile
        • Recurring profile notification
      • Tips
        • Overview
        • Create
      • Create invoice
      • Get invoice status
      • Get invoice details
      • Cancel invoice
      • Refund invoice
    • SDK
      • JS SDK
      • Merchant SDK
        • Android
        • iOS
        • Migration guide
    • CMS
      • Overview
      • Get Merchant ID and key
      • WordPress
        • Overview
        • Installation
        • Configuration
        • Test
        • Live payments
        • Update
      • Tilda
        • Overview
        • Installation
        • Configuration
        • Test
        • Live payments
      • InSales
        • Overview
        • Installation
        • Configuration
        • Test
        • Live payments
      • Ecwid
        • Overview
        • Installation
        • Configuration
        • Test
        • Live payments
      • Bitrix
        • Overview
        • Installation
        • Configuration
        • Test
        • Live payments
      • PrestaShop
        • Overview
        • Installation
        • Configuration
        • Test
        • Live payments
      • OpenCart
        • Overview
        • Installation
        • Configuration
        • Test
        • Live payments
      • CS-Cart
        • Overview
        • Installation
        • Configuration
        • Test
        • Live payments
    • Installment
      • Overview
      • Status
        • Get application status
        • Application status notification
        • Change application status
      • Get partners
      • Create application
    • Callbacks
      • Overview
      • Result notify
      • Check request
      • Payout notify
      • Redirect back
  • Partner API
    • Overview
    • Rates
      • Overview
      • Rates
    • Products
      • Overview
      • Dictionaries
      • Add client with product
      • Client request status
      • Create terminal
      • Update terminal limits
      • Product request status
    • E-Money
      • Overview
      • Add
      • Owner identification
      • Info
      • Close
      • Block
      • Balance
      • Statement
      • Request Status
    • Device ID
      • Android SDK
      • iOS SDK
    • Implement SuperApp
      • Overview
      • Pay
      • Refund
      • Status
    • Account
      • Overview
      • Create payment
      • Payment status
      • Batch statuses
      • Statement
      • Statement status
      • Balance
      • Balance status
    • Invoices
      • Info
  1. Payments

Checkout

Checkout is a payment widget: the Freedom Pay payment page opens in a pop-up window over your page, and the client pays without leaving your site.
Freedom Pay issues a widget token and registers the domains of your site: contact your account manager.
The widget works only on a registered domain. The page origin must match it exactly, including the scheme: https://shop.example and http://shop.example are different domains.
The callbacks in the browser only report that the client finished with success or failure. Confirm the payment by the notification to result_url (Result notify) or by Get payment status with pg_order_id.

Payment flow#

Step 1. Add the script#

Add the script to the pages with the pay button:

Step 2. Open the widget#

Create the widget when the client clicks the pay button. Required fields only:
All fields of payment:
FieldRequiredDescription
tokenyesWidget token issued by Freedom Pay. It is passed next to payment, not inside it.
payment.amountyesPayment amount, not less than 1.
payment.descriptionyesDescription of the payment, up to 1024 characters.
payment.ordernoOrder ID in your system, up to 50 characters. It comes back in the notifications.
payment.currencynoCurrency, ISO 4217 letter code. Default: the currency of the merchant's country.
payment.languagenoLanguage of the payment page. Default: ru.
payment.expires_atnoTime until which the client can pay, ISO 8601 in UTC. Not later than 7 days from now; otherwise the lifetime from the merchant settings is used.
payment.testno1 — test payment. Default: the mode from the merchant settings.
payment.options.callbacks.result_urlnoURL for the payment result, see Result notify. Default: the URL from the merchant settings.
payment.options.callbacks.check_urlnoURL for the check before the payment, see Check request.
payment.options.user.idnoClient ID in your system. Required with recurrent_profile.start.
payment.options.user.emailnoClient's email.
payment.options.user.phonenoClient's phone number with the country code, digits only.
payment.options.custom_paramsnoYour own parameters as an object. They come back in the notifications.
payment.options.receipt_positionsnoReceipt positions, if fiscalization is enabled for the merchant: count, name, price are required in each position; tax_type, unit_code are optional.
payment.options.recurrent_profile.startnotrue — create a recurring profile with the payment. Its ID pg_recurring_profile_id comes to result_url; use it in Create recurring payment. Available after Freedom Pay enables recurring payments for the merchant.
payment.options.recurrent_profile.lifetimenoLifetime of the recurring profile in months. Default: 1.

Step 3. Handle the result#

successCallback(payment) — the client paid; errorCallback(payment) — the payment failed. Both get the same payment object that you passed to the widget: it has no Freedom Pay payment ID.
Find the order by payment.order and wait for the notification to result_url, or check the payment with Get payment status.
If the client closes the window, no callback is called.

Errors#

The widget shows the error in the pop-up window. The texts are in Russian.
Text in the windowWhenWhat to do
«Неверный токен или домен. Пожалуйста, обратитесь к вашему менеджеру»The token is wrong, or the page is opened on a domain that is not registered for the token.Check the token and the domain, including the scheme. Contact your account manager to register the domain.
«Неверные данные»amount or description is missing, or a field of payment is invalid.Fix payment by the table above.
«Номер заказа должен быть уникальным»A payment with this order already exists, and unique order IDs are enabled for the merchant.Pass a new order.
«Ошибка шифрования», «Внутренняя ошибка сервиса»Technical error.Repeat later; if it repeats, contact Freedom Pay support.

Test payments#

Pass test: 1. Test cards: see Merchant API Overview.
Previous
Overview
Next
Overview