Documentation
  • Documentation
  • Requirements
    • API Settings
  • Web SDKs and APIs
    • Components
    • Form (redirect)
      • Introduction
        • Demo Client (Test Client)
        • 3D Secure
      • Variables - names, lengths and formats
        • How to calculate digest
        • Supported Card Issuers
        • Form Rules
        • Installments
        • Tokenize Brands
        • Custom Params
        • Custom Attributes
        • Supported Payment Methods
        • Transaction Types
      • Notifications
    • LightBox
  • eCommerce Plugins
    • WooCommerce
    • Magento
    • Prestashop
  • Mobile SDKs
  • API Documentation
    • API v1
      • Direct API
      • Transaction management
    • API v2
      • Requirements - API v2
      • Payment API
      • Pay By Link API
      • Payment Method API
      • Token API
      • Customers API
      • Card on File Payment
      • Subscriptions
        • Create Subscription
        • Update Subscription
        • Create/Update/Get Response
      • Customer Subscription
        • Create Customer Subscription
        • Update Customer Subscription
        • Create/Update/Get Response
      • Recurring payments
    • Notifications
    • List of response codes
  • WebRisk
  • 🟣Knowledge Center
    • Payments
    • WebPay Account
Powered by GitBook
On this page
  • Overview
  • Integration
  • Data Parameters
  • Buyer's profile
  • Order details
  • Processing data
  • Additional info
  • Callback
  • Migrating from data-whitelisted-pan-tokens
  1. Web SDKs and APIs

LightBox

PreviousNotificationsNexteCommerce Plugins

Last updated 1 year ago

Overview

The Lightbox approach uses an <iframe> to embed the payment page as an overlay to your online shop.

When the Lightbox Mode is invoked, the merchants online shop is darkened out and the payment page appears as a floating element on top.

Integration

The simple integration uses a <script> tag inside your payment form to render the purple Lightbox button. Upon completion of the Checkout process, Lightbox submits your form to your server, passing along a transaction_response and any elements your form contains.

Transaction response input contains JSON stringified transaction response received as payment processing result. Example:

{
  "id":164091,
  "acquirer":"integration_acq",
  "order_number":"yYiM5TYKTU",
  "amount":100,
  "currency":"EUR",
  "outgoing_amount":100,
  "outgoing_currency":"EUR",
  "approval_code":"901199",
  "responseCode":"0000",
  "responseMessage":"approved",
  "reference_number":"000002833738",
  "systan":"164090",
  "eci":"06",
  "xid":null,
  "acsv":null,
  "cc_type":"visa",
  "status":"approved ",
  "created_at":"2019-05-23T15:31:44+02:00",
  "transaction_type":"purchase",
  "enrollment":"N",
  "authentication":null,
  "pan_token":null,
  "issuer":"xml-sim"
}

When adding the following code to your page, make sure that the form submits to your own server--side code within the action attribute:

<form action="your-server-side-code" method="POST">

<script src="https://ipgtest.monri.com/dist/lightbox.js" class="lightbox-button"
    data-authenticity-token=""
    data-amount="100"
    data-currency="USD"
    data-order-number=""
    data-order-info="Lightbox example"
    data-digest=""
    data-transaction-type="purchase"
    data-ch-full-name="Test"
    data-ch-zip="Test"
    data-ch-phone="Test"
    data-ch-email="test@test.com"
    data-ch-address="Adresa"
    data-ch-city="Grad"
    data-ch-country="Croatia"
    data-language="en">
</script>

</form>

Digest is calculated using following formula:

digest = SHA512(key + order_number + amount + currency)

With the following example data

  • key: qwert123

  • order_number: abcdef

  • amount: 54321

  • currency: EUR

the digest formula gives a result as follows:

digest = SHA512("2345kljbcdef54321EUR") # resulting with "f71b8c1560bd7511ba2f0307b3823c06dd39042cd77480543e3d7bf9f3eefa6debed252979ba8edc7a82d9f111d90f8e31c1c7ab5af39796b26e59a0b2d7cf98"

Data Parameters

Buyer's profile

name
length
format
lightbox-key
additional info

ch_full_name

3-30

alphanumeric

data-ch-full-name

buyer's full name

ch_address

3-100

alphanumeric

data-ch-address

buyer's address

ch_city

3-30

alphanumeric

data-ch-city

buyer's city

ch_zip

3-9

