Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/
package software.xdev.bzst.dip.client.model.message.cesop;

import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.GregorianCalendar;
import java.util.List;

import javax.xml.datatype.DatatypeConfigurationException;
Expand Down Expand Up @@ -72,7 +72,6 @@ public PaymentDataBodyType toXmlType() throws DatatypeConfigurationException
return paymentDataBodyType;
}

@SuppressWarnings("PMD.ReplaceJavaUtilCalendar")
private List<ReportedPayeeType> convertToReportedPayeesType() throws DatatypeConfigurationException
{
final List<ReportedPayeeType> reportedPayeeTypes = new ArrayList<>();
Expand Down Expand Up @@ -142,10 +141,9 @@ private List<ReportedPayeeType> convertToReportedPayeesType() throws DatatypeCon
reportedTransactionType.setInitiatedAtPhysicalPremisesOfMerchant(reportedPayee.reportedTransaction()
.initiatedAtPhysicalPremisesOfMerchant());

final GregorianCalendar gregorianCalendar =
GregorianCalendar.from(reportedPayee.reportedTransaction().transactionDateType().value());
final XMLGregorianCalendar xmlGregorianCalendar =
DatatypeFactory.newInstance().newXMLGregorianCalendar(gregorianCalendar);
final XMLGregorianCalendar xmlGregorianCalendar = DatatypeFactory.newInstance()
.newXMLGregorianCalendar(reportedPayee.reportedTransaction().transactionDateType().value()
.format(DateTimeFormatter.ISO_OFFSET_DATE_TIME));

transactionDateType.setValue(xmlGregorianCalendar);
transactionDateType.setTransactionDateType(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.GregorianCalendar;
import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.UUID;

Expand Down Expand Up @@ -258,33 +258,32 @@ protected static AddressType createAddress(
return addressType;
}

@SuppressWarnings("PMD.ReplaceJavaUtilCalendar")
private software.xdev.bzst.dip.client.xmldocument.model.cesop.MessageSpecType createMessageSpecCesop()
throws DatatypeConfigurationException
{
LOGGER.debug("Creating messageSpec...");

final software.xdev.bzst.dip.client.xmldocument.model.cesop.MessageSpecType messageSpecType =
new software.xdev.bzst.dip.client.xmldocument.model.cesop.MessageSpecType();

messageSpecType.setTransmittingCountry(MSCountryCodeType.fromValue(this.configuration.getTransmittingCountry()
.name()));
messageSpecType.setMessageType(MessageTypeType.fromValue(this.configuration.getMessageType().value()));
messageSpecType.setMessageTypeIndic(MessageTypeIndicType.fromValue(this.configuration.getMessageTypeIndicEnum()
.value()));
messageSpecType.setMessageRefId(this.configuration.getMessageRefId());

final ReportingPeriodType reportingPeriodType = new ReportingPeriodType();
reportingPeriodType.setQuarter(this.configuration.getReportingPeriodCesopQuarter());
reportingPeriodType.setYear(this.configuration.getReportingPeriodCesopYear());
messageSpecType.setReportingPeriod(reportingPeriodType);
final GregorianCalendar gregorianCalendar = GregorianCalendar.from(this.configuration.getTimestamp());
final XMLGregorianCalendar xmlGregorianCalendar =
DatatypeFactory.newInstance().newXMLGregorianCalendar(gregorianCalendar);

final XMLGregorianCalendar xmlGregorianCalendar = DatatypeFactory.newInstance()
.newXMLGregorianCalendar(this.configuration.getTimestamp()
.format(DateTimeFormatter.ISO_OFFSET_DATE_TIME));

messageSpecType.setTimestamp(xmlGregorianCalendar);

return messageSpecType;
}

Expand Down