Skip to main content

Configuration

All the methods will be available through the Macropay class. In order to create an instance, a config object must be provided through the class constructor as a param. The following table describes the config object:

Configuration Table

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.
versionNoNumberThe version of Revup API that the form will point to. Do not set it if you want to point to the default API version. Current available versions are [default, 2].

Example Configuration

This is an example of a config object:

const config = {
orderId: 'e99b5ce0-6495-4cf3-b1f9-31cbabad72f9',
apiKey:'JJAlANuyVxxxk3QnXXXnP2xxARTBUfXXXXcfIJ3M',
env: 'live'/ 'test’,
version: 2
};

Important Notes

As detailed in the table, both the order ID and the API key properties are mandatory and the form will not be rendered if any of them is missing.

With the config example above, the form will point to the API live environment, however if this environment property is not present, it will point to the API test environment by default.

The version property is also optional. You just need to set it if you want the form to point to a newer version of API that lives together with the default version, otherwise it will point to the version of default Revup API version.