alphanumeric

data-ch-zip

buyer's zip

ch_country

2-3

alphanumeric

data-ch-country

buyer’s country in alpha2, alpha3 letter code or 3 digit ISO numeric code

ch_phone

3-30

alphanumeric

data-ch-phone

buyer's phone

ch_email

3-100

alphanumeric

data-ch-email

buyer's email

Order details

name
length
format
lightbox-key
additional info

order_info

3-100

alphanumeric

data-order-info

short description of order being processed

order_number

1-40

alphanumeric

data-order-number

unique identifier

amount

3-11

integer

data-amount

amount is in minor units, ie. 10.24 USD is sent as 1024

currency

predefined

alpha

data-currency

possible values are USD, EUR, or BAM

Processing data

name
length
format
lightbox-key
additional info

language

predefined

alpha

data-language

used for errors localization, possible values are en, es, ba or hr

transaction_type

predefined

alpha

data-transaction-type

possible values are authorize, purchase, capture, refund, void

authenticity_token

40

alphanumeric

data-authenticity-token

auto generated value for merchant account, can be found under merchant settings

digest

40

alphanumeric

data-digest

SHA512 hash generated from concatenation of key, order_number, amount and currency as strings; key can be found under merchant settings

number_of_installments

1-2

integer

data-number-of-installments

range 2-12

moto

predefined

boolean

data-moto

possible value is true or false; missing variable is equivalent to false

Additional info

name
length
format
lightbox-key
additional info

tokenize_pan_offered

predefined

boolean

data-tokenize-pan-offered

if true and merchant has secure vault active (tokenization enabled) then save card for future payments will be shown to customer. If customer decided to save the card and transaction is approved we’ll provide pan_token which you can store on your side.

supported_payment_methods

predefined

comma separated payment methods

data-supported-payment-methods

provide this value if customer decides to pay with previously saved card(s) or with new card. If this value is provided and valid (card not expired, token valid etc) then only cvv input will be shown on the payment form. All other information (masked pan, expiry date etc) will be pre filled. Multiple tokens can be sent (separated by comma). In that case, the user will have an option which payment method to use.

tokenize_pan

predefined

boolean

data-tokenize-pan

tokenize pan without prompting the user

tokenize_brands

predefined

comma separated list of card brands

data-tokenize-brands

custom_attributes

predefined

valid JSON string

data-custom-attributes

Callback

You can set your callback URL under your merchant profile data if you want us to send a POST request with all the transaction parameters for each approved transaction. POST request is sent to your endpoint in JSON format. We expect HTTP 200 OK status response code to terminate the job, otherwise we’ll send the data periodically until we re-ceive 200. Here is a list of parameters included in callback request:

{
  "id":186562,
  "acquirer":"integration_acq",
  "order_number":"a6b62d07cc89aa0",
  "order_info":"order info for a6b62d07cc89aa0",
  "amount":100,
  "currency":"EUR",
  "ch_full_name":"John Doe",
  "outgoing_amount":100,
  "outgoing_currency":"EUR",
  "approval_code":"914783",
  "response_code":"0000",
  "response_message":"approved",
  "reference_number":"000002902038",
  "systan":"186561",
  "eci":"05",
  "xid":"fake authenticated xid +=",
  "acsv":"fake authenticated cavv +=",
  "cc_type":"visa",
  "status":"approved",
  "created_at":"2019-09-06T14:24:44.906+02:00",
  "transaction_type":"purchase",
  "enrollment":"Y",
  "authentication":"Y",
  "pan_token":null,
  "masked_pan":"434179-xxx-xxx-0044",
  "issuer":"zaba-hr",
  "number_of_installments":null,
  "custom_params":"{a:b, c:d}"
}

Migrating from data-whitelisted-pan-tokens

Simply replace key data-whitelisted-pan-tokens with a key data-supported-payment-methods and you are good to go!

You can find a demo on this link

You can check digest on this link

provide this value if you want to limit card tokenization to card brand(s). Multiple brands can be sent (separated by comma). Refer to section below.

provide this value if you want to customize form behaviour. Refer to the section below for more details.

Demo Lightbox
Calculate Digest
Transaction management through API
Capture
Refund
Void
Email notifications
Tokenize brands
List of response codes
Overview
Integration
Data Parameters
Callback
Additional info
Migrating from data-whitelisted-pan-tokens
tokenize brands
custom attributes