intento meter paymetntez

This commit is contained in:
cruales 2022-08-09 11:50:13 -05:00
parent 28d6be7f4c
commit f8f8572e5b
1326 changed files with 256 additions and 38743 deletions

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Fri Aug 05 12:43:19 ECT 2022
#Tue Aug 09 10:23:45 ECT 2022
version=2.1
groupId=com.fp.base.bpm
artifactId=bpmlib

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Fri Aug 05 12:43:14 ECT 2022
#Tue Aug 09 10:23:38 ECT 2022
version=2.1
groupId=com.fp.base.bpm
artifactId=simple

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Fri Aug 05 12:43:39 ECT 2022
#Tue Aug 09 10:24:07 ECT 2022
version=2.1
groupId=com.fp.base.business
artifactId=armas

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Fri Aug 05 12:43:33 ECT 2022
#Tue Aug 09 10:24:00 ECT 2022
version=2.1
groupId=com.fp.base.business
artifactId=general

Binary file not shown.

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Fri Aug 05 12:43:35 ECT 2022
#Tue Aug 09 10:24:02 ECT 2022
version=2.1
groupId=com.fp.base.business
artifactId=log

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Fri Aug 05 12:43:30 ECT 2022
#Tue Aug 09 10:23:57 ECT 2022
version=2.1
groupId=com.fp.base.business
artifactId=person

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Fri Aug 05 12:43:34 ECT 2022
#Tue Aug 09 10:24:01 ECT 2022
version=2.1
groupId=com.fp.base.business
artifactId=report

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Fri Aug 05 12:43:36 ECT 2022
#Tue Aug 09 10:24:04 ECT 2022
version=2.1
groupId=com.fp.base.business
artifactId=viaticos

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Fri Aug 05 12:43:27 ECT 2022
#Tue Aug 09 10:23:54 ECT 2022
version=2.1
groupId=com.fp.base.core
artifactId=alfresco-client

Binary file not shown.

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Fri Aug 05 12:43:16 ECT 2022
#Tue Aug 09 10:23:40 ECT 2022
version=2.1
groupId=com.fp.base.core
artifactId=bpm

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Fri Aug 05 12:43:26 ECT 2022
#Tue Aug 09 10:23:52 ECT 2022
version=2.1
groupId=com.fp.base.core
artifactId=firmas

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Fri Aug 05 12:43:02 ECT 2022
#Tue Aug 09 10:23:25 ECT 2022
version=2.1
groupId=com.fp.base.dto
artifactId=common

Binary file not shown.

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Fri Aug 05 12:42:59 ECT 2022
#Tue Aug 09 10:23:22 ECT 2022
version=2.1
groupId=com.fp.base.dto
artifactId=dto

Binary file not shown.

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Fri Aug 05 12:43:41 ECT 2022
#Tue Aug 09 10:24:09 ECT 2022
version=2.1
groupId=com.fp.base
artifactId=facade

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Fri Aug 05 12:43:40 ECT 2022
#Tue Aug 09 10:24:07 ECT 2022
version=2.1
groupId=com.fp.base
artifactId=facadeclient

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Fri Aug 05 12:43:10 ECT 2022
#Tue Aug 09 10:23:34 ECT 2022
version=2.1
groupId=com.fp.base.persistence
artifactId=commondb

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Fri Aug 05 12:43:25 ECT 2022
#Tue Aug 09 10:23:51 ECT 2022
version=2.1
groupId=com.fp.base.persistence
artifactId=parmas

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Fri Aug 05 12:43:03 ECT 2022
#Tue Aug 09 10:23:26 ECT 2022
version=2.1
groupId=com.fp.base.persistence
artifactId=pbpm

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Fri Aug 05 12:43:12 ECT 2022
#Tue Aug 09 10:23:36 ECT 2022
version=2.1
groupId=com.fp.base.persistence
artifactId=pcustomer

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Fri Aug 05 12:43:22 ECT 2022
#Tue Aug 09 10:23:48 ECT 2022
version=2.1
groupId=com.fp.base.persistence
artifactId=pfirmas

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Fri Aug 05 12:43:08 ECT 2022
#Tue Aug 09 10:23:32 ECT 2022
version=2.1
groupId=com.fp.base.persistence
artifactId=pgeneral

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Fri Aug 05 12:43:20 ECT 2022
#Tue Aug 09 10:23:46 ECT 2022
version=2.1
groupId=com.fp.base.persistence
artifactId=plog

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Fri Aug 05 12:43:21 ECT 2022
#Tue Aug 09 10:23:47 ECT 2022
version=2.1
groupId=com.fp.base.persistence
artifactId=pviaticos

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Fri Aug 05 12:43:13 ECT 2022
#Tue Aug 09 10:23:37 ECT 2022
version=2.1
groupId=com.fp.base.persistence
artifactId=util

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Fri Aug 05 12:43:28 ECT 2022
#Tue Aug 09 10:23:55 ECT 2022
version=2.1
groupId=com.fp.base
artifactId=sessionbeans

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Fri Aug 05 12:43:41 ECT 2022
#Tue Aug 09 10:24:09 ECT 2022
version=2.1
groupId=com.fp.clients.maia
artifactId=maiaear

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Fri Aug 05 12:43:41 ECT 2022
#Tue Aug 09 10:24:09 ECT 2022
version=2.1
groupId=com.fp.clients.maia
artifactId=environment-eap6

