Skip to main content
Skip table of contents

Initialize component

When creating a new instance of the component, a configuration object is required with the following properties: nonce (security value to exchange for a token), payload (transaction information to be processed), and settings (form configurations).

Parameters

Field

Required

Type

Description

nonce

Si

Alphanumeric

Encrypted code containing the Merchant key value. It must be generated on the backend using Alignet’s OAuth service. API Nonce

payload

Si

JSON object

JSON containing the necessary details to initialize the form:

  • Purchase details

  • Buyer details

display_settings

No

Objeto

Form display settings

display_settings.methods

No

Array of strings

Payment methods to be displayed. Possible values:

  • CARD

  • YAPE

  • QR

  • BANK_TRANSFER

  • CUOTEALO

  • PAGOEFECTIVO

If not sent, all payment methods enabled for the Merchant will be displayed by default.

Payload object

The payload object maintains the same structure as API de Autorización - ecommerce excluding the payment_method object. payment_method:

Field

Description

Accepted Value

Type

Obligatorio

action

Action to execute

authorize

String

SI

channel

Channel where the transaction will be executed

ecommerce

String

SI

merchant_code

Merchant identifier

Alphanumeric string

String

SI

merchant_operation_number

Order number of the operation

Numeric string between 6 and 12 digits

String

SI

payment_details

Object containing transaction information

NO

Object

SI

payment_details.amount

Amount in cents for the operation. Decimal separation will be applied according to the currency.
Example: For S/. 10.50, you must send “1050” and set currency to “604” for Peruvian Soles.

Numeric string

String

SI

payment_details.currency

ISO-3 currency code for the operation (ISO link missing)

Numeric string

String

SI

payment_details.additional_fields

Dictionary to send custom fields and values as key:value. Example: external_id:5468724

NO

Dictionary

NO

payment_details.customer

Object containing information about the customer making the purchase

NO

 

NO

payment_details.customer.first_name

First name(s)

Alphanumeric string

String

NO

payment_details.customer.last_name

Last name(s)

Alphanumeric string

String

NO

payment_details.customer.email

Email address

Alphanumeric string

String

NO

payment_details.customer.phone

Object containing phone information

NO

Object

NO 

payment_details.customer.phone.country_code

Country code of the phone

Numeric string

String

NO 

payment_details.customer.phone.subscriber

Phone number

Numeric string

String

NO 

payment_details.customer.location

Object containing person/address information

NO

Object

NO 

payment_details.customer.location.line_1

Address line 1

Alphanumeric string

String

NO 

payment_details.customer.location.line_2

Address line 2

Alphanumeric string

String

NO 

payment_details.customer.location.city

City

Alphanumeric string

String

NO 

payment_details.customer.location.state

State

Alphanumeric string

String

NO 

payment_details.customer.location.country

Country

Alphanumeric string

String

NO 

payment_details.billing

Object containing billing information

NO

Object

SI 

payment_details.billing.first_name

First name(s)

Alphanumeric string

String

SI

payment_details.billing.last_name

Last name(s)

Alphanumeric string

String

SI 

payment_details.billing.email

Email address

Alphanumeric string

String

SI 

payment_details.billing.phone

Object containing phone information

NO

Object

SI 

payment_details.billing.phone.country_code

Country code of the phone

Numeric string

String

SI 

payment_details.billing.phone.subscriber

Phone number

Numeric string

String

SI 

payment_details.billing.location

Object containing person/address information

NO

Object

SI 

payment_details.billing.location.line_1

Address line 1

Alphanumeric string

String

SI 

payment_details.billing.location.line_2

Address line 2

Alphanumeric string

String

NO 

payment_details.billing.location.city

City

Alphanumeric string

String

SI 

payment_details.billing.location.state

State

Alphanumeric string

String

SI 

payment_details.billing.location.country

Country

Alphanumeric string

String

SI 

payment_details.shipping

Object containing shipping information

