Payments Class

Authorize a payment, capture an authorized payment, and refund an authorized payment.

ConnectApi

These methods are for Payments. All methods are static.

To access Payments methods, you need these permissions.

Authorize a payment.

51.0

No

global static ConnectApi.AuthorizationResponse authorize(ConnectApi.AuthorizationRequest authorizePayment)

authorizePayment

Type: ConnectApi.AuthorizationRequest

Represents a payment authorization.

Type: ConnectApi.AuthorizationResponse

Confirms that the merchant is ready to capture payment of an existing pre-authorized transaction.

54.0

No

global static ConnectApi.PostAuthorizationResponse postAuth(ConnectApi.PostAuthRequest postAuthorizePayment)

postAuthorizePayment

Type: ConnectApi.PostAuthRequest

Information about the payment, payment method, and payment gateway from the original payment authorization.

Type: ConnectApi.PostAuthorizationResponse

Reverses a payment authorization.

51.0

No

global static ConnectApi.AuthorizationReversalResponse reverseAuthorization(ConnectApi.AuthorizationReversalRequest AuthReversalInput, String authorizationId)

AuthReversalInput

Type: ConnectApi.AuthorizationReversalRequest

Input information for the payment authorization reversal.

authorizationId

Type: String

The ID of the payment authorization to be reversed.

Type: ConnectApi.AuthorizationReversalResponse

Capture an authorized payment.

50.0

No

global static ConnectApi.CaptureResponse capture(ConnectApi.CaptureRequest AuthCaptureInput, String authorizationId)

AuthCaptureInput

Type: ConnectApi.CaptureRequest

A ConnectApi.CaptureRequest object with information about the payment capture.

authorizationId

Type: String

ID of the payment authorization. Required.

Type: ConnectApi.CaptureResponse

Refund an authorized payment.

To access Payments methods, you need these permissions.

  • Salesforce Order Management License
  • PaymentsAPIUser user permission. This permission is available with the Salesforce Order Management License. Your Salesforce admin assigns it to your profile.

50.0

No

global static ConnectApi.ReferencedRefundResponse refund(ConnectApi.ReferencedRefundRequest ReferencedRefundInput, String paymentId)

ReferencedRefundInput

Type: ConnectApi.ReferencedRefundRequest

A ConnectApi.ReferencedRefundRequest object with information about the refund.

paymentId

Type: String

ID of the payment to be refunded. Required.

Type: ConnectApi.ReferencedRefundResponse

Captures a payment without any prior authorization and creates a payment entity. The payment sale transaction is a combination of an Authorize transaction and Capture transaction. This payment sale method allows merchants to request that the funds are transferred to the merchant account in a single command, with no further action (such as charging a credit card) from the merchant.

54.0

No

global static ConnectApi.SaleResponse sale(ConnectApi.SaleRequest sale)

sale

Type: ConnectApi.SaleRequest

Payment sale input class.

Type: ConnectApi.SaleResponse

Method to take the input parameters of the payment method you want to tokenize and then pass them to the payment gateway’s tokenization service. The results of the tokenization request are returned as a response from the payment gateway.

52.0

No

global static ConnectApi.PaymentMethodTokenizationResponse tokenizePaymentMethod(ConnectApi.PaymentMethodTokenizationRequest tokenizePaymentMethodInput)

tokenizePaymentMethodInput

Type: ConnectApi.PaymentMethodTokenizationRequest

Information about the payment method to be tokenized.

Type: ConnectApi.PaymentMethodTokenizationResponse

Accepts input parameters representing a payment method and passes them in a tokenization request to the payment gateway. The results of the tokenization request are returned as a response from the payment gateway. If the tokenization was successful, the response contains the tokenized value and details about the tokenization process. Otherwise, the response contains an error message and details about the error.