View File

@ -14,5 +14,6 @@ That way multiple projects can share the same settings (useful for formatting ru
Any value defined here will override the pom.xml file value but is only applicable to the current project.
-->
<org-netbeans-modules-maven-jaxws.rest_2e_config_2e_type>ide</org-netbeans-modules-maven-jaxws.rest_2e_config_2e_type>
<netbeans.hint.jdkPlatform>JDK_1.7</netbeans.hint.jdkPlatform>
</properties>
</project-shared-configuration>

View File

@ -78,7 +78,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>5.0.8</version>
<version>5.1</version>
</dependency>
<dependency>
<groupId>org.primefaces.extensions</groupId>
@ -100,6 +100,11 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
<artifactId>json-lib</artifactId>
<version>2.2.3</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>3.2.0</version>
</dependency>
</dependencies>
</dependencyManagement>

View File

@ -97,11 +97,17 @@ public class LoginController
this.captchaRequerido = this.msgSecurity.getProperty("lbl_mensaje_captcha_requerido");
CallerHelper ch = new CallerHelper();
/**----------------------------- CAPTCHA -------------------------------------*/
if(!validate(FacesContext.getCurrentInstance())){
MessageHelper.setMessageError(this.captchaRequerido);
if(this.msgSecurity.getProperty("utilizar_captcha").compareTo("true") == 0 && !validate(FacesContext.getCurrentInstance())){
MessageHelper.setMessageError(this.captchaRequerido);
ExternalContext ec = FacesContext.getCurrentInstance().getExternalContext();
ec.redirect(FacesContext.getCurrentInstance().getExternalContext().
getRequestContextPath() + "/" + "login.xhtml");
// RequestContext.getCurrentInstance().execute("window.reload();");
}else{
Response resp = ch.login(this.request, user, pass);
TarmTerminos terminos = TerminosCondicionesController.findxIdentificacion(user);
if ((resp.getResponseCode().compareTo("0") == 0) && (terminos == null))
{

View File

@ -0,0 +1,177 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.fp.frontend.utility;
import com.google.gson.Gson;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ws.rs.core.Request;
import javax.xml.bind.DatatypeConverter;
import org.apache.commons.codec.binary.Hex;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.http.Header;
import org.apache.http.HeaderElement;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.ParseException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.message.BasicNameValuePair;
/**
*
* @author developer2
*/
public class Paymentez {
public static String PAYMENTEZ_DEV_URL = "https://ccapi-stg.paymentez.com";
public static String PAYMENTEZ_PROD_URL = "https://ccapi.paymentez.com";
public static final String RESPONSE_HTTP_CODE = "RESPONSE_HTTP_CODE";
public static final String RESPONSE_JSON = "RESPONSE_JSON";
//public static OkHttpClient client = new OkHttpClient();
public static final MediaType JSON = MediaType.parse("application/json; charset=utf-8");
private static String getUniqToken(String auth_timestamp, String app_secret_key) {
String uniq_token_string = app_secret_key + auth_timestamp;
return getHash(uniq_token_string);
}
public static String getAuthToken(String app_code, String app_secret_key) {
Long tsLong = System.currentTimeMillis()/1000;
String auth_timestamp = tsLong.toString();
String string_auth_token = app_code + ";" + auth_timestamp + ";" + getUniqToken(auth_timestamp, app_secret_key);
String encoded = DatatypeConverter.printBase64Binary(string_auth_token.getBytes());
String auth_token = new String(encoded);
return auth_token;
}
public static String getHash(String message) {
String sha256hex = new String(Hex.encodeHex(DigestUtils.sha256(message)));
return sha256hex;
}
public static String paymentezDebitJson(String id, String email, String ip, String session_id, String token, double amount, String dev_reference, String description) {
String session_id_row = "";
if(session_id != null && session_id != ""){
session_id_row = "\"session_id\": \"" + session_id + "\",";
}
return "{" +
session_id_row +
"\"user\": {" +
"\"id\": \"" + id + "\"," +
"\"email\": \"" + email + "\"," +
"\"ip_address\": \"" + ip + "\"" +
"}," +
"\"order\": {" +
"\"code\": \"123\"," +
"\"amount\": " + amount + "," +
"\"description\": \"" + description + "\"," +
"\"dev_reference\": \"" + dev_reference + "\"," +
"\"vat\": 0.00" +
"}," +
"\"card\": {" +
"\"token\": \"" + token + "\"" +
"}" +
"}";
}
public static String paymentezDeleteJson(String uid, String token) {
return "{" +
"\"card\": {" +
"\"token\": \"" +token + "\"" +
"}," +
"\"user\": {" +
"\"id\": \"" + uid + "\"" +
"}" +
"}";
}
public static String paymentezVerifyJson(String uid, String transaction_id, String type, String value) {
return "{" +
"\"user\": {" +
"\"id\": \"" + uid + "\"" +
"}," +
"\"transaction\": {" +
"\"id\": \"" + transaction_id + "\"" +
"}," +
"\"type\": \"" + type + "\"," +
"\"value\": \"" + value + "\"" +
"" +
"}";
}
public static Map<String, String> doSolicitudPost(String url, String json) throws UnsupportedEncodingException, IOException{
//String postUrl = "www.site.com";// put in your url
Gson gson = new Gson();
HttpClient httpClient = HttpClientBuilder.create().build();
HttpPost post = new HttpPost(url);
StringEntity postingString = new StringEntity(gson.toJson(pojo1));//gson.tojson() converts your pojo to json
post.setEntity(postingString);
post.setHeader("Content-type", "application/json");
HttpResponse response = httpClient.execute(post);
}
public static Map<String, String> doPostRequest(String url, String json){
String jsonResponse = "{}";
RequestBody body = RequestBody.create(JSON, json);
Request request = new Request.Builder()
.header("Auth-Token", Paymentez.getAuthToken(System.getenv("PAYMENTEZ_APP_SERVER_CODE"), System.getenv("PAYMENTEZ_APP_SERVER_KEY")))
.url(url)
.post(body)
.build();
Response response = null;
Map<String, String> mapResult = new HashMap<>(2);
try {
response = client.newCall(request).execute();
jsonResponse = response.body().string();
mapResult.put(RESPONSE_HTTP_CODE, ""+response.code());
mapResult.put(RESPONSE_JSON, jsonResponse);
} catch (IOException e) {
e.printStackTrace();
}
return mapResult;
}
public static Map<String, String> doGetRequest(String url){
String jsonResponse = "{}";
Request request = new Request.Builder()
.header("Auth-Token", Paymentez.getAuthToken(System.getenv("PAYMENTEZ_APP_SERVER_CODE"), System.getenv("PAYMENTEZ_APP_SERVER_KEY")))
.url(url)
.build();
Response response = null;
Map<String, String> mapResult = new HashMap<>(2);
try {
response = client.newCall(request).execute();
jsonResponse = response.body().string();
mapResult.put(RESPONSE_HTTP_CODE, ""+response.code());
mapResult.put(RESPONSE_JSON, jsonResponse);
} catch (IOException e) {
e.printStackTrace();
}
return mapResult;
}
}

View File

@ -30,6 +30,7 @@ lbl_heleido_terminos=He le\u00eddo y acepto los t\u00e9rminos y condiciones de u
lbl_descarga_terminos=Descargue sus t\u00e9rminos y condiciones
lbl_aceptar_terminos=Aceptar t\u00e9rminos y condiciones
# Captcha
utilizar_captcha=false
lbl_mensaje_captcha_requerido=Error: reCaptcha obligatorio
captcha_secret_key=6LcnsDohAAAAADSPzWsuG5LPIfLPr-Gaeg-BzMB_
captcha_public_key=6LcnsDohAAAAAI0dVMpZB6BHRT1bGOlYE07U0yK3

View File

@ -5,11 +5,14 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui"
xmlns:pe="http://primefaces.org/ui/extensions"
xmlns:maia="http://java.sun.com/jsf/composite/maiaComponents">
xmlns:maia="http://java.sun.com/jsf/composite/maiaComponents"
>
<f:view locale="es">
<h:head>
<title>Control de Armas</title>
<link rel="stylesheet" type="text/css" href="#{request.contextPath}/javax.faces.resource/css/maia.css.xhtml?v=2" />
<link href="https://cdn.paymentez.com/ccapi/sdk/payment_stable.min.css" rel="stylesheet" type="text/css" />
<h:outputScript name="js/maia.js?v=1"/>
<script src="https://www.google.com/recaptcha/api.js" type="text/javascript">
$(document).ready(function(){
@ -69,23 +72,39 @@
<pe:keyFilter for="b" />
</p:password>
<p:message for="b" />
<p:outputLabel value=""/>
<div id="google-recaptcha" style="width: 100px;" class="g-recaptcha" data-sitekey="#{msg_security.captcha_public_key}" > </div>
<p:outputLabel value=""/>
<p:outputLabel value=""/>
<div style="display:#{msg_security.utilizar_captcha eq 'true' ? 'block':'none'}">
<div id="google-recaptcha" style="width: 100px;" class="g-recaptcha" data-sitekey="#{msg_security.captcha_public_key}" > </div>
</div>
<h:panelGrid columns="1" >
<p:inputText id="nombreTitular" placeholder="Nombre del titular" required="true" autocomplete="off" />
<p:inputMask placeholder="Numero de tarjeta" mask="9999 9999 9999 9999"/>
<h:panelGrid columns="2">
<p:inputMask style="width: 100px" placeholder="MM/YY" mask="99/99"/>
<p:inputMask style="width: 100px" placeholder="CVC" mask="999"/>
</h:panelGrid>
</h:panelGrid>
<p:outputLabel value=""/>
<p:outputLabel rendered="#{msg_security.utilizar_captcha ne 'true'}" value=""/>
<p:commandButton id="loginButton" value="Login"
actionListener="#{loginController.authenticate()}"
oncomplete="if(args.validationFailed){}"
process="@this, formLogin"
update="formLogin"
ajax="false"
ajax="true"
/>
<h:inputHidden id="server" value="#{loginController.request.terminalCode}"></h:inputHidden>
<p:outputLabel value=""/>
<p:outputLabel value=""/><p:outputLabel value=""/><p:outputLabel value=""/>
<a href="https://tramitesarmas.ccffaa.mil.ec/portal-web/" target="_blank"
style="color: white !important; font-size: 15px;font-weight: bold;">
¿Olvidaste tu contraseña? </a>
¿Olvidaste tu contraseña? </a>
</h:panelGrid>

View File

@ -272,7 +272,7 @@
<h:outputText value="" />
<p:outputLabel for="txtSerieLote" value="#{msg_armas.lbl_serielote}:"/>
<p:inputText id="txtSerieLote" maxlength="15" disabled="#{tramiteArmasController.armas.showRow or tramiteArmasController.deshabilitarPantalla}" value="#{tramiteArmasController.armas.record.lote}" required="true"/>
<p:inputText id="txtSerieLote" maxlength="50" disabled="#{tramiteArmasController.armas.showRow or tramiteArmasController.deshabilitarPantalla}" value="#{tramiteArmasController.armas.record.lote}" required="true"/>
<h:outputText value="" />
<p:outputLabel for="txtSerieCanon" value="#{msg_armas.lbl_seriecanon}:"/>

View File

@ -189,7 +189,7 @@
<h:outputText value="" />
<p:outputLabel for="txtSerieLote" value="#{msg_armas.lbl_serielote}:"/>
<p:inputText id="txtSerieLote" maxlength="15" onkeyup="Maia.forceupper(event, this);" disabled="true" value="#{reporteConsultaSolicitudController.solicitudArmas.record.modifiedData['lote']}"/>
<p:inputText id="txtSerieLote" maxlength="50" onkeyup="Maia.forceupper(event, this);" disabled="true" value="#{reporteConsultaSolicitudController.solicitudArmas.record.modifiedData['lote']}"/>
<h:outputText value="" />
<p:outputLabel for="txtSerieCanon" value="#{msg_armas.lbl_seriecanon}:"/>

Some files were not shown because too many files have changed in this diff Show More