order.setPostUsername(postUsername);
order.setPostPassword(postPassword);
order.setInputCurrency(orderHeader.getSiteCurrency().getSiteCurrencyClass().getSiteCurrencyClassName());
order.setAmount(Format.getSimpleFloat(creditHeader.getCreditTotal()));
PaymentTran payment = orderHeader.getPaymentTran();
if (payment == null) {
for (InvoiceHeader invoiceHeader : orderHeader.getInvoiceHeaders()) {
payment = invoiceHeader.getPaymentTran();
}
}
order.setDpsTxnRef(payment.getPaymentReference1());
order.setTxnId(payment.getPaymentReference2());
order.setTxnType(CARDACTION_CREDIT);
String url = SERVICE_URL_SANDBOX;
if (isProduction()) {
url = SERVICE_URL_PRODUCTION;