Class DefaultPaymentRequestService
java.lang.Object
com.broadleafcommerce.paymenttransaction.service.DefaultPaymentRequestService
- All Implemented Interfaces:
PaymentRequestService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.broadleafcommerce.paymentgateway.domain.PaymentRequestcreatePaymentRequest(@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 StringgetTenantIdFromContext(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected voidpopulateBillTo(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, @NonNull Payment payment) protected voidpopulateCustomerInfo(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, @NonNull Payment payment) protected voidpopulatePaymentMethodProperties(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, @NonNull Payment payment) Copy additional fields from Payment into the PaymentRequest.protected voidpopulateShipTo(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, @NonNull Payment payment) protected voidpopulateStoreCreditTransactionProperties(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, @NonNull PaymentTransaction paymentTransaction) protected voidpopulateTransactionProperties(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, @NonNull PaymentTransaction paymentTransaction) PopulatesPaymentRequest.getAdditionalFields()based on the contents of the providedPaymentTransactionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
createPaymentRequestin 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
-
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)
-