Class DefaultPaymentRequestService
java.lang.Object
com.broadleafcommerce.paymenttransaction.service.DefaultPaymentRequestService
- All Implemented Interfaces:
PaymentRequestService
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncom.broadleafcommerce.paymentgateway.domain.PaymentRequest
createPaymentRequest
(@NonNull Payment payment, @NonNull PaymentTransaction paymentTransaction, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Creates aPaymentRequest
, based on the providedPayment
&PaymentTransaction
, which will drive the authorization transaction inPaymentGatewayTransactionService.authorize(PaymentRequest)
.protected String
getApplicationIdFromContext
(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected com.broadleafcommerce.paymentgateway.domain.enums.PaymentType
getPaymentType
(Payment payment) protected String
getTenantIdFromContext
(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected void
populateBillTo
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, @NonNull Payment payment) protected void
populateCustomerInfo
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, @NonNull Payment payment) protected void
populatePaymentMethodProperties
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, @NonNull Payment payment) Copy additional fields from Payment into the PaymentRequest.protected void
populateShipTo
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, @NonNull Payment payment) protected void
populateStoreCreditTransactionProperties
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, @NonNull PaymentTransaction paymentTransaction) protected void
populateTransactionProperties
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, @NonNull PaymentTransaction paymentTransaction) PopulatesPaymentRequest.getAdditionalFields()
based on the contents of the providedPaymentTransaction
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.broadleafcommerce.paymenttransaction.service.PaymentRequestService
createPaymentRequest
-
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 aPaymentRequest
, based on the providedPayment
&PaymentTransaction
, which will drive the authorization transaction inPaymentGatewayTransactionService.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 interfacePaymentRequestService
- Parameters:
payment
- the cart's payment that is to be authorizedpaymentTransaction
- the cart payment's pending representation of the transaction that is to be executedcontextInfo
- 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) PopulatesPaymentRequest.getAdditionalFields()
based on the contents of the providedPaymentTransaction
- 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)
-