diff --git a/pom.xml b/pom.xml index a3052c4d3..0e71be887 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 br.com.rjconsultores ModelWeb - 1.0.33 + 1.0.34 rj-releases diff --git a/src/com/rjconsultores/ventaboletos/dao/EmpresaMercadoPagoConfigDAO.java b/src/com/rjconsultores/ventaboletos/dao/EmpresaMercadoPagoConfigDAO.java new file mode 100644 index 000000000..b6f67d003 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/EmpresaMercadoPagoConfigDAO.java @@ -0,0 +1,14 @@ +package com.rjconsultores.ventaboletos.dao; + +import java.util.List; + +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.EmpresaMercadoPagoConfig; + +public interface EmpresaMercadoPagoConfigDAO extends GenericDAO { + + public List obtenerTodos(); + + public EmpresaMercadoPagoConfig buscarPorEmpresa(Empresa empresa); + +} diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/EmpresaMercadoPagoConfigHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/EmpresaMercadoPagoConfigHibernateDAO.java new file mode 100644 index 000000000..8db517f81 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/EmpresaMercadoPagoConfigHibernateDAO.java @@ -0,0 +1,41 @@ +package com.rjconsultores.ventaboletos.dao.hibernate; + +import java.util.List; + +import org.hibernate.Criteria; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.Restrictions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Repository; + +import com.rjconsultores.ventaboletos.dao.EmpresaMercadoPagoConfigDAO; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.EmpresaMercadoPagoConfig; + +@Repository("empresaMercadoPagoConfigDAO") +public class EmpresaMercadoPagoConfigHibernateDAO extends GenericHibernateDAO + implements EmpresaMercadoPagoConfigDAO { + + @Autowired + public EmpresaMercadoPagoConfigHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { + setSessionFactory(factory); + } + + @Override + public List obtenerTodos() { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + + return c.list(); + } + + @Override + public EmpresaMercadoPagoConfig buscarPorEmpresa(Empresa empresa) { + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.eq("empresa", empresa)); + + return (EmpresaMercadoPagoConfig) c.uniqueResult(); + } +} diff --git a/src/com/rjconsultores/ventaboletos/entidad/Empresa.java b/src/com/rjconsultores/ventaboletos/entidad/Empresa.java index db424da00..fc571b856 100644 --- a/src/com/rjconsultores/ventaboletos/entidad/Empresa.java +++ b/src/com/rjconsultores/ventaboletos/entidad/Empresa.java @@ -411,6 +411,12 @@ public class Empresa implements Serializable, Auditavel { @Column(name = "INDJUROSCREDITO") private Boolean indJurosCredito; + + @Column(name = "LATITUDE ") + private Float latitude; + + @Column(name = "LONGITUDE ") + private Float longitude; @Transient @NaoAuditar @@ -1527,4 +1533,21 @@ public class Empresa implements Serializable, Auditavel { public void setIndJurosCredito(Boolean indJurosCredito) { this.indJurosCredito = indJurosCredito; } + + public Float getLatitude() { + return latitude; + } + + public void setLatitude(Float latitude) { + this.latitude = latitude; + } + + public Float getLongitude() { + return longitude; + } + + public void setLongitude(Float longitude) { + this.longitude = longitude; + } + } diff --git a/src/com/rjconsultores/ventaboletos/entidad/EmpresaAdyenConfig.java b/src/com/rjconsultores/ventaboletos/entidad/EmpresaAdyenConfig.java index 8a942e641..730a9e76c 100644 --- a/src/com/rjconsultores/ventaboletos/entidad/EmpresaAdyenConfig.java +++ b/src/com/rjconsultores/ventaboletos/entidad/EmpresaAdyenConfig.java @@ -16,8 +16,6 @@ import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; -import org.apache.commons.lang.BooleanUtils; - @Entity @SequenceGenerator(name = "EMPRESA_ADYEN_CONFIG_SEQ", sequenceName = "EMPRESA_ADYEN_CONFIG_SEQ", allocationSize = 1) @Table(name = "EMPRESA_ADYEN_CONFIG") diff --git a/src/com/rjconsultores/ventaboletos/entidad/EmpresaMercadoPagoConfig.java b/src/com/rjconsultores/ventaboletos/entidad/EmpresaMercadoPagoConfig.java new file mode 100644 index 000000000..816d4adee --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/EmpresaMercadoPagoConfig.java @@ -0,0 +1,165 @@ +package com.rjconsultores.ventaboletos.entidad; + +import java.io.Serializable; +import java.util.Date; + +import javax.persistence.Basic; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.OneToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +@Entity +@SequenceGenerator(name = "EMPRESA_MERCADOPAGO_CONFIG_SEQ", sequenceName = "EMPRESA_MERCADOPAGO_CONFIG_SEQ", allocationSize = 1) +@Table(name = "EMPRESA_MERCADOPAGO_CONFIG") +public class EmpresaMercadoPagoConfig implements Serializable { + + private static final long serialVersionUID = 1L; + @Id + @Basic(optional = false) + @GeneratedValue(strategy = GenerationType.AUTO, generator = "EMPRESA_MERCADOPAGO_CONFIG_SEQ") + @Column(name = "EMPRESAMERCADOPAGOCONFIG_ID") + private Integer empresaMercadoPagoConfigId; + @OneToOne + @JoinColumn(name = "EMPRESA_ID") + private Empresa empresa; + @Column(name = "USER_ID") + private String userId; + @Column(name = "STORE") + private String store; + @Column(name = "POS") + private String pos; + @Column(name = "TOKEN") + private String token; + @Column(name = "URL_API") + private String urlApi; + @Column(name = "ACTIVO") + private Boolean activo; + @Column(name = "FECMODIF") + @Temporal(TemporalType.TIMESTAMP) + private Date fecmodif; + @Column(name = "USUARIO_ID") + private Integer usuarioId; + + public EmpresaMercadoPagoConfig() { + + } + + public Integer getEmpresaMercadoPagoConfigId() { + return empresaMercadoPagoConfigId; + } + + public void setEmpresaMercadoPagoConfigId(Integer empresaMercadoPagoConfigId) { + this.empresaMercadoPagoConfigId = empresaMercadoPagoConfigId; + } + + public Empresa getEmpresa() { + return empresa; + } + + public void setEmpresa(Empresa empresa) { + this.empresa = empresa; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public String getStore() { + return store; + } + + public void setStore(String store) { + this.store = store; + } + + public String getPos() { + return pos; + } + + public void setPos(String pos) { + this.pos = pos; + } + + public String getToken() { + return token; + } + + public void setToken(String token) { + this.token = token; + } + + public String getUrlApi() { + return urlApi; + } + + public void setUrlApi(String urlApi) { + this.urlApi = urlApi; + } + + public Boolean getActivo() { + return activo; + } + + public void setActivo(Boolean activo) { + this.activo = activo; + } + + public Date getFecmodif() { + return fecmodif; + } + + public void setFecmodif(Date fecmodif) { + this.fecmodif = fecmodif; + } + + public Integer getUsuarioId() { + return usuarioId; + } + + public void setUsuarioId(Integer usuarioId) { + this.usuarioId = usuarioId; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((empresaMercadoPagoConfigId == null) ? 0 : empresaMercadoPagoConfigId.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + EmpresaMercadoPagoConfig other = (EmpresaMercadoPagoConfig) obj; + if (empresaMercadoPagoConfigId == null) { + if (other.empresaMercadoPagoConfigId != null) + return false; + } else if (!empresaMercadoPagoConfigId.equals(other.empresaMercadoPagoConfigId)) + return false; + return true; + } + + @Override + public String toString() { + return String.valueOf(this.getEmpresaMercadoPagoConfigId()); + } + +} diff --git a/src/com/rjconsultores/ventaboletos/enums/TipoEnvioRest.java b/src/com/rjconsultores/ventaboletos/enums/TipoEnvioRest.java index 9093f15ac..86ac66c4e 100644 --- a/src/com/rjconsultores/ventaboletos/enums/TipoEnvioRest.java +++ b/src/com/rjconsultores/ventaboletos/enums/TipoEnvioRest.java @@ -2,5 +2,8 @@ package com.rjconsultores.ventaboletos.enums; public enum TipoEnvioRest { GET, - POST; + POST, + PUT, + DELETE, + ; } diff --git a/src/com/rjconsultores/ventaboletos/enums/TipoFormapago.java b/src/com/rjconsultores/ventaboletos/enums/TipoFormapago.java index 02b49ed9f..3d2abd24f 100644 --- a/src/com/rjconsultores/ventaboletos/enums/TipoFormapago.java +++ b/src/com/rjconsultores/ventaboletos/enums/TipoFormapago.java @@ -22,6 +22,7 @@ public enum TipoFormapago { TPI(15, Labels.getLabel("editarFormaPagoController.lblTPI.label")), MOBIPIX(16,Labels.getLabel("editarFormaPagoController.lblMobiPix.label")), ADYEN(17,Labels.getLabel("editarFormaPagoController.lblAdyen.label")), + MERCADO_PAGO(18,Labels.getLabel("editarFormaPagoController.lblMercadoPago.label")), ; private Integer valor; diff --git a/src/com/rjconsultores/ventaboletos/rest/generic/GenericRest.java b/src/com/rjconsultores/ventaboletos/rest/generic/GenericRest.java new file mode 100644 index 000000000..f37e447bd --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/rest/generic/GenericRest.java @@ -0,0 +1,147 @@ +package com.rjconsultores.ventaboletos.rest.generic; + +import java.lang.reflect.Type; +import java.net.URLEncoder; +import java.nio.charset.Charset; +import java.util.HashMap; +import java.util.Map; + +import org.apache.http.HttpResponse; +import org.apache.http.HttpStatus; +import org.apache.http.client.HttpClient; +import org.apache.http.client.methods.HttpDelete; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.client.methods.HttpPut; +import org.apache.http.client.methods.HttpUriRequest; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.util.EntityUtils; +import org.apache.log4j.Logger; + +import com.google.gson.Gson; +import com.rjconsultores.ventaboletos.enums.TipoEnvioRest; + +public class GenericRest { + + private static Logger log = Logger.getLogger(GenericRest.class); + + private static GenericRest instance; + + public static synchronized GenericRest getInstance() { + if (instance == null) { + instance = new GenericRest(); + } + return instance; + } + + @SuppressWarnings({ "rawtypes", "unchecked" }) + public RetornoGenericRest fazerChamada(String uri, TipoEnvioRest metodo, String parametro, + ContentType contentType, HashMap headers, Class targetClassType, Class errorClass) + throws Exception { + + HttpClient client = HttpClientBuilder.create().build(); + + HttpUriRequest request = retornaRequestWithHeader(uri, metodo, parametro, contentType, headers); + + HttpResponse response = client.execute(request); + + RetornoGenericRest retorno = new RetornoGenericRest(); + retorno.setStatusResposta(response.getStatusLine().getStatusCode()); + retorno.setMensagemResposta(response.getStatusLine().getReasonPhrase()); + + log.info(String.format("httpStatusCode: %s ", response.getStatusLine().getStatusCode())); + + if (response.getEntity() != null) { + + String entity = EntityUtils.toString(response.getEntity()); + + if (retorno.getStatusResposta() == HttpStatus.SC_OK + || retorno.getStatusResposta() == HttpStatus.SC_CREATED) { + if (targetClassType != null) { + retorno.setConteudo(new Gson().fromJson(entity, targetClassType)); + } + } else { + retorno.setConteudoErro(new Gson().fromJson(entity, errorClass)); + } + + return retorno; + } + return null; + } + + @SuppressWarnings({ "rawtypes", "unchecked" }) + public RetornoGenericRest fazerChamada(String uri, TipoEnvioRest metodo, String parametro, + ContentType contentType, HashMap headers, Type targetType, Class errorClass) + throws Exception { + + HttpClient client = HttpClientBuilder.create().build(); + + HttpUriRequest request = retornaRequestWithHeader(uri, metodo, parametro, contentType, headers); + + HttpResponse response = client.execute(request); + + RetornoGenericRest retorno = new RetornoGenericRest(); + retorno.setStatusResposta(response.getStatusLine().getStatusCode()); + retorno.setMensagemResposta(response.getStatusLine().getReasonPhrase()); + + log.info(String.format("httpStatusCode: %s ", response.getStatusLine().getStatusCode())); + + if (response.getEntity() != null) { + String entity = EntityUtils.toString(response.getEntity()); + + if (retorno.getStatusResposta() == HttpStatus.SC_OK + || retorno.getStatusResposta() == HttpStatus.SC_CREATED) { + if (targetType != null) { + retorno.setConteudo(new Gson().fromJson(entity, targetType)); + } + } else { + retorno.setConteudoErro(new Gson().fromJson(entity, errorClass)); + } + + return retorno; + } + return null; + } + + private HttpUriRequest retornaRequestWithHeader(String uri, TipoEnvioRest metodo, String parametro, + ContentType contentType, HashMap headers) throws Exception { + HttpUriRequest request = new HttpPost(uri); + StringEntity body = new StringEntity(parametro != null ? parametro : ""); + + if (TipoEnvioRest.GET.equals(metodo)) { + request = new HttpGet(parametro != null + ? montarUrlRequest(uri, URLEncoder.encode(parametro, Charset.forName("UTF-8").displayName())) + : uri); + } else if (TipoEnvioRest.POST.equals(metodo)) { + request = new HttpPost(uri); + ((HttpPost) request).setEntity(body); + } else if (TipoEnvioRest.DELETE.equals(metodo)) { + request = new HttpDelete(montarUrlRequest(uri, parametro)); + } else if (TipoEnvioRest.PUT.equals(metodo)) { + request = new HttpPut(montarUrlRequest(uri, parametro)); + } else { + throw new Exception("No request type especified."); + } + + for (Map.Entry entry : headers.entrySet()) { + String key = entry.getKey(); + String value = entry.getValue(); + request.addHeader(key, value); + } + + return request; + } + + private String montarUrlRequest(String url, String path) { + + url = url.toLowerCase(); + + if (!url.endsWith("/")) { + url += "/"; + } + + return url.concat(path); + } +} diff --git a/src/com/rjconsultores/ventaboletos/rest/generic/RetornoGenericRest.java b/src/com/rjconsultores/ventaboletos/rest/generic/RetornoGenericRest.java new file mode 100644 index 000000000..7bdbb2a1e --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/rest/generic/RetornoGenericRest.java @@ -0,0 +1,42 @@ +package com.rjconsultores.ventaboletos.rest.generic; + +public class RetornoGenericRest { + + private T conteudo; + private Integer statusResposta; + private String mensagemResposta; + private T conteudoErro; + + public Integer getStatusResposta() { + return statusResposta; + } + + public void setStatusResposta(Integer statusResposta) { + this.statusResposta = statusResposta; + } + + public String getMensagemResposta() { + return mensagemResposta; + } + + public void setMensagemResposta(String mensagemResposta) { + this.mensagemResposta = mensagemResposta; + } + + public T getConteudo() { + return conteudo; + } + + public void setConteudo(T conteudo) { + this.conteudo = conteudo; + } + + public T getConteudoErro() { + return conteudoErro; + } + + public void setConteudoErro(T conteudoErro) { + this.conteudoErro = conteudoErro; + } + +} diff --git a/src/com/rjconsultores/ventaboletos/service/EmpresaMercadoPagoConfigService.java b/src/com/rjconsultores/ventaboletos/service/EmpresaMercadoPagoConfigService.java new file mode 100644 index 000000000..73fcb9ea4 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/EmpresaMercadoPagoConfigService.java @@ -0,0 +1,9 @@ +package com.rjconsultores.ventaboletos.service; + +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.EmpresaMercadoPagoConfig; + +public interface EmpresaMercadoPagoConfigService extends GenericService { + + public EmpresaMercadoPagoConfig buscarPorEmpresa(Empresa empresa); +} diff --git a/src/com/rjconsultores/ventaboletos/service/impl/EmpresaAdyenConfigServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/EmpresaAdyenConfigServiceImpl.java index 4e3f16942..24167a78c 100644 --- a/src/com/rjconsultores/ventaboletos/service/impl/EmpresaAdyenConfigServiceImpl.java +++ b/src/com/rjconsultores/ventaboletos/service/impl/EmpresaAdyenConfigServiceImpl.java @@ -10,7 +10,6 @@ import org.springframework.transaction.annotation.Transactional; import com.rjconsultores.ventaboletos.dao.EmpresaAdyenConfigDAO; import com.rjconsultores.ventaboletos.entidad.Empresa; import com.rjconsultores.ventaboletos.entidad.EmpresaAdyenConfig; -import com.rjconsultores.ventaboletos.entidad.EmpresaEmailConfig; import com.rjconsultores.ventaboletos.service.EmpresaAdyenConfigService; import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; diff --git a/src/com/rjconsultores/ventaboletos/service/impl/EmpresaMercadoPagoConfigServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/EmpresaMercadoPagoConfigServiceImpl.java new file mode 100644 index 000000000..73333ed55 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/service/impl/EmpresaMercadoPagoConfigServiceImpl.java @@ -0,0 +1,68 @@ +package com.rjconsultores.ventaboletos.service.impl; + +import java.util.Calendar; +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.rjconsultores.ventaboletos.dao.EmpresaMercadoPagoConfigDAO; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.EmpresaMercadoPagoConfig; +import com.rjconsultores.ventaboletos.service.EmpresaMercadoPagoConfigService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; + +@Service("empresaMercadoPagoConfigService") +public class EmpresaMercadoPagoConfigServiceImpl implements EmpresaMercadoPagoConfigService { + + @Autowired + private EmpresaMercadoPagoConfigDAO empresaMercadoPagoConfigDAO; + + @Override + public List obtenerTodos() { + return empresaMercadoPagoConfigDAO.obtenerTodos(); + } + + @Override + public EmpresaMercadoPagoConfig obtenerID(Integer id) { + return empresaMercadoPagoConfigDAO.obtenerID(id); + } + + @Override + @Transactional + public EmpresaMercadoPagoConfig suscribir(EmpresaMercadoPagoConfig entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return empresaMercadoPagoConfigDAO.suscribir(entidad); + } + + @Override + @Transactional + public EmpresaMercadoPagoConfig actualizacion(EmpresaMercadoPagoConfig entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.TRUE); + + return empresaMercadoPagoConfigDAO.actualizacion(entidad); + } + + @Override + @Transactional + public void borrar(EmpresaMercadoPagoConfig entidad) { + entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + entidad.setFecmodif(Calendar.getInstance().getTime()); + entidad.setActivo(Boolean.FALSE); + + empresaMercadoPagoConfigDAO.actualizacion(entidad); + + } + + @Override + public EmpresaMercadoPagoConfig buscarPorEmpresa(Empresa empresa) { + return empresaMercadoPagoConfigDAO.buscarPorEmpresa(empresa); + } + +} diff --git a/src/com/rjconsultores/ventaboletos/vo/mercadopago/PosVO.java b/src/com/rjconsultores/ventaboletos/vo/mercadopago/PosVO.java new file mode 100644 index 000000000..0319f1b02 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/vo/mercadopago/PosVO.java @@ -0,0 +1,74 @@ +package com.rjconsultores.ventaboletos.vo.mercadopago; + +public class PosVO extends RetornoErro { + + private String id; + private String name; + private boolean fixed_amount; + private String store_id; + private String external_store_id; + private String external_id; + private Integer category; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public boolean isFixed_amount() { + return fixed_amount; + } + + public void setFixed_amount(boolean fixed_amount) { + this.fixed_amount = fixed_amount; + } + + public String getStore_id() { + return store_id; + } + + public void setStore_id(String store_id) { + this.store_id = store_id; + } + + public String getExternal_store_id() { + return external_store_id; + } + + public void setExternal_store_id(String external_store_id) { + this.external_store_id = external_store_id; + } + + public String getExternal_id() { + return external_id; + } + + public void setExternal_id(String external_id) { + this.external_id = external_id; + } + + public Integer getCategory() { + return category; + } + + public void setCategory(Integer category) { + this.category = category; + } + + @Override + public String toString() { + return this.getExternal_id(); + } + +} diff --git a/src/com/rjconsultores/ventaboletos/vo/mercadopago/RetornoErro.java b/src/com/rjconsultores/ventaboletos/vo/mercadopago/RetornoErro.java new file mode 100644 index 000000000..823efbde7 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/vo/mercadopago/RetornoErro.java @@ -0,0 +1,33 @@ +package com.rjconsultores.ventaboletos.vo.mercadopago; + +public class RetornoErro { + + public int statusCode; + public Object message; + public String error; + + public int getStatusCode() { + return statusCode; + } + + public void setStatusCode(int statusCode) { + this.statusCode = statusCode; + } + + public Object getMessage() { + return message; + } + + public void setMessage(Object message) { + this.message = message; + } + + public String getError() { + return error; + } + + public void setError(String error) { + this.error = error; + } + +} diff --git a/src/com/rjconsultores/ventaboletos/vo/mercadopago/RetornoPosVO.java b/src/com/rjconsultores/ventaboletos/vo/mercadopago/RetornoPosVO.java new file mode 100644 index 000000000..7e2acd1a8 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/vo/mercadopago/RetornoPosVO.java @@ -0,0 +1,57 @@ +package com.rjconsultores.ventaboletos.vo.mercadopago; + +import java.util.ArrayList; + +public class RetornoPosVO { + + private Paging paging; + private ArrayList results; + + public Paging getPaging() { + return paging; + } + + public void setPaging(Paging paging) { + this.paging = paging; + } + + public ArrayList getResults() { + return results; + } + + public void setResults(ArrayList results) { + this.results = results; + } + + public static class Paging { + private Integer total; + private Integer offset; + private Integer limit; + + public Integer getTotal() { + return total; + } + + public void setTotal(Integer total) { + this.total = total; + } + + public Integer getOffset() { + return offset; + } + + public void setOffset(Integer offset) { + this.offset = offset; + } + + public Integer getLimit() { + return limit; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + + } + +} diff --git a/src/com/rjconsultores/ventaboletos/vo/mercadopago/RetornoStoreVO.java b/src/com/rjconsultores/ventaboletos/vo/mercadopago/RetornoStoreVO.java new file mode 100644 index 000000000..6d67f3e38 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/vo/mercadopago/RetornoStoreVO.java @@ -0,0 +1,57 @@ +package com.rjconsultores.ventaboletos.vo.mercadopago; + +import java.util.ArrayList; + +public class RetornoStoreVO { + + private Paging paging; + private ArrayList results; + + public Paging getPaging() { + return paging; + } + + public void setPaging(Paging paging) { + this.paging = paging; + } + + public ArrayList getResults() { + return results; + } + + public void setResults(ArrayList results) { + this.results = results; + } + + public static class Paging { + private Integer total; + private Integer offset; + private Integer limit; + + public Integer getTotal() { + return total; + } + + public void setTotal(Integer total) { + this.total = total; + } + + public Integer getOffset() { + return offset; + } + + public void setOffset(Integer offset) { + this.offset = offset; + } + + public Integer getLimit() { + return limit; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + + } + +} diff --git a/src/com/rjconsultores/ventaboletos/vo/mercadopago/StoreVO.java b/src/com/rjconsultores/ventaboletos/vo/mercadopago/StoreVO.java new file mode 100644 index 000000000..6159db858 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/vo/mercadopago/StoreVO.java @@ -0,0 +1,114 @@ +package com.rjconsultores.ventaboletos.vo.mercadopago; + +public class StoreVO extends RetornoErro { + + private String id; + private String name; + private String external_id; + private Location location; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getExternal_id() { + return external_id; + } + + public void setExternal_id(String external_id) { + this.external_id = external_id; + } + + public Location getLocation() { + return location; + } + + public void setLocation(Location location) { + this.location = location; + } + + public static class Location { + private String street_number; + private String street_name; + private String city_name; + private String state_name; + private Float latitude; + private Float longitude; + private String reference; + + public String getStreet_number() { + return street_number; + } + + public void setStreet_number(String street_number) { + this.street_number = street_number; + } + + public String getStreet_name() { + return street_name; + } + + public void setStreet_name(String street_name) { + this.street_name = street_name; + } + + public String getCity_name() { + return city_name; + } + + public void setCity_name(String city_name) { + this.city_name = city_name; + } + + public String getState_name() { + return state_name; + } + + public void setState_name(String state_name) { + this.state_name = state_name; + } + + public Float getLatitude() { + return latitude; + } + + public void setLatitude(Float latitude) { + this.latitude = latitude; + } + + public Float getLongitude() { + return longitude; + } + + public void setLongitude(Float longitude) { + this.longitude = longitude; + } + + public String getReference() { + return reference; + } + + public void setReference(String reference) { + this.reference = reference; + } + + } + + @Override + public String toString() { + return this.getExternal_id(); + } + +}