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:
PROPERTIES | REQUIRED | TYPE | DESCRIPTION |
---|---|---|---|
orderId | Yes | String | The order ID associated with the current payment process. |
apiKey | Yes | String | The API key associated with the merchant account. |
env | No | String | The API environment that the form will point to. The options are “live” or “test” with the last one being the default. |
options | No | Object | Parameters are language (string) and textDirection (string). Check the MacropayFrames global constants section. |