
ru.paymentgate.engine.webservices.merchant.CardAuthInfo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of abyss-acquiring Show documentation
Show all versions of abyss-acquiring Show documentation
Internet acquiring Web Service client library
The newest version!
/**
* CardAuthInfo.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 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;
/**
* CardAuthInfo bean class
*/
public class CardAuthInfo implements ADBBean {
private static final long serialVersionUID = -6254718739415967718L;
/**
* field for SecureAuthInfo
*/
protected SecureAuthInfo localSecureAuthInfo;
/*
* This tracker boolean wil be used to detect whether the user called the
* set method for this attribute. It will be used to determine whether to
* include this field in the serialized XML
*/
protected boolean localSecureAuthInfoTracker = false;
/**
* Маскированный номер карты, которая использовалась для оплаты. Указан
* только после оплаты заказа.
* Максимальная длина - 19 цифр.
*/
protected String localMaskedPan;
/**
* Срок истечения действия карты в формате YYYYMM. Указан только после
* оплаты заказа.
* Максимальная длина - 6 цифр.
*/
protected String localExpiration;
/**
* Имя держателя карты. Указан только после оплаты заказа.
* Максимальная длина - 64 символа.
*/
protected String localCardholderName;
/**
* Код авторизации платежа. Поле фиксированной длины (6 символов), может
* содержать цифры и латинские буквы. Указан только после оплаты заказа.
*/
protected String localApprovalCode;
/**
* Наименование платёжной системы. Доступны следующие варианты:
* VISA
* MASTERCARD
* AMEX
* JCB
* CUP
* MIR
*/
protected String localPaymentSystem;
/**
* Дополнительные сведения о корпоративных картах. Эти сведения заполняются
* службой технической поддержки в консоли управления. Если такие сведения
* отсутствуют, возвращается пустое значение.
* Максимальная длина - 255 символов.
*/
protected String localProduct;
public boolean isSecureAuthInfoSpecified() {
return localSecureAuthInfoTracker;
}
/**
* Auto generated getter method
*
* @return SecureAuthInfo
*/
public SecureAuthInfo getSecureAuthInfo() {
return localSecureAuthInfo;
}
/**
* Auto generated setter method
*
* @param param
* SecureAuthInfo
*/
public void setSecureAuthInfo(SecureAuthInfo param) {
localSecureAuthInfoTracker = param != null;
this.localSecureAuthInfo = param;
}
/**
* Маскированный номер карты, которая использовалась для оплаты. Указан
* только после оплаты заказа.
* Максимальная длина - 19 цифр.
*/
public String getMaskedPan() {
return localMaskedPan;
}
/**
* Маскированный номер карты, которая использовалась для оплаты. Указан
* только после оплаты заказа.
* Максимальная длина - 19 цифр.
*/
public void setMaskedPan(String param) {
this.localMaskedPan = param;
}
/**
* Срок истечения действия карты в формате YYYYMM. Указан только после
* оплаты заказа.
* Максимальная длина - 6 цифр.
*/
public String getExpiration() {
return localExpiration;
}
/**
* Срок истечения действия карты в формате YYYYMM. Указан только после
* оплаты заказа.
* Максимальная длина - 6 цифр.
*/
public void setExpiration(String param) {
this.localExpiration = param;
}
/**
* Имя держателя карты. Указан только после оплаты заказа.
* Максимальная длина - 64 символа.
*/
public String getCardholderName() {
return localCardholderName;
}
/**
* Имя держателя карты. Указан только после оплаты заказа.
* Максимальная длина - 64 символа.
*/
public void setCardholderName(String param) {
this.localCardholderName = param;
}
/**
* Код авторизации платежа. Поле фиксированной длины (6 символов), может
* содержать цифры и латинские буквы. Указан только после оплаты заказа.
*/
public String getApprovalCode() {
return localApprovalCode;
}
/**
* Код авторизации платежа. Поле фиксированной длины (6 символов), может
* содержать цифры и латинские буквы. Указан только после оплаты заказа.
*/
public void setApprovalCode(String param) {
this.localApprovalCode = param;
}
/**
* Наименование платёжной системы. Доступны следующие варианты:
* VISA
* MASTERCARD
* AMEX
* JCB
* CUP
* MIR
*/
public String getPaymentSystem() {
return localPaymentSystem;
}
/**
* Наименование платёжной системы. Доступны следующие варианты:
* VISA
* MASTERCARD
* AMEX
* JCB
* CUP
* MIR
*/
public void setPaymentSystem(String param) {
this.localPaymentSystem = param;
}
/**
* Дополнительные сведения о корпоративных картах. Эти сведения заполняются
* службой технической поддержки в консоли управления. Если такие сведения
* отсутствуют, возвращается пустое значение.
* Максимальная длина - 255 символов.
*/
public String getProduct() {
return localProduct;
}
/**
* Дополнительные сведения о корпоративных картах. Эти сведения заполняются
* службой технической поддержки в консоли управления. Если такие сведения
* отсутствуют, возвращается пустое значение.
* Максимальная длина - 255 символов.
*/
public void setProduct(String param) {
this.localProduct = 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 + ":cardAuthInfo", xmlWriter);
} else {
writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "cardAuthInfo", xmlWriter);
}
}
if (localMaskedPan != null) {
writeAttribute("", "maskedPan", ConverterUtil.convertToString(localMaskedPan), xmlWriter);
}
if (localExpiration != null) {
writeAttribute("", "expiration", ConverterUtil.convertToString(localExpiration), xmlWriter);
}
if (localCardholderName != null) {
writeAttribute("", "cardholderName", ConverterUtil.convertToString(localCardholderName), xmlWriter);
}
if (localApprovalCode != null) {
writeAttribute("", "approvalCode", ConverterUtil.convertToString(localApprovalCode), xmlWriter);
}
if (localPaymentSystem != null) {
writeAttribute("", "paymentSystem", ConverterUtil.convertToString(localPaymentSystem), xmlWriter);
}
if (localProduct != null) {
writeAttribute("", "product", ConverterUtil.convertToString(localProduct), xmlWriter);
}
if (localSecureAuthInfoTracker) {
if (localSecureAuthInfo == null) {
throw new ADBException("secureAuthInfo cannot be null!!");
}
localSecureAuthInfo.serialize(new QName("", "secureAuthInfo"), 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 CardAuthInfo parse(XMLStreamReader reader) throws Exception {
CardAuthInfo object = new CardAuthInfo();
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 (!"cardAuthInfo".equals(type)) {
// find namespace for the prefix
String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix);
return (CardAuthInfo) ExtensionMapper.getTypeObject(nsUri, type, reader);
}
}
}
// handle attribute "maskedPan"
String tempAttribMaskedPan = reader.getAttributeValue(null, "maskedPan");
if (tempAttribMaskedPan != null) {
object.setMaskedPan(ConverterUtil.convertToString(tempAttribMaskedPan));
}
// handle attribute "expiration"
String tempAttribExpiration = reader.getAttributeValue(null, "expiration");
if (tempAttribExpiration != null) {
object.setExpiration(ConverterUtil.convertToString(tempAttribExpiration));
}
// handle attribute "cardholderName"
String tempAttribCardholderName = reader.getAttributeValue(null, "cardholderName");
if (tempAttribCardholderName != null) {
object.setCardholderName(ConverterUtil.convertToString(tempAttribCardholderName));
}
// handle attribute "approvalCode"
String tempAttribApprovalCode = reader.getAttributeValue(null, "approvalCode");
if (tempAttribApprovalCode != null) {
object.setApprovalCode(ConverterUtil.convertToString(tempAttribApprovalCode));
}
// handle attribute "paymentSystem"
String tempAttribPaymentSystem = reader.getAttributeValue(null, "paymentSystem");
if (tempAttribPaymentSystem != null) {
object.setPaymentSystem(ConverterUtil.convertToString(tempAttribPaymentSystem));
}
// handle attribute "product"
String tempAttribProduct = reader.getAttributeValue(null, "product");
if (tempAttribProduct != null) {
object.setProduct(ConverterUtil.convertToString(tempAttribProduct));
}
reader.next();
while (!reader.isStartElement() && !reader.isEndElement())
reader.next();
if ((reader.isStartElement() && new QName("", "secureAuthInfo").equals(reader.getName()))
|| new QName("", "secureAuthInfo").equals(reader.getName())) {
object.setSecureAuthInfo(SecureAuthInfo.Factory.parse(reader));
reader.next();
} // End of if for expected property start element
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