Skip to main content

Initialization

All the methods will be available through the MacropayFrames class. To initialize frames, call the static init() method with the initial configuration.

const config = {
orderId:1234-12-123123sdf-sdf234sd’,
apiKey: ‘aLxxxxxxxxxxxxxxxxxxxxxxxxxx’,
env: ‘test’,
version: '2',
options : {
language: MacropayFrames.LANGUAGES.SPANISH,
textDirection: MacropayFrames.TEXT_DIRECTION.RIGHT_TO_LEFT
}
};

MacropayFrames.init(config);

Configuration Table

This table describes the config object:

PROPERTIESREQUIREDTYPEDESCRIPTION
orderIdYesStringThe order ID associated with the current payment process.
apiKeyYesStringThe API key associated with the merchant account.
envNoStringThe API environment that the form will point to. The options are “live” or “test” with the last one being the default.
optionsNoObjectParameters are language (string) and textDirection (string). Check the MacropayFrames global constants section.