}
@Override
public PaymentRequestDTO translatePaymentTransaction(Money transactionAmount, PaymentTransaction paymentTransaction) {
//Will set the full amount to be charged on the transaction total/subtotal and not worry about shipping/tax breakdown
PaymentRequestDTO requestDTO = new PaymentRequestDTO()
.transactionTotal(transactionAmount.getAmount().toPlainString())
.orderSubtotal(transactionAmount.getAmount().toPlainString())
.shippingTotal(ZERO_TOTAL)
.taxTotal(ZERO_TOTAL)
.orderCurrencyCode(paymentTransaction.getOrderPayment().getCurrency().getCurrencyCode())
.orderId(paymentTransaction.getOrderPayment().getOrder().getId().toString());
//Copy Additional Fields from PaymentTransaction into the Request DTO.
//This will contain any gateway specific information needed to perform actions on this transaction
Map<String, String> additionalFields = paymentTransaction.getAdditionalFields();
for (String key : additionalFields.keySet()) {
requestDTO.additionalField(key, additionalFields.get(key));
}
return requestDTO;
}