Class DefaultPaymentRequestService

java.lang.Object
com.broadleafcommerce.paymenttransaction.service.DefaultPaymentRequestService
All Implemented Interfaces:
PaymentRequestService

public class DefaultPaymentRequestService extends Object implements PaymentRequestService
  • Constructor Details

    • DefaultPaymentRequestService

      public DefaultPaymentRequestService()
  • Method Details

    • createPaymentRequest

      public com.broadleafcommerce.paymentgateway.domain.PaymentRequest createPaymentRequest(@NonNull @NonNull Payment payment, @NonNull @NonNull PaymentTransaction paymentTransaction, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Creates a PaymentRequest, based on the provided Payment & PaymentTransaction, which will drive the authorization transaction in PaymentGatewayTransactionService.authorize(PaymentRequest). NOTE: Some gateways will perform checks against these totals. Since these price data points don't directly reference cartPricing.getAdjustmentsTotal(), the value for cartPricing.getTotal() MUST include the adjustments.
      Specified by:
      createPaymentRequest in interface PaymentRequestService
      Parameters:
      payment - the cart's payment that is to be authorized
      paymentTransaction - the cart payment's pending representation of the transaction that is to be executed
      contextInfo - context information around sandboxing and multitenant state
      Returns:
      the created PaymentRequest
    • getPaymentType

      @Nullable protected com.broadleafcommerce.paymentgateway.domain.enums.PaymentType getPaymentType(@NotNull Payment payment)
    • populateCustomerInfo

      protected void populateCustomerInfo(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, @NonNull @NonNull Payment payment)
    • populateShipTo

      protected void populateShipTo(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, @NonNull @NonNull Payment payment)
    • populateBillTo

      protected void populateBillTo(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, @NonNull @NonNull Payment payment)
    • populatePaymentMethodProperties

      protected void populatePaymentMethodProperties(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, @NonNull @NonNull Payment payment)
      Copy additional fields from Payment into the PaymentRequest. This will contain any gateway-specific information needed to perform gateway transactions.
      Parameters:
      paymentRequest - The request object that the properties should be added to.
      payment - The payment that is being used to build the request object.
    • populateTransactionProperties

      protected void populateTransactionProperties(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, @NonNull @NonNull PaymentTransaction paymentTransaction)
      Populates PaymentRequest.getAdditionalFields() based on the contents of the provided PaymentTransaction
      Parameters:
      paymentRequest -
      paymentTransaction -
    • populateStoreCreditTransactionProperties

      protected void populateStoreCreditTransactionProperties(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, @NonNull @NonNull PaymentTransaction paymentTransaction)
    • getTenantIdFromContext

      @Nullable protected String getTenantIdFromContext(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    • getApplicationIdFromContext

      @Nullable protected String getApplicationIdFromContext(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)