Skip to main content
Related API: This extension modifies the Perform Payment Action operation.
This action is only invoked for third-party payment gateways (such as PayPal, Pay With Amazon, etc). It is not called for standard credit card payments processed through payment gateway integrations. If you are working with credit card payments, see the action.before and action.after actions instead.
This action occurs before a certain interaction is performed on a payment, and is particulary useful for third-party services interacting with payments. This action runs after the embedded.commerce.payments.action.before action and before the embedded.commerce.payments.action.after action. The main difference between these three actions is the methods each has access to and whether they occur before or after the payment interaction. The relevant payment interactions that this action responds to are:
  • AuthAndCapture
  • Authorize
  • Capture
  • Create
  • Credit
  • Decline
  • RequestCheck
  • Rollback
  • Void
Action TypeEmbedded
Full Action IDembedded.commerce.payments.action.performPaymentInteraction
Runs multiple custom functions?No

JavaScript File Structure

Action files share the following basic structure:
When you code the custom function for an action, you have access to two arguments: callback—This argument follows the established JavaScript callback pattern: it takes an error as the first argument (or null if there is no error) and a result as the second argument (if required). context—This argument provides the function access to relevant objects and methods that interface with Kibo.

Context: Payment

The methods and objects documented here are available to this action through the use of the context argument. Microservice Operation
This action corresponds to the microservice that performs payment actions.

Get

get.payment

Returns the payment transaction. Example:
Response:
For information about the properties in the response, refer to the REST API Help.

get.paymentAction

Returns a primitive list of strings naming the available payment actions. Example:
Response:

Exec

exec.addPaymentInteraction

Adds a payment action. Example:
Response:
Returns a payment interaction. For information about the properties in the response, refer to the REST API Help.

exec.setPaymentAmountRequested

Set a requested payment amount for the transaction. Example:
Response:
For information about the properties in the response, refer to the REST API Help.

exec.setPaymentAmountCollected

Set a collected payment amount for the transaction. Example:
Response:
For information about the properties in the response, refer to the REST API Help.

exec.setPaymentAmountCredited

Set a credited payment amount for the transaction. Example:
Response:
For information about the properties in the response, refer to the REST API Help.

Context Objects Available to All Actions

apiContext

Accesses tenant information. Example:

configuration

Receives a JSON response that contains information about the configuration data set in the Action Management JSON editor. Example: