public interface OrderToPaymentRequestDTOService
| Modifier and Type | Method and Description |
|---|---|
void |
populateBillTo(Order order,
PaymentRequestDTO requestDTO)
Uses billing information on the Order to populate the
PaymentRequestDTO.billTo() object |
void |
populateCustomerInfo(Order order,
PaymentRequestDTO requestDTO)
Uses customer information on the Order to populate the
PaymentRequestDTO.customer() object |
void |
populateDefaultLineItemsAndSubtotal(Order order,
PaymentRequestDTO requestDTO)
Uses order information to populate various line item and subtotal information on the order
|
void |
populateShipTo(Order order,
PaymentRequestDTO requestDTO)
Uses the first shippable fulfillment group to populate the
PaymentRequestDTO.shipTo() object |
void |
populateTotals(Order order,
PaymentRequestDTO requestDTO)
Uses total information on the Order to populate the
PaymentRequestDTO.transactionTotal(String)()}
PaymentRequestDTO.taxTotal(String)()}
PaymentRequestDTO.shippingTotal(String)()}
PaymentRequestDTO.orderCurrencyCode(String)()} |
PaymentRequestDTO |
translateOrder(Order order)
This translates an Order into a PaymentRequestDTO.
|
PaymentRequestDTO |
translatePaymentTransaction(Money transactionAmount,
PaymentTransaction paymentTransaction)
Utilizes the
PaymentTransaction.getAdditionalFields() map to populate necessary request parameters on the
resulting PaymentRequestDTO. |
PaymentRequestDTO |
translatePaymentTransaction(Money transactionAmount,
PaymentTransaction paymentTransaction,
boolean autoCalculateFinalPaymentTotals)
Important: As of 4.0.1-GA+, there is a requirement to automatically populate the transaction amount on the DTO
only if coming from a "checkout payment flow".
|
PaymentRequestDTO translateOrder(Order order)
This translates an Order into a PaymentRequestDTO.
This method assumes that the total transaction amount being sent to the gateway will be calculated from the
"final payment" on the order. This means that the transaction amount for
the returned PaymentRequestDTO will be Order.getTotalAfterAppliedPayments()
It assumes that all other payments (e.g. gift cards/account credit) have already
been applied to the Order.
order - the Order to be translatedPaymentRequestDTO based on the properties of an order.PaymentRequestDTO translatePaymentTransaction(Money transactionAmount, PaymentTransaction paymentTransaction)
PaymentTransaction.getAdditionalFields() map to populate necessary request parameters on the
resulting PaymentRequestDTO. These additional fields are then used by the payment gateway to construct
additional requests. For example, an existing PaymentTransaction of
type PaymentTransactionType.AUTHORIZE might be passed into this method
in order for the gateway issue a "reverse auth" against this original transaction.transactionAmount - the amount that should be placed on PaymentRequestDTO.getTransactionTotal()paymentTransaction - the transaction whose additional fields should be placed on PaymentRequestDTO.getAdditionalFields()
for the gateway to usePaymentRequestDTO populated with the additional fields from paymentTransaction and
the amount from transactionAmount OR override with final payment details on the order if coming in from a
payment flow.org.broadleafcommerce.core.checkout.service.workflow.ValidateAndConfirmPaymentActivity},
org.broadleafcommerce.core.checkout.service.workflow.ConfirmPaymentsRollbackHandler}PaymentRequestDTO translatePaymentTransaction(Money transactionAmount, PaymentTransaction paymentTransaction, boolean autoCalculateFinalPaymentTotals)
ValidateAndConfirmPaymentActivity and the
payment transaction passed in is of type PaymentTransactionType.UNCONFIRMED.
If the totals need to be auto-calculated, the transaction total will be set from the "final payment" details that
are coming off the order itself (along with other details like shipping/billing info etc...)transactionAmount - paymentTransaction - autoCalculateFinalPaymentTotals - https://github.com/BroadleafCommerce/BroadleafCommerce/issues/1423} for details.void populateTotals(Order order, PaymentRequestDTO requestDTO)
PaymentRequestDTO.transactionTotal(String)()}
PaymentRequestDTO.taxTotal(String)()}
PaymentRequestDTO.shippingTotal(String)()}
PaymentRequestDTO.orderCurrencyCode(String)()}order - the Order to get data fromrequestDTO - the PaymentRequestDTO that should be populatedvoid populateCustomerInfo(Order order, PaymentRequestDTO requestDTO)
PaymentRequestDTO.customer() objectorder - the Order to get data fromrequestDTO - the PaymentRequestDTO that should be populatedvoid populateShipTo(Order order, PaymentRequestDTO requestDTO)
PaymentRequestDTO.shipTo() objectorder - the Order to get data fromrequestDTO - the PaymentRequestDTO that should be populatedFulfillmentGroupService#getFirstShippableFulfillmentGroup(Order)}void populateBillTo(Order order, PaymentRequestDTO requestDTO)
PaymentRequestDTO.billTo() objectorder - the Order to get data fromrequestDTO - the PaymentRequestDTO that should be populatedvoid populateDefaultLineItemsAndSubtotal(Order order, PaymentRequestDTO requestDTO)
Uses order information to populate various line item and subtotal information on the order
IMPORTANT: Each gateway that accepts line item information may require you to construct this differently. Please consult the module documentation on how it should be properly constructed.
In this default implementation, just the subtotal is set, without any line item details.
order - the Order to get data fromrequestDTO - the PaymentRequestDTO that should be populatedCopyright © 2020. All rights reserved.