Interface PaymentGatewayTransactionService

All Superinterfaces:
PaymentGatewayTypeAware
All Known Subinterfaces:
PassthroughTransactionService
All Known Implementing Classes:
DefaultPassthroughTestingTransactionService, DefaultPassthroughTransactionService

public interface PaymentGatewayTransactionService extends PaymentGatewayTypeAware

This is an interface that provides the basic functions to create billable credit card transactions

The intention of these methods are to make a server to server API call. Depending on the gateway implementation, the overall goal and meaning of the method may vary. For example, a module can implement the AUTHORIZE method:

  • Either to send credit card information directly (server to server) to the gateway to perform the transaction
  • Or to confirm an AUTHORIZATION process (some gateways don't handle a token based process through a Transparent Redirect)
  • OR handle both (the implementation will do one or the other based on the passed in parameters)

Please check the documentation of the implementing module to determine intended goal.

Author:
Elbert Bautista (elbertbautista)
  • Method Details

    • authorize

      default PaymentResponse authorize(PaymentRequest paymentRequest)
      Responsible for executing a DefaultTransactionTypes.AUTHORIZE transaction against the payment gateway, based on the provided PaymentRequest, & returning the transaction's results in the form of a PaymentResponse.
      Parameters:
      paymentRequest - The request payload that must be converted into the gateway's expected payload
      Returns:
      The results of the authorization transaction
    • capture

      default PaymentResponse capture(PaymentRequest paymentRequest)
      Responsible for executing a DefaultTransactionTypes.CAPTURE transaction against the payment gateway, based on the provided PaymentRequest, & returning the transaction's results in the form of a PaymentResponse.
      Parameters:
      paymentRequest - The request payload that must be converted into the gateway's expected payload
      Returns:
      The results of the capture transaction
    • authorizeAndCapture

      default PaymentResponse authorizeAndCapture(PaymentRequest paymentRequest)
      Responsible for executing a DefaultTransactionTypes.AUTHORIZE_AND_CAPTURE transaction against the payment gateway, based on the provided PaymentRequest, & returning the transaction's results in the form of a PaymentResponse.
      Parameters:
      paymentRequest - The request payload that must be converted into the gateway's expected payload
      Returns:
      The results of the authorization & capture transaction
    • reverseAuthorize

      default PaymentResponse reverseAuthorize(PaymentRequest paymentRequest)
      Responsible for executing a DefaultTransactionTypes.REVERSE_AUTH transaction against the payment gateway, based on the provided PaymentRequest, & returning the transaction's results in the form of a PaymentResponse.
      Parameters:
      paymentRequest - The request payload that must be converted into the gateway's expected payload
      Returns:
      The results of the reverse authorization transaction
    • refund

      default PaymentResponse refund(PaymentRequest paymentRequest)
      Responsible for executing a DefaultTransactionTypes.REFUND transaction against the payment gateway, based on the provided PaymentRequest, & returning the transaction's results in the form of a PaymentResponse.
      Parameters:
      paymentRequest - The request payload that must be converted into the gateway's expected payload
      Returns:
      The results of the refund transaction
    • detachedCredit

      default PaymentResponse detachedCredit(PaymentRequest paymentRequest)
      Responsible for executing a DefaultTransactionTypes.DETACHED_CREDIT transaction against the payment gateway, based on the provided PaymentRequest, & returning the transaction's results in the form of a PaymentResponse.
      Parameters:
      paymentRequest - The request payload that must be converted into the gateway's expected payload
      Returns:
      The results of the void transaction
    • identifyParentTransactionReferenceIfExists

      @Nullable default String identifyParentTransactionReferenceIfExists(Map<String,Object> transactionProperties, Map<String,Object> paymentProperties)
    • identifyTransactionTypeFromTransactionResults

      default TransactionType identifyTransactionTypeFromTransactionResults(Map<String,Object> transactionProperties, Map<String,Object> paymentProperties)
    • identifyTransactionReferenceIdOverrideForInitialTransaction

      @Nullable default String identifyTransactionReferenceIdOverrideForInitialTransaction(PaymentInfo paymentInfo, @Nullable String applicationId, @Nullable String tenantId)
      Hook used to potentially gather a PaymentTransaction.getTransactionReferenceId() override value for the payment's initial Authorize or AuthorizeAndCapture transaction.
      Parameters:
      paymentInfo - the information about payment
      applicationId - the id for the current application
      tenantId - the id for the current tenant
      Returns:
      An overriding transactionReferenceId value, or null if not override is to be applied.