// Path: src/main/java/com/payu/sdk/payments/model/MassiveTokenPaymentsResponse.java
// @XmlRootElement(name = "transactionTokenBatchResponse")
// @XmlAccessorType(XmlAccessType.FIELD)
// public class MassiveTokenPaymentsResponse extends Response {
// 
// 	/** The generated serial version Id */
// 	private static final long serialVersionUID = 1157400679436549655L;
// 
// 	/** The transaction response sent by the server */
// 	@XmlElement(required = false)
// 	private String id;
// 
// 	/**
// 	 * Returns the transaction batch token id
// 	 *
// 	 * @return the transaction batch token id
// 	 */
// 	public String getId() {
// 
// 		return id;
// 	}
// 
// 	/**
// 	 * Sets the transaction batch token id
// 	 *
// 	 * @param id the transaction batch token id to set
// 	 */
// 	public void setId(String id) {
// 
// 		this.id = id;
// 	}
// 
// 	/**
// 	 * Converts a xml string into a payment response object
// 	 *
// 	 * @param xml
// 	 *            The object in a xml format
// 	 * @return The payment response object
// 	 * @throws PayUException
// 	 */
// 	public static MassiveTokenPaymentsResponse fromXml(String xml) throws PayUException {
// 
// 		return (MassiveTokenPaymentsResponse) fromBaseXml(new MassiveTokenPaymentsResponse(), xml);
// 	}
// 
// }


import com.payu.sdk.exceptions.PayUException;
import com.payu.sdk.exceptions.SDKException.ErrorCode;
import com.payu.sdk.payments.model.MassiveTokenPaymentsResponse;
import com.payu.sdk.payments.model.PaymentResponse;
import com.payu.sdk.reporting.model.ReportingResponse;
import com.payu.sdk.utils.JaxbUtil;
import java.io.Serializable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
	/**
	 * Converts a string response to the response
	 *
	 * @param xmlData
	 *            The response in a xml format
	 * @return The response object
	 * @throws PayUException
	 */
	protected static Response fromBaseXml(Response response, String xmlData)
			throws PayUException {

		try {

			// Response code
			ResponseCode responseCode = ResponseCode.SUCCESS;
			Response baseResponse = null;

			if (xmlData.contains("<response>")) {
				baseResponse = JaxbUtil.convertXmlToJava(Response.class,
						xmlData);
				responseCode = baseResponse.getCode();
			} else if (xmlData.contains("<paymentResponse>")) {
				baseResponse = JaxbUtil.convertXmlToJava(PaymentResponse.class,
						xmlData);
				responseCode = baseResponse.getCode();
			} else if (xmlData.contains("<reportingResponse>")) {
				baseResponse = JaxbUtil.convertXmlToJava(
						ReportingResponse.class, xmlData);
				responseCode = baseResponse.getCode();
			} else if (xmlData.contains("<transactionTokenBatchResponse>")) {
// Path: src/main/java/com/payu/sdk/payments/model/MassiveTokenPaymentsResponse.java
// @XmlRootElement(name = "transactionTokenBatchResponse")
// @XmlAccessorType(XmlAccessType.FIELD)
// public class MassiveTokenPaymentsResponse extends Response {
// 
// 	/** The generated serial version Id */
// 	private static final long serialVersionUID = 1157400679436549655L;
// 
// 	/** The transaction response sent by the server */
// 	@XmlElement(required = false)
// 	private String id;
// 
// 	/**
// 	 * Returns the transaction batch token id
// 	 *
// 	 * @return the transaction batch token id
// 	 */
// 	public String getId() {
// 
// 		return id;
// 	}
// 
// 	/**
// 	 * Sets the transaction batch token id
// 	 *
// 	 * @param id the transaction batch token id to set
// 	 */
// 	public void setId(String id) {
// 
// 		this.id = id;
// 	}
// 
// 	/**
// 	 * Converts a xml string into a payment response object
// 	 *
// 	 * @param xml
// 	 *            The object in a xml format
// 	 * @return The payment response object
// 	 * @throws PayUException
// 	 */
// 	public static MassiveTokenPaymentsResponse fromXml(String xml) throws PayUException {
// 
// 		return (MassiveTokenPaymentsResponse) fromBaseXml(new MassiveTokenPaymentsResponse(), xml);
// 	}
// 
// }


// Path: src/main/java/com/payu/sdk/model/response/Response.java
import com.payu.sdk.exceptions.PayUException;
import com.payu.sdk.exceptions.SDKException.ErrorCode;
import com.payu.sdk.payments.model.MassiveTokenPaymentsResponse;
import com.payu.sdk.payments.model.PaymentResponse;
import com.payu.sdk.reporting.model.ReportingResponse;
import com.payu.sdk.utils.JaxbUtil;
import java.io.Serializable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

	/**
	 * Converts a string response to the response
	 *
	 * @param xmlData
	 *            The response in a xml format
	 * @return The response object
	 * @throws PayUException
	 */
	protected static Response fromBaseXml(Response response, String xmlData)
			throws PayUException {

		try {

			// Response code
			ResponseCode responseCode = ResponseCode.SUCCESS;
			Response baseResponse = null;

			if (xmlData.contains("<response>")) {
				baseResponse = JaxbUtil.convertXmlToJava(Response.class,
						xmlData);
				responseCode = baseResponse.getCode();
			} else if (xmlData.contains("<paymentResponse>")) {
				baseResponse = JaxbUtil.convertXmlToJava(PaymentResponse.class,
						xmlData);
				responseCode = baseResponse.getCode();
			} else if (xmlData.contains("<reportingResponse>")) {
				baseResponse = JaxbUtil.convertXmlToJava(
						ReportingResponse.class, xmlData);
				responseCode = baseResponse.getCode();
			} else if (xmlData.contains("<transactionTokenBatchResponse>")) {
				baseResponse = JaxbUtil.convertXmlToJava(MassiveTokenPaymentsResponse.class, xmlData);