All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ru.paymentgate.engine.webservices.merchant.ProcessingOperation Maven / Gradle / Ivy

The newest version!
/**
 * ProcessingOperation.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis2 version: 1.7.5  Built on : May 06, 2017 (03:45:50 BST)
 */
package ru.paymentgate.engine.webservices.merchant;

import java.util.Calendar;

import javax.xml.namespace.NamespaceContext;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import javax.xml.stream.XMLStreamWriter;

import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
import org.apache.axis2.databinding.ADBBean;
import org.apache.axis2.databinding.ADBDataSource;
import org.apache.axis2.databinding.ADBException;
import org.apache.axis2.databinding.utils.BeanUtil;
import org.apache.axis2.databinding.utils.ConverterUtil;

/**
 * ProcessingOperation bean class
 */
public class ProcessingOperation implements ADBBean {

	private static final long serialVersionUID = -603265729596426048L;

	/**
	 * field for OperationDate This was an Attribute!
	 */
	protected Calendar localOperationDate;

	/**
	 * field for OperationType This was an Attribute!
	 */
	protected ProcessingOperationType localOperationType;

	/**
	 * field for Amount This was an Attribute!
	 */
	protected long localAmount;

	/**
	 * field for Pan This was an Attribute!
	 */
	protected String localPan;

	/**
	 * field for CardHolder This was an Attribute!
	 */
	protected String localCardHolder;

	/**
	 * field for Expiration This was an Attribute!
	 */
	protected String localExpiration;

	/**
	 * field for ProcessingResultCode This was an Attribute!
	 */
	protected int localProcessingResultCode;

	/**
	 * field for CurrencyCode This was an Attribute!
	 */
	protected String localCurrencyCode;

	/**
	 * field for Success This was an Attribute!
	 */
	protected String localSuccess;

	/**
	 * field for ReferenceNumber This was an Attribute!
	 */
	protected String localReferenceNumber;

	/**
	 * field for AuthCode This was an Attribute!
	 */
	protected String localAuthCode;

	/**
	 * field for ExternalId This was an Attribute!
	 */
	protected String localExternalId;

	/**
	 * field for TerminalId This was an Attribute!
	 */
	protected String localTerminalId;

	/**
	 * field for ParesResult This was an Attribute!
	 */
	protected String localParesResult;

	/**
	 * field for ParesMessage This was an Attribute!
	 */
	protected String localParesMessage;

	/**
	 * field for ParesStatus This was an Attribute!
	 */
	protected String localParesStatus;

	/**
	 * field for VeresEnrolled This was an Attribute!
	 */
	protected String localVeresEnrolled;

	/**
	 * Auto generated getter method
	 * 
	 * @return Calendar
	 */
	public Calendar getOperationDate() {
		return localOperationDate;
	}

	/**
	 * Auto generated setter method
	 * 
	 * @param param
	 *            OperationDate
	 */
	public void setOperationDate(Calendar param) {
		this.localOperationDate = param;
	}

	/**
	 * Auto generated getter method
	 * 
	 * @return ProcessingOperationType
	 */
	public ProcessingOperationType getOperationType() {
		return localOperationType;
	}

	/**
	 * Auto generated setter method
	 * 
	 * @param param
	 *            OperationType
	 */
	public void setOperationType(ProcessingOperationType param) {
		this.localOperationType = param;
	}

	/**
	 * Auto generated getter method
	 * 
	 * @return long
	 */
	public long getAmount() {
		return localAmount;
	}

	/**
	 * Auto generated setter method
	 * 
	 * @param param
	 *            Amount
	 */
	public void setAmount(long param) {
		this.localAmount = param;
	}

	/**
	 * Auto generated getter method
	 * 
	 * @return String
	 */
	public String getPan() {
		return localPan;
	}

	/**
	 * Auto generated setter method
	 * 
	 * @param param
	 *            Pan
	 */
	public void setPan(String param) {
		this.localPan = param;
	}

	/**
	 * Auto generated getter method
	 * 
	 * @return String
	 */
	public String getCardHolder() {
		return localCardHolder;
	}

	/**
	 * Auto generated setter method
	 * 
	 * @param param
	 *            CardHolder
	 */
	public void setCardHolder(String param) {
		this.localCardHolder = param;
	}

