Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Commit 2cb50bb

Browse files
committed
Changes to the Travelex XML generation.
1 parent 3eeb69c commit 2cb50bb

File tree

1 file changed

+5
-4
lines changed
  • src/main/com/topcoder/web/tc/controller/legacy/pacts/controller/request/internal

1 file changed

+5
-4
lines changed

src/main/com/topcoder/web/tc/controller/legacy/pacts/controller/request/internal/PaymentList.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ public void produceTravelexXML() throws TCWebException, IOException {
214214
date.setTime(new Date());
215215

216216
try {
217+
DecimalFormat df = new DecimalFormat("0.00", new DecimalFormatSymbols(Locale.US));
217218
DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
218219
DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
219220

@@ -244,16 +245,16 @@ public void produceTravelexXML() throws TCWebException, IOException {
244245

245246
Element paymentElement = doc.createElement("Payment");
246247
paymentElement.setAttribute("PaymentID", "" + userPayments.get(0).getId());
247-
paymentElement.setAttribute("PaymentReference", "TopCoder Member Payments");
248+
paymentElement.setAttribute("PaymentReference", "POP: Honorarium - TopCoder Member Payments");
248249

249250
Element payFromElement = doc.createElement("PayFrom");
250251
payFromElement.setAttribute("PFPayerName", "TopCoder, Inc.");
252+
payFromElement.setAttribute("PFAmount", df.format(totalUserAmount));
251253
paymentElement.appendChild(payFromElement);
252254

253255
Element payToElement = doc.createElement("PayTo");
254256
payToElement.setAttribute("PTPayeeID", user.getHandle());
255257
payToElement.setAttribute("PTPayeeName", user.getHandle());
256-
payToElement.setAttribute("PTAmount", "" + totalUserAmount);
257258
paymentElement.appendChild(payToElement);
258259

259260
Element remittanceElement = doc.createElement("Remittance");
@@ -266,7 +267,7 @@ public void produceTravelexXML() throws TCWebException, IOException {
266267
remittanceRecordElement.setAttribute("PayerDocumentDate", new SimpleDateFormat("MM/dd/yyyy").format(date.getTime()));
267268
remittanceRecordElement.setAttribute("PayerDocumentType", "PO");
268269
remittanceRecordElement.setAttribute("PayerDocumentNumber", "" + payment.getReferenceId());
269-
remittanceRecordElement.setAttribute("AmountPaid", "" + payment.getRecentNetAmount());
270+
remittanceRecordElement.setAttribute("AmountPaid", df.format(payment.getRecentNetAmount()));
270271
remittanceRecordElement.setAttribute("Notes", payment.getDescription());
271272

272273
remittanceElement.appendChild(remittanceRecordElement);
@@ -278,7 +279,7 @@ public void produceTravelexXML() throws TCWebException, IOException {
278279
remittanceRecordElement.setAttribute("PayerDocumentDate", new SimpleDateFormat("MM/dd/yyyy").format(date.getTime()));
279280
remittanceRecordElement.setAttribute("Notes", "Adjustment for Wire Fee");
280281
remittanceRecordElement.setAttribute("AmountPaid", "0.0");
281-
remittanceRecordElement.setAttribute("AdjustmentAmount", "-"+WIRE_FEE);
282+
remittanceRecordElement.setAttribute("AdjustmentAmount", df.format(-WIRE_FEE));
282283
remittanceRecordElement.setAttribute("AdjustmentReason", "Processing Fee");
283284

284285
remittanceElement.appendChild(remittanceRecordElement);

0 commit comments

Comments
 (0)