LightBox

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.

You can find a demo on this link Demo Lightbox

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"

You can check digest on this link Calculate Digest


Data Parameters

Buyer's profile

namelengthformatlightbox-keyadditional 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

namelengthformatlightbox-keyadditional 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

namelengthformatlightbox-keyadditional 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

namelengthformatlightbox-keyadditional 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

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

custom_attributes

predefined

valid JSON string

data-custom-attributes

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

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!

Last updated