NO

Object

NO 

payment_details.shipping.first_name

First name(s)

Alphanumeric string

String

NO 

payment_details.shipping.last_name

Last name(s)

Alphanumeric string

String

NO 

payment_details.shipping.email

Email address

Alphanumeric string

String

NO 

payment_details.shipping.phone

Object containing phone information

NO

Object

NO 

payment_details.shipping.phone.country_code

Country code of the phone

Numeric string

String

NO 

payment_details.shipping.phone.subscriber

Phone number

Numeric string

String

NO 

payment_details.shipping.location

Object containing person/address information

NO

Object

NO 

payment_details.shipping.location.line_1

Address line 1

Alphanumeric string

String

NO 

payment_details.shipping.location.line_2

Address line 2

Alphanumeric string

String

NO 

payment_details.shipping.location.city

City

Alphanumeric string

String

NO 

payment_details.shipping.location.state

State

Alphanumeric string

String

NO 

payment_details.shipping.location.country

Country

Alphanumeric string

String

NO 

Ejemplo

JS
var payload = {
            "action": "authorize",
            "channel": "ecommerce",
            "merchant_code": "b0deb6f3-e51a-48a7-9268-f1441d46f7bd",
            "merchant_operation_number": "221354",
            "payment_details": {
                "amount": "7000",
                "currency": "604",
                "billing": {
                    "first_name": "Levis",
                    "last_name": "Silvestre",
                    "email": "levis.silvestre@alignet.com",
                    "phone": {
                        "country_code": "+51",
                        "subscriber": "958435685"
                    },
                    "location": {
                        "line_1": "Av. San Borja Norte 1743",
                        "line_2": "",
                        "city": "Lima",
                        "state": "Lima",
                        "country": "PE"
                    }
                },
                "shipping": {
                    "first_name": "Levis",
                    "last_name": "Silvestre",
                    "email": "levis.silvestre@alignet.com",
                    "phone": {
                        "country_code": "+51",
                        "subscriber": "958435685"
                    },
                    "location": {
                        "line_1": "Av. San Borja Norte 1743",
                        "line_2": "",
                        "city": "Lima",
                        "state": "Lima",
                        "country": "PE"
                    }
                },
                "customer": {
                    "first_name": "Levis",
                    "last_name": "Silvestre",
                    "email": "levis.silvestre@alignet.com",
                    "phone": {
                        "country_code": "+51",
                        "subscriber": "958435685"
                    },
                    "identity_document": {
                        "country": "PER",
                        "type": "DNI",
                        "identifier": "72661927"
                    },
                    "location": {
                        "line_1": "Av. San Borja Norte 1743",
                        "line_2": "",
                        "city": "Lima",
                        "state": "Lima",
                        "country": "PE"
                    }
                }
            }
        }

var paymentForm = new FlexPaymentForms({ 
	"nonce":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJBbGlnbmV0IEpXVCBCdWlsZGVyIiwiaWF0IjoxNzEwNTQzMDAyLCJleHAiOjE3MTA1NDMwMzIsImF1ZCI6Imh0dHBzOi8vYXBpLmRldi5hbGlnbmV0LmlvIiwic3ViIjoiejhXd0FWN3JkMmpDVTBTaXZ3dFFWdjk0MWtxWmNFb3UiLCJub25jZSI6IjA0OTIwZTZjLTI0ZTgtNDYzMC05MmVkLWUxMjA2ZDg5YTNjZSIsInNjb3BlIjoiY3JlYXRlOnRva2VuIHBvc3Q6Y2hhcmdlcyB0ZXN0IiwiZ3R5IjoiY2xpZW50X2NyZWRlbnRpYWxzIn0.eOK4e_i6QaNuNlUd1or28qbPNyI3pRq19Cj-eGxqJs8", 
	"payload": payload, 
	"display_settings": {
		methods: ['QR','BANK_TRANSFER','CARD']
	}
});
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.