while (_request.getParameter(PARAM_ITEM + lineNum + DOT_AMOUNT) != null &&
_request.getParameter(PARAM_ITEM + lineNum + DOT_NAME) != null &&
_request.getParameter(PARAM_ITEM + lineNum + DOT_NUMBER) != null &&
_request.getParameter(PARAM_ITEM + lineNum + DOT_QUANTITY) != null &&
_request.getParameter(PARAM_ITEM + lineNum + DOT_TAX) != null) {
PaymentDetailsItemType item = new PaymentDetailsItemType();
BasicAmountType amount = new BasicAmountType();
amount.set_value(_request.getParameter(PARAM_ITEM + lineNum + DOT_AMOUNT));
if (_request.getParameter(PARAM_ITEM + lineNum + DOT_AMOUNT_CURRENCY_ID) != null) {
amount.setCurrencyID(CurrencyCodeType.fromString(_request.getParameter(PARAM_ITEM + lineNum + DOT_AMOUNT_CURRENCY_ID)));
}
else {
amount.setCurrencyID(CurrencyCodeType.USD);
}
item.setAmount(amount);
item.setName(_request.getParameter(PARAM_ITEM + lineNum + DOT_NAME));
item.setNumber(_request.getParameter(PARAM_ITEM + lineNum + DOT_NUMBER));
item.setQuantity(new BigInteger(_request.getParameter(PARAM_ITEM + lineNum + DOT_QUANTITY)));
BasicAmountType tax = new BasicAmountType();
tax.set_value(_request.getParameter(PARAM_ITEM + lineNum + DOT_TAX));
if (_request.getParameter(PARAM_ITEM + lineNum + DOT_TAX_CURRENCY_ID) != null) {
tax.setCurrencyID(CurrencyCodeType.fromString(_request.getParameter(PARAM_ITEM + lineNum + DOT_TAX_CURRENCY_ID)));
}
else {
tax.setCurrencyID(CurrencyCodeType.USD);
}
item.setTax(tax);
items.add(item);
lineNum++;
}
details.setPaymentDetailsItem((PaymentDetailsItemType[]) items.toArray(new PaymentDetailsItemType[items.size()]));
}