cancel
Showing results for 
Search instead for 
Did you mean: 

Implement Auth Reversal in salesforce

We have CyberSource for Lightning Order Management installed in salesforce org. The capture payment is working as expected however we need to implement the auth reversal for the authorized payments.

Currently the standard adapter PTS_PaymentAdapter dont have any implementation for the same. Any help on how to implement the auth reversal would be appreciated.

Thanks

desperateuser
Member
2 REPLIES 2

@cybersource - can you please arrange someone?

ConnectApi.AuthorizationReversalRequest authorizationReversalRequest = new ConnectApi.AuthorizationReversalRequest();
authorizationReversalRequest.amount = amount;
authorizationReversalRequest.comments = 'Captured from custom action';

ConnectApi.AuthorizationReversalResponse authorizationReversalResponse = ConnectApi.Payments.reverseAuthorization(authorizationReversalRequest, authorizationId);
String authReversalId = authorizationReversalResponse.paymentAuthAdjustment.id;

 

also when i run the code for auth reversal it throws below error:

ConnectApiException:[errorCode=ALREADY_IN_PROCESS]: {"enhancedErrorType":null,"message":"The gateway adapter returned a failure status, Please check the response for more details","output":{"error":{"errorCode":"501","message":"Unsupported Operation"},"paymentGatewayLogs":[{"createdDate":"2025-08-19T16:08:13.000Z","id":"0XtAu0000019DDZKA2","interactionStatus":"NoOp"}]}}

desperateuser
Member

To implement Auth Reversal (Authorization Reversal) with CyberSource in Salesforce Lightning Order Management (LOM), you'll need to extend the standard Payment Adapter.

Implementation Steps

  • Create a Custom Adapter: Create a new Apex class, for example, CustomCyberSourcePaymentAdapter, that extends PTS_PaymentAdapter or the specific CyberSource adapter class it delegates to.
  • Override reverseAuth: Implement the reverseAuth method in your custom adapter. This method receives the payment and amount details for the reversal.
  • CyberSource API Call: Within reverseAuth, Bazoocam writes the logic to call the CyberSource REST or SOAP API endpoint for Authorization Reversal or Void. You'll need the original Authorization ID.
  • Update Payment Gateway Logs: Ensure you log the reversal status and response from CyberSource in the appropriate Salesforce objects (e.g., Payment Gateway Log).
  • Configure LOM: Update your Payment Gateway Provider settings in LOM to use your new CustomCyberSourcePaymentAdapter class.
Chad7787
Member