Widget Web SDK

Benefits of payabl. web SDK

Implementing the Web SDK solution

  1. Send initialization request (get_payment_widget_session).

  2. Capture the “session_id” from the “get_payment_widget_session” request’s post response.

  3. Use “session_id” in the initialize method of JavaScript Payabl object.

  4. Follow the steps to integrate the Widget web sdk.

Detailed flow description

  • In the server to server (get_payment_widget_session) payment request, the payment gateway should receive from the merchant’s server all required and optional parameters (payment data and customer’s data) for payment processing.
  • The payment gateway sends the merchant the response that includes the initial URL ( session_idparameter) for using with the web SDK JavaScript. This is possible ONLY if merchant’s server received a successful response from the payment gateway after “get_payment_widget_session” payment request.
  • Once in the web SDK has been successfully created, the customer will be presented with a credit card input field.
  • Only after the fields are completely and correctly filled the customer would be able to continue to submit the payment.
  • If there is a need for the customer to authenticate through 3DSecure, the web SDK will handle that.
  • Once the transaction is completed, the web SDK will post the result of the transaction to a JavaScript callback provided by the merchant.
  • The merchant will use this message to display a success or failed message to the customer and do the necessary take control of the page.
  • The merchant should not use the result of the callback notification to update its system. Instead, there will be a notification sent to the “notification_url” provided in the server to server request.

REQUEST PARAMETERS

The POST request should contain the following mandatory components:

  • Payment Data
  • Customer Data

RESPONSE & SAMPLE CODES

  • Initial response to get a session token

Payment Data

Field NameTypeLengthFormatMandatory?Description
merchantidalphanumeric*40 charactersmerchant identification
orderidalphanumeric*max. 30 char.orderid in the merchant shop system
amountfloat
numeric
8.2
8
12345678.90
12345678
transaction amount
currencychar3ISO 4217 i.e. “EUR” or “USD”ISO 4217
signaturehex40 charactersSHA-1 hash value (hexadecimal)Signature Calculation
shop_urlchar254https://shop.comAllows the web sdk to communicate through the browser.
notification_urlchar255https enabled urlThis parameter can be used to override the account notification url setup on our system
recurring_idalphanumeric*max. 10 char.Classify the first of recurring transactions with INIT
Following recurring transactions need the transaction ID of the initial transaction
languagechar2ISO-639-1 alpha 2The language in which the error messages will be displayed.
external_idalphanumeric*255Merchant unique id

Customer Data

Field NameTypeLengthFormatMandatory?Description
salutationalphanumeric*max. 10 char.Mr., Mrs.salutation
titlealphanumeric*max. 20 char.Dr., Prof.title
genderchar1M – male
F – female
gender
firstnamealphanumeric*max. 30 char.first name
lastnamealphanumeric*max. 30 char.last name
birthdaynumeric8 digitsddmmyyyybirthday
streetalphanumeric*max. 100 char.street
housealphanumeric*max. 10 char.house number
postboxalphanumeric*max. 20 char.post office box
zipalphanumeric*max. 10 char.
postal code (USA and Canada only)
cityalphanumeric*max. 40 char.
city
statealphanumeric*max. 30 char.
state/province (USA and Canada only)
countrychar3country (ISO 3166 alpha3)
ISO 3166: country
emailRFC 822max. 50 char.e-mail address
phonenumericmax. 20 char.(blank, +, -, (, ))phone number
faxnumericmax. 20 char.(blank, +, -, (, ))fax number
mobilenumericmax. 20 char.(blank, +, -, (, ))mobile number
companyalphanumeric*max. 40 char.company
customeridalphanumeric*max. 20 char.internal customer id in the merchant’s shop system
customeripalphanumeric*max. 39 char.customer IP
custom1alphanumeric*max. 255 char.custom field for merchant
custom2alphanumeric*max. 255 char.custom field for merchant
custom3alphanumeric*max. 255 char.custom field for merchant
  • These fields are recommended to be sent as they maybe needed in case of chargeback disputes

RESPONSE PARAMETERS

Initial response parameters.

Field NameTypeLengthMandatory?Description
errorcodealphanumericStatus of request
errormessagealphanumeric
session_idalphanumeric40 characters
transactionidnumeric
signaturealphanumeric40 characters

Final response parameters.

Field NameTypeLengthMandatory?Description
errorcodenumericStatus of final payment request
errormessagealphanumeric
securityalphanumeric64 characterssee security calculation: checksum for validation of request
transactionidnumeric
orderidorderid in the merchant shop system
typechartype of the transaction, only on merchant notification

Our Technical Support team is there to help you:
Email: [email protected]
Available Monday – Friday between 09:00 and 17:00 CET/CEST