public interface OrderToPaymentRequestDTOService
| Modifier and Type | Method and Description |
|---|---|
PaymentRequestDTO |
translateOrder(Order order)
This translates an Order of
PaymentType.CREDIT_CARD into a PaymentRequestDTO. |
PaymentRequestDTO |
translatePaymentTransaction(Money transactionAmount,
PaymentTransaction paymentTransaction)
Utilizes the
PaymentTransaction.getAdditionalFields() map to populate necessary request parameters on the
resulting PaymentRequestDTO. |
PaymentRequestDTO translateOrder(Order order)
This translates an Order of PaymentType.CREDIT_CARD into a PaymentRequestDTO.
This method assumes that this translation will apply to a final payment which 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 order. This will only utilize the payments
that are of type PaymentType.CREDIT_CARDPaymentRequestDTO 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 to the payment gateway. For instance, this might be use to refund or void the given paymentTransactiontransactionAmount - 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 transactionAmountCopyright © 2015. All Rights Reserved.