Freedom Pay
  1. SDK
Freedom Pay
  • Overview
  • Gateway API
    • Overview
    • Sync API
      • Overview
      • Purchase
        • Overview
        • Create payment
        • Any amount
        • Card
        • 3DSecure
        • Cancel
        • Clearing
        • Refund
        • Status
      • Payout
        • Overview
        • Card
        • IBAN
        • Balance
        • Status
      • Transfer
        • Overview
        • Card
        • 3DSecure
        • Rates
        • Status
      • Card
        • Overview
        • Add
        • 3DSecure
        • List
        • Remove
        • Status
      • Token
        • Overview
        • Token Pay
        • Apple Pay
        • Google Pay
        • Token Payout
        • Status
    • Async API
      • Overview
      • create
        • create payment
        • create payment recurrent
      • read
        • read payment
        • read request
      • edit
        • edit payment.refund
        • edit payment.reverse
        • edit payment.clearing
      • delete
  • Merchant API
    • Overview
    • Purchase
      • Overview
      • Checkout
      • Card token
        • Overview
        • Tokenize card
        • Delete token
        • Card token list
        • Create payment (with CVC)
        • Confirm payment (with CVC)
        • Create payment
        • Confirm payment
      • Create payment
      • Any amount
      • Cancel payment
      • Clearing
      • Refund payment
      • Status
    • Payout
      • Overview
      • Card token
        • Tokenize card
        • Delete token
        • Card token list
        • Create payment
      • Create payment
      • IBAN
      • Balance status
      • Status by order_id
      • Status by Payment ID
      • Status
    • Mobile balance
      • Overview
      • Init
      • Pay
      • Approve
      • Resend code
      • Status
    • Invoice
      • Overview
      • Init
      • Info
      • Pay
      • Status
    • SDK
      • JS SDK
      • Google Pay
      • Freedom QR
        • Reader SDK (Android)
        • Provider SDK (Android)
      • Payment SDK
        • iOS
        • Android
    • 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
    • Redirect back
      POST
    • Result notify
      POST
    • Payout notify
      POST
    • Check request
      POST
  • Card API
    • Overview
    • Payment Cards
      • Overview
      • Dictionaries
      • Bulk issue
      • Issue card
      • Issue plastic card
      • Activate card
      • Block card
      • Unblock card
      • Set PIN
      • Reset PIN counter
      • Close card
      • Update client
      • Card info
      • Balance
      • Secret data
      • Secret data (version 2)
      • Statement
      • Statement extended
      • Create client
      • Edit client
      • Сards' list
      • Request' status
      • Create transaction
      • Clearing transaction
      • Refund transaction
      • Transaction request' status
      • Transaction info
    • Gift Cards
      • Overview
      • List
      • Issue
      • Confirm
      • Resend
      • Resend code
      • Status
  • Partner API
    • Rates
      • Overview
      • Rates
    • Products
      • Overview
      • Dictionaries
      • Add client with product
      • Request status
    • E-Money
      • Overview
      • Add
      • Owner identification
      • Info
      • Close
      • Block
      • Balance
      • Statement
      • Request Status
    • Freedom ID
      • Overview
      • Design
      • iOS SDK
      • Android SDK
      • OAuth2
        • Authorization link
        • Token exchange
        • Token refresh
        • User info
        • Request profile
        • Get profile status
        • Create user
        • Update user
      • OIDC
        • Authorization endpoint
        • Token exchange
        • Userinfo
      • Error codes
      • Examples
        • Keycloak
    • Transfer
      • Overview
      • Get token
      • Refresh token
      • Get agents
      • Fees
      • Create person
      • Create business
      • Create transfer
      • Print application
      • Confirm
      • Search
      • Payout
      • Payout confirm
      • Cancel
      • Get person info
      • Get business info
      • Status
      • Info
    • Device ID
      • Android SDK
      • iOS SDK
  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
После получения этих параметров, требуется сделать запрос на confirm3dsv1:

Example of full integration#

Previous
Status
Next
Google Pay