Class: ApplicationManager

ApplicationManager(args)

Represents an ApplicationManager. (You most likely shouldn't be accessing this directly, use AcrosureClient#application instead.)

Constructor

new ApplicationManager(args)

Create an application manager.
Parameters:
Name Type Description
args Object An object consists of several properties.
Properties
Name Type Description
callAPI function A function which call Acrosure API.
Source:

Members

callAPI :function

callAPI Function (which should be granted by AcrosureClient#callAPI )
Type:
  • function
Source:

Methods

(async) confirm(id) → {Object}

Confirm current application.
Parameters:
Name Type Description
id string An application id.
Source:
Returns:
Confirmed application
Type
Object

(async) create(args) → {Object}

Create an application and change ApplicationManager#id if possible.
Parameters:
Name Type Description
args Object An object consists of several properties.
Properties
Name Type Attributes Description
product_id string A product id.
basic_data Object <optional>
Application's basic_data.
package_options Object <optional>
Application's package_options.
additional_data Object <optional>
Application's additional_data.
attachments Array <optional>
A list of files.
package_code string <optional>
A string of package_code.
ref1 string <optional>
A string of reference #1.
ref2 string <optional>
A string of reference #2.
ref3 string <optional>
A string of reference #3.
group_policy_id string <optional>
A string of group policy id.
step int <optional>
A number of current step.
Source:
Returns:
Created application
Type
Object

(async) get(id) → {Object}

Get an application with specify id or with current id.
Parameters:
Name Type Description
id string An application id.
Source:
Returns:
An application
Type
Object

(async, protected) get2C2PForm(args) → {Object}

Get form element for 2c2p payment (This is being called by ApplicationManager#redirectToPayment, but it is exposed just in case you need to access the generated form directly).
Parameters:
Name Type Description
args Object An object consists of several properties.
Properties
Name Type Description
application_id string An application id.
frontend_url string A string of redirect frontend URL.
Source:
Returns:
An form element
Type
Object

(async) getPackage(id) → {Array}

Get current application's package.
Parameters:
Name Type Description
id string An application id.
Source:
Returns:
Current application's package
Type
Array

(async) getPackages(id) → {Array}

Get available packages for current application.
Parameters:
Name Type Description
id string An application id.
Source:
Returns:
Available packages
Type
Array

(async) list(args) → {Array}

Get applications list with or without query.
Parameters:
Name Type Description
args Object Query object (See Acrosure API document for more detail).
Source:
Returns:
Applications
Type
Array

(async) redirectToPayment(args)

Redirect to current application's payment page (Browser only).
Parameters:
Name Type Description
args Object An object consists of several properties.
Properties
Name Type Description
application_id string An application id.
frontend_url string A string of redirect frontend URL.
Source:

(async) selectPackage(args) → {Object}

Select package for current application.
Parameters:
Name Type Description
args Object An object consists of several properties.
Properties
Name Type Description
application_id string An application id.
package_code string A string of package_code.
Source:
Returns:
Updated application
Type
Object

(async) submit(id) → {Object}

Submit current application.
Parameters:
Name Type Description
id string An application id.
Source:
Returns:
Submitted application
Type
Object

(async) update(args) → {Object}

Update current application or with specified id.
Parameters:
Name Type Description
args Object An object consists of several properties.
Properties
Name Type Attributes Description
application_id string An application id.
basic_data Object <optional>
Application's basic_data.
package_options Object <optional>
Application's package_options.
additional_data Object <optional>
Application's additional_data.
attachments Array <optional>
A list of files.
package_code string <optional>
A string of package_code.
ref1 string <optional>
A string of reference #1.
ref2 string <optional>
A string of reference #2.
ref3 string <optional>
A string of reference #3.
group_policy_id string <optional>
A string of group policy id.
step int <optional>
A number of current step.
Source:
Returns:
Updated application
Type
Object