public class ReverseAuthorization {
@Autowired
MyFatoorahTransactionService myFatoorahTransactionService;
public void performReverseAuthorization() {
PaymentRequest paymentRequest = new PaymentRequest()
.additionalField("invoiceId", invoiceId); // The MyFatoorah invoice id gathered from the Authorize transaction.
PaymentResponse paymentResponse = myFatoorahTransactionService.reverseAuthorize(paymentRequest);
paymentResponse.isSuccessful();
paymentResponse.getGatewayResponseCode(); // MyFatoorah reason_code
paymentResponse.getGatewayTransactionId(); // MyFatoorah transaction ID
paymentResponse.getRawResponse(); // MyFatoorah Raw response stored as a JSON object.
paymentResponse.getGatewayTransactionType();
paymentResponse.getResponseMap().get("invoiceId"); // MyFatoorah invoiceId.
paymentResponse.getResponseMap().get("paymentId"); // MyFatoorah paymentId.
paymentResponse.getResponseMap().get("paymentGateway"); // MyFatoorah paymentGateway.
paymentResponse.getResponseMap().get("transactionId"); // MyFatoorah transactionId.
}
}