	/**
	 * Auto generated getter method
	 * 
	 * @return String
	 */
	public String getExpiration() {
		return localExpiration;
	}

	/**
	 * Auto generated setter method
	 * 
	 * @param param
	 *            Expiration
	 */
	public void setExpiration(String param) {
		this.localExpiration = param;
	}

	/**
	 * Auto generated getter method
	 * 
	 * @return int
	 */
	public int getProcessingResultCode() {
		return localProcessingResultCode;
	}

	/**
	 * Auto generated setter method
	 * 
	 * @param param
	 *            ProcessingResultCode
	 */
	public void setProcessingResultCode(int param) {
		this.localProcessingResultCode = param;
	}

	/**
	 * Auto generated getter method
	 * 
	 * @return String
	 */
	public String getCurrencyCode() {
		return localCurrencyCode;
	}

	/**
	 * Auto generated setter method
	 * 
	 * @param param
	 *            CurrencyCode
	 */
	public void setCurrencyCode(String param) {
		this.localCurrencyCode = param;
	}

	/**
	 * Auto generated getter method
	 * 
	 * @return String
	 */
	public String getSuccess() {
		return localSuccess;
	}

	/**
	 * Auto generated setter method
	 * 
	 * @param param
	 *            Success
	 */
	public void setSuccess(String param) {
		this.localSuccess = param;
	}

	/**
	 * Auto generated getter method
	 * 
	 * @return String
	 */
	public String getReferenceNumber() {
		return localReferenceNumber;
	}

	/**
	 * Auto generated setter method
	 * 
	 * @param param
	 *            ReferenceNumber
	 */
	public void setReferenceNumber(String param) {
		this.localReferenceNumber = param;
	}

	/**
	 * Auto generated getter method
	 * 
	 * @return String
	 */
	public String getAuthCode() {
		return localAuthCode;
	}

	/**
	 * Auto generated setter method
	 * 
	 * @param param
	 *            AuthCode
	 */
	public void setAuthCode(String param) {
		this.localAuthCode = param;
	}

	/**
	 * Auto generated getter method
	 * 
	 * @return String
	 */
	public String getExternalId() {
		return localExternalId;
	}

	/**
	 * Auto generated setter method
	 * 
	 * @param param
	 *            ExternalId
	 */
	public void setExternalId(String param) {
		this.localExternalId = param;
	}

	/**
	 * Auto generated getter method
	 * 
	 * @return String
	 */
	public String getTerminalId() {
		return localTerminalId;
	}

	/**
	 * Auto generated setter method
	 * 
	 * @param param
	 *            TerminalId
	 */
	public void setTerminalId(String param) {
		this.localTerminalId = param;
	}

	/**
	 * Auto generated getter method
	 * 
	 * @return String
	 */
	public String getParesResult() {
		return localParesResult;
	}

	/**
	 * Auto generated setter method
	 * 
	 * @param param
	 *            ParesResult
	 */
	public void setParesResult(String param) {
		this.localParesResult = param;
	}

	/**
	 * Auto generated getter method
	 * 
	 * @return String
	 */
	public String getParesMessage() {
		return localParesMessage;
	}

	/**
	 * Auto generated setter method
	 * 
	 * @param param
	 *            ParesMessage
	 */
	public void setParesMessage(String param) {
		this.localParesMessage = param;
	}

	/**
	 * Auto generated getter method
	 * 
	 * @return String
	 */
	public String getParesStatus() {
		return localParesStatus;
	}

	/**
	 * Auto generated setter method
	 * 
	 * @param param
	 *            ParesStatus
	 */
	public void setParesStatus(String param) {
		this.localParesStatus = param;
	}

	/**
	 * Auto generated getter method
	 * 
	 * @return String
	 */
	public String getVeresEnrolled() {
		return localVeresEnrolled;
	}

	/**
	 * Auto generated setter method
	 * 
	 * @param param
	 *            VeresEnrolled
	 */
	public void setVeresEnrolled(String param) {
		this.localVeresEnrolled = param;
	}

