In Salesforce Order Management, authorize a payment on a credit card. You can include
details for a new credit card or reference an existing payment method.
Required Editions
| Available in: Lightning Experience |
| View supported editions. |
| This feature requires the Salesforce Order Management add-on. To purchase, contact
your Salesforce account executive. |
In Flow Builder, add an Action element to your flow. Select the Order
Management category, and search for Authorize Payment.
To access this action from REST API, use the name
authorizePayment.
If you're using the Enterprise edition, we
recommend disabling the RollbackOnErrApexIAp permission and the RollbackOnErrApexIA
preference. If you keep them enabled, the entire authorization is rolled back if there are
any errors. Contact Salesforce Customer Support to disable permissions or
preferences.
Set Input Values
Use values from earlier in the flow to set the inputs.
| Input Parameter |
Description |
| Payment Authorization Request |
This input is an Apex-defined variable of class ConnectApi.AuthorizationRequest, which
includes these fields:
|
Store Output Values
Use output values later in the flow. The values are
assigned when a response is received from the payment gateway.
| Output Parameter |
Description |
| Payment Authorization Response |
This output is an Apex-defined variable of class ConnectApi.AuthorizationResponse, which
includes these fields:
- error —If an error is returned, details about that error.
This field is an Apex-defined variable of class ConnectApi.ErrorResponse, which includes these fields:
- errorCode—Error code.
- message—More detail, if available.
- gatewayResponse —Response from the payment gateway. This
field is an Apex-defined variable of class ConnectApi.AuthorizationGatewayResponse, which includes this field:
- gatewayAuthorizationCode—Payment authorization
code.
- paymentAuthorization —Details about the payment
authorization. This field is an Apex-defined variable of class ConnectApi.PaymentAuthorizationResponse, which includes these fields:
- accountId —ID of the account that contains the
payment transaction being authorized.
- amount —Amount that the gateway authorized for the
payment transaction.
- currencyIsoCode —Three-letter ISO 4217 currency code
associated with the payment group record.
- effectiveDate—Date that the authorization becomes
effective.
- expirationDate—Date that the authorization
expires.
- id—ID of the payment authorization record.
- paymentAuthorizationNumber—System-defined number for
the payment authorization record.
- requestDate—Date that the authorization
occurred.
- status—Status of the payment authorization as
returned by the gateway.
- paymentGatewayLogs —Payment gateway log information about
the authorization transaction. This field is a list of Apex-defined variables of
class ConnectApi.GatewayLogResponse, each of which includes these fields:
- createdDate—Date when the gateway log was
created.
- gatewayResultCode—Result codes that show the status
of a transaction as it is passed to the financial institution and then
returned to the client.
- id—ID of the gateway log record.
- interactionStatus—Gateway interaction status. It can
be
SUCCESS, FAILED, or TIMEOUT.
- paymentGroup —Details about the payment group. This field
is an Apex-defined variable of class ConnectApi.PaymentGroupResponse, which includes these fields:
- currencyIsoCode —Three-letter ISO 4217 currency code
associated with the payment group record.
- id—ID of the payment group record.
- sourceObjectId—Source object ID of the payment group
record.
- paymentMethod —Details about the payment method. This
field is an Apex-defined variable of class ConnectApi.PaymentMethodResponse, which includes these fields:
- accountId —ID of the account for the payment
method.
- id—ID of the payment method.
- status—Status of the payment method.
|
Usage
Use this action in custom flows that require payment authorization, such as adding an item
to an order or an uneven exchange. Before using it, verify with your payment provider that
it supports payment authorization calls from Salesforce Order Management.