core_payment/gateways_modal

Contain the logic for the gateways modal.

Source:
License:
  • http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Members

(static, constant) init

Source:

Set up the payment actions.

Methods

(async, inner) processPayment(gateway, component, paymentArea, itemId, description) → {Promise.<string>}

Source:

Process payment using the selected gateway.

Parameters:
Name Type Description
gateway string

The gateway to be used for payment

component string

Name of the component that the itemId belongs to

paymentArea string

Name of the area in the component that the itemId belongs to

itemId number

An internal identifier that is used by the component

description string

Description of the payment

Returns:
Type
Promise.<string>

(inner) registerEventListeners()

Source:

Register event listeners for the module.

(inner) selectSingleGateway(root)

Source:

Auto-select the gateway if there is only one gateway.

Parameters:
Name Type Description
root HTMLElement

An HTMLElement that contains the cost region

(async, inner) show(rootNode, options)

Source:

Shows the gateway selector modal.

Parameters:
Name Type Description
rootNode HTMLElement
options Object

Additional options

Properties
Name Type Description
focusOnClose HTMLElement

The element to focus on when the modal is closed.

(async, inner) updateCostRegion(root, defaultCost) → {Promise.<void>}

Source:

Shows the cost of the item the user is purchasing in the cost region.

Parameters:
Name Type Description
root HTMLElement

An HTMLElement that contains the cost region

defaultCost string

The default cost that is going to be displayed if no gateway is selected

Returns:
Type
Promise.<void>