1. SDK
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
      • Create payment with a payment page template
      • Create payment in a payment frame
      • Create payment with any amount
      • Create recurring payment
      • Capture payment (clearing)
      • Cancel payment
      • Refund payment
      • Get payment status
    • 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. SDK

JS SDK

JS SDK is a library that will help you integrate with the API SDK
All you have to do is create your own form and call the corresponding method in the JS SDK
In order to use this mechanics, the merchant must install the script on their site. The script will collect site data and securely encrypt it. Then this data will be sent to the API in the form of a token
To use the JS SDK, you need to contact your personal manager

Initialization#

To initialize the SDK, you need to add the following code to the head:
Now you have the SDK object available, set your publickey and token:
publickey and token can be obtained from your manager

Description of SDK methods#

Getting a token:#

JSTokenizeOptionsBankCard:
NameTypeDescription
typestringType of encrypted data. bank_card - bank card
options.card_numberstringCard number. The card number input field must support input of 13 to 19 digits
options.card_holder_namestringCardholder name
options.card_exp_monthstringCard expiration month
options.card_exp_yearstringCard expiration year
Once you receive the token, you can use it to make a payment

One-step payment#

JSPaymentOptions:
NameTypeDescription
order_idstringUnique identifier in the store system
auto_clearinginteger1 - if clearing is required automatically, 0 - if the merchant calls the clearing method himself
amountfloatPayment amount
currencystringPayment currency
descriptionstringPayment description
testinteger1 - if test payment mode, 0 - if combat
options.custom_paramsobjectAdditional parameters. Will be sent back to the merchant at ResultURL after the payment is made
options.user.emailstringClient's email
options.user.phonestringClient's phone number
JSTransactionOptionsBankCardToken:
NameTypeDescription
typestringType of data transferred. tokenized_card - transfer of card token
options.tokenstringPreviously received card token
options.card_cvvintegerCVC/CVV of the card for which the token was made
JS3dsv1AcsOptions:
NameTypeDescription
paresstringParameter that comes to termUrl
mdstringParameter that comes to termUrl
JSTransactionOptionsBankCard:
NameTypeDescription
typestringType of data transferred. bank_card - transfer of open card data
options.card_numberstringCard number. The card number input field must support input of 13 to 19 digits.
options.card_holder_namestringCardholder name
options.card_exp_monthstringCard expiration month
options.card_exp_yearstringCard expiration year
options.card_cvvintegerCVC/CVV cards

Responses#

JSPayResult:
NameTypeDescription
payment_idintegerType of data transferred. bank_card - transfer of open card data
order_idstringCard number. The card number input field must support input of 13 to 19 digits
payment_statusstringCardholder name
3dsobjectCard expiration month
3ds.versionstringCard expiration year
3ds.acsurlstringCVC/CVV cards
3ds.mdstringCard expiration year
3ds.pareqstringCVC/CVV cards
3ds.frame_urlstringCVC/CVV cards
JSTokenResponse:
NameTypeDescription
tokenintegerToken for further payment
JSErrorObject:
NameTypeDescription
response.error_codestringError code
response.error_messagestringError description
If JSPayResult.payment_status = need_confirm came there are several mechanics of passing 3DS:

On the SDK side#

The entire 3DS process takes place on the js sdk side, the only thing the merchant needs to do is create a DOM element with id="3dsForm", in it the payer will enter 3DS data
The recommended size of the DOM element is 550px X 600px
The id property can be changed when calling the confirmInIframe(JSPayResult, "myCustom3dsElement") function
At this point, the merchant must prepare the container (3dsForm) for correct display to the client. For example, open a pop-up window, remove the form and show the container, etc
Request for confirmInIframe

Own implementation of 3ds shape processing#

When requesting a charge, if 3ds is installed on the card, it is necessary to make a request to the ACS server of the card issuer bank
If it is necessary to pass 3ds, the response to the call to the charge method will be JSPayResult.payment_status = need_confirm and an additional 3ds object with JS3dsv1Object parameters
NameTypeDescription
PaReqstringThe pareq parameter from the response
MDstringParameter md from the response
TermUrlstringUrl to which the client will be transferred after completing 3DS
If successful, a POST request with the following parameters will be sent to TermUrl:
NameTypeDescription
PaResstringThe parameter is required for the paymentAcs request
MDstringThe parameter is required for the paymentAcs request
After you receive these parameters, call confirm3dsv1:

Example of full integration#

Previous
Refund invoice
Next
Android