	/**
	 *
	 * @param parentQName
	 * @param factory
	 * @return OMElement
	 */
	@Override
	public OMElement getOMElement(final QName parentQName, final OMFactory factory) throws ADBException {
		return factory.createOMElement(new ADBDataSource(this, parentQName));
	}

	@Override
	public void serialize(final QName parentQName, XMLStreamWriter xmlWriter) throws XMLStreamException, ADBException {
		serialize(parentQName, xmlWriter, false);
	}

	@Override
	public void serialize(final QName parentQName, XMLStreamWriter xmlWriter, boolean serializeType)
			throws XMLStreamException, ADBException {
		String prefix = null;
		String namespace = null;

		prefix = parentQName.getPrefix();
		namespace = parentQName.getNamespaceURI();
		writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter);

		if (serializeType) {
			String namespacePrefix = registerPrefix(xmlWriter, "http://engine.paymentgate.ru/webservices/merchant");

			if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)) {
				writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type",
						namespacePrefix + ":processingOperation", xmlWriter);
			} else {
				writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "processingOperation",
						xmlWriter);
			}
		}

		if (localOperationDate != null) {
			writeAttribute("", "operationDate", ConverterUtil.convertToString(localOperationDate), xmlWriter);
		}

		if (localOperationType != null) {
			writeAttribute("", "operationType", localOperationType.toString(), xmlWriter);
		}

		if (localAmount != Long.MIN_VALUE) {
			writeAttribute("", "amount", ConverterUtil.convertToString(localAmount), xmlWriter);
		}

		if (localPan != null) {
			writeAttribute("", "pan", ConverterUtil.convertToString(localPan), xmlWriter);
		}

		if (localCardHolder != null) {
			writeAttribute("", "cardHolder", ConverterUtil.convertToString(localCardHolder), xmlWriter);
		}

		if (localExpiration != null) {
			writeAttribute("", "expiration", ConverterUtil.convertToString(localExpiration), xmlWriter);
		}

		if (localProcessingResultCode != Integer.MIN_VALUE) {
			writeAttribute("", "processingResultCode", ConverterUtil.convertToString(localProcessingResultCode),
					xmlWriter);
		}

		if (localCurrencyCode != null) {
			writeAttribute("", "currencyCode", ConverterUtil.convertToString(localCurrencyCode), xmlWriter);
		}

		if (localSuccess != null) {
			writeAttribute("", "success", ConverterUtil.convertToString(localSuccess), xmlWriter);
		}

		if (localReferenceNumber != null) {
			writeAttribute("", "referenceNumber", ConverterUtil.convertToString(localReferenceNumber), xmlWriter);
		}

		if (localAuthCode != null) {
			writeAttribute("", "authCode", ConverterUtil.convertToString(localAuthCode), xmlWriter);
		}

		if (localExternalId != null) {
			writeAttribute("", "externalId", ConverterUtil.convertToString(localExternalId), xmlWriter);
		}

		if (localTerminalId != null) {
			writeAttribute("", "terminalId", ConverterUtil.convertToString(localTerminalId), xmlWriter);
		}

		if (localParesResult != null) {
			writeAttribute("", "paresResult", ConverterUtil.convertToString(localParesResult), xmlWriter);
		}

		if (localParesMessage != null) {
			writeAttribute("", "paresMessage", ConverterUtil.convertToString(localParesMessage), xmlWriter);
		}

		if (localParesStatus != null) {
			writeAttribute("", "paresStatus", ConverterUtil.convertToString(localParesStatus), xmlWriter);
		}

		if (localVeresEnrolled != null) {
			writeAttribute("", "veresEnrolled", ConverterUtil.convertToString(localVeresEnrolled), xmlWriter);
		}

		xmlWriter.writeEndElement();
	}

	private static String generatePrefix(String namespace) {
		if (namespace.equals("http://engine.paymentgate.ru/webservices/merchant")) {
			return "ns1";
		}

		return BeanUtil.getUniquePrefix();
	}

	/**
	 * Utility method to write an element start tag.
	 */
	private void writeStartElement(String prefix, String namespace, String localPart, XMLStreamWriter xmlWriter)
			throws XMLStreamException {
		String writerPrefix = xmlWriter.getPrefix(namespace);

		if (writerPrefix != null) {
			xmlWriter.writeStartElement(writerPrefix, localPart, namespace);
		} else {
			if (namespace.length() == 0) {
				prefix = "";
			} else if (prefix == null) {
				prefix = generatePrefix(namespace);
			}

			xmlWriter.writeStartElement(prefix, localPart, namespace);
			xmlWriter.writeNamespace(prefix, namespace);
			xmlWriter.setPrefix(prefix, namespace);
		}
	}

	/**
	 * Util method to write an attribute with the ns prefix
	 */
	private void writeAttribute(String prefix, String namespace, String attName, String attValue,
			XMLStreamWriter xmlWriter) throws XMLStreamException {
		String writerPrefix = xmlWriter.getPrefix(namespace);

		if (writerPrefix != null) {
			xmlWriter.writeAttribute(writerPrefix, namespace, attName, attValue);
		} else {
			xmlWriter.writeNamespace(prefix, namespace);
			xmlWriter.setPrefix(prefix, namespace);
			xmlWriter.writeAttribute(prefix, namespace, attName, attValue);
		}
	}

	/**
	 * Util method to write an attribute without the ns prefix
	 */
	private void writeAttribute(String namespace, String attName, String attValue, XMLStreamWriter xmlWriter)
			throws XMLStreamException {
		if (namespace.equals("")) {
			xmlWriter.writeAttribute(attName, attValue);
		} else {
			xmlWriter.writeAttribute(registerPrefix(xmlWriter, namespace), namespace, attName, attValue);
		}
	}

	/**
	 * Register a namespace prefix
	 */
	private String registerPrefix(XMLStreamWriter xmlWriter, String namespace) throws XMLStreamException {
		String prefix = xmlWriter.getPrefix(namespace);

		if (prefix == null) {
			prefix = generatePrefix(namespace);

			NamespaceContext nsContext = xmlWriter.getNamespaceContext();

			while (true) {
				String uri = nsContext.getNamespaceURI(prefix);

				if ((uri == null) || (uri.length() == 0)) {
					break;
				}

				prefix = BeanUtil.getUniquePrefix();
			}

			xmlWriter.writeNamespace(prefix, namespace);
			xmlWriter.setPrefix(prefix, namespace);
		}

		return prefix;
	}

	/**
	 * Factory class that keeps the parse method
	 */
	public static class Factory {
		/**
		 * static method to create the object Precondition: If this object is an
		 * element, the current or next start element starts this object and any
		 * intervening reader events are ignorable If this object is not an
		 * element, it is a complex type and the reader is at the event just
		 * after the outer start element Postcondition: If this object is an
		 * element, the reader is positioned at its end element If this object
		 * is a complex type, the reader is positioned at the end element of its
		 * outer element
		 */
		public static ProcessingOperation parse(XMLStreamReader reader) throws Exception {
			ProcessingOperation object = new ProcessingOperation();

			try {
				while (!reader.isStartElement() && !reader.isEndElement())
					reader.next();

				if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) {
					String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type");

					if (fullTypeName != null) {
						String nsPrefix = null;

						if (fullTypeName.indexOf(":") > -1) {
							nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":"));
						}

						nsPrefix = (nsPrefix == null) ? "" : nsPrefix;

						String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1);

						if (!"processingOperation".equals(type)) {
							// find namespace for the prefix
							String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix);

							return (ProcessingOperation) ExtensionMapper.getTypeObject(nsUri, type, reader);
						}
					}
				}

				// handle attribute "operationDate"
				String tempAttribOperationDate = reader.getAttributeValue(null, "operationDate");

				if (tempAttribOperationDate != null) {
					object.setOperationDate(ConverterUtil.convertToDateTime(tempAttribOperationDate));
				}

				// handle attribute "operationType"
				String tempAttribOperationType = reader.getAttributeValue(null, "operationType");

				if (tempAttribOperationType != null) {
					object.setOperationType(
							ProcessingOperationType.Factory.fromString(reader, tempAttribOperationType));
				}

				// handle attribute "amount"
				String tempAttribAmount = reader.getAttributeValue(null, "amount");

				if (tempAttribAmount != null) {
					object.setAmount(ConverterUtil.convertToLong(tempAttribAmount));
				} else {
					object.setAmount(Long.MIN_VALUE);
				}

				// handle attribute "pan"
				String tempAttribPan = reader.getAttributeValue(null, "pan");

				if (tempAttribPan != null) {
					object.setPan(ConverterUtil.convertToString(tempAttribPan));
				}

				// handle attribute "cardHolder"
				String tempAttribCardHolder = reader.getAttributeValue(null, "cardHolder");

				if (tempAttribCardHolder != null) {
					object.setCardHolder(ConverterUtil.convertToString(tempAttribCardHolder));
				}

				// handle attribute "expiration"
				String tempAttribExpiration = reader.getAttributeValue(null, "expiration");

				if (tempAttribExpiration != null) {
					object.setExpiration(ConverterUtil.convertToString(tempAttribExpiration));
				}

				// handle attribute "processingResultCode"
				String tempAttribProcessingResultCode = reader.getAttributeValue(null, "processingResultCode");

				if (tempAttribProcessingResultCode != null) {
					object.setProcessingResultCode(ConverterUtil.convertToInt(tempAttribProcessingResultCode));
				} else {
					object.setProcessingResultCode(Integer.MIN_VALUE);
				}

				// handle attribute "currencyCode"
				String tempAttribCurrencyCode = reader.getAttributeValue(null, "currencyCode");

				if (tempAttribCurrencyCode != null) {
					object.setCurrencyCode(ConverterUtil.convertToString(tempAttribCurrencyCode));
				}

				// handle attribute "success"
				String tempAttribSuccess = reader.getAttributeValue(null, "success");

				if (tempAttribSuccess != null) {
					object.setSuccess(ConverterUtil.convertToString(tempAttribSuccess));
				}

				// handle attribute "referenceNumber"
				String tempAttribReferenceNumber = reader.getAttributeValue(null, "referenceNumber");

				if (tempAttribReferenceNumber != null) {
					object.setReferenceNumber(ConverterUtil.convertToString(tempAttribReferenceNumber));
				}

				// handle attribute "authCode"
				String tempAttribAuthCode = reader.getAttributeValue(null, "authCode");

				if (tempAttribAuthCode != null) {
					object.setAuthCode(ConverterUtil.convertToString(tempAttribAuthCode));
				}

				// handle attribute "externalId"
				String tempAttribExternalId = reader.getAttributeValue(null, "externalId");

				if (tempAttribExternalId != null) {
					object.setExternalId(ConverterUtil.convertToString(tempAttribExternalId));
				}

				// handle attribute "terminalId"
				String tempAttribTerminalId = reader.getAttributeValue(null, "terminalId");

				if (tempAttribTerminalId != null) {
					object.setTerminalId(ConverterUtil.convertToString(tempAttribTerminalId));
				}

				// handle attribute "paresResult"
				String tempAttribParesResult = reader.getAttributeValue(null, "paresResult");

				if (tempAttribParesResult != null) {
					object.setParesResult(ConverterUtil.convertToString(tempAttribParesResult));
				}

				// handle attribute "paresMessage"
				String tempAttribParesMessage = reader.getAttributeValue(null, "paresMessage");

				if (tempAttribParesMessage != null) {
					object.setParesMessage(ConverterUtil.convertToString(tempAttribParesMessage));
				}

				// handle attribute "paresStatus"
				String tempAttribParesStatus = reader.getAttributeValue(null, "paresStatus");

				if (tempAttribParesStatus != null) {
					object.setParesStatus(ConverterUtil.convertToString(tempAttribParesStatus));
				}

				// handle attribute "veresEnrolled"
				String tempAttribVeresEnrolled = reader.getAttributeValue(null, "veresEnrolled");

				if (tempAttribVeresEnrolled != null) {
					object.setVeresEnrolled(ConverterUtil.convertToString(tempAttribVeresEnrolled));
				}

				reader.next();

				while (!reader.isStartElement() && !reader.isEndElement())
					reader.next();

				if (reader.isStartElement()) {
					// 2 - A start element we are not expecting indicates a
					// trailing invalid property
					throw new ADBException("Unexpected subelement " + reader.getName());
				}
			} catch (XMLStreamException e) {
				throw new Exception(e);
			}

			return object;
		}
	} // end of factory class

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy