Encriptado del payload

Método requerido para la encriptación de los datos que seran enviados en el cuerpo de los métodos de autenticación y pago con tarjeta de crédito

https://apiq.finhack.in/api/pay/enkey

POST

Content-Type: application/x-www-form-urlencoded

{
    "key": "STRING", Llave de cifrado suministrada para uso del servicio
    "data": {
        "doc_id": INTEGER, Número de cédula del tarjeta habiente.
        "full_name": "STRING", Nombre del tarjeta habiente.
        "card_number": INTEGER, Número de tarjeta de crédito.
        "expired_date": "STRING", Fecha de vencimiento (AAAA/MM).
        "cvv": INTEGER, Código de seguridad de la TDC.
        "monto_compra": INTEGER, Monto de la operación.
        "email": "STRING", Correo electrónico del tarjeta habiente.
        "ip_usuario": "STRING", IP del dispositivo que consume el servicio.
        "compra_id": INTEGER, Identificador del producto o servicio.
        "concepto": ["Array STRING"], Concepto de la operación.
        "card_type": "STRING" Tipo de TDC (Visa, Master)
    }
}
Pago con tarjetas de crédito

Método requerido para realizar el pago con tarjeta de crédito

https://apiq.finhack.in/api/pay/TDC

POST

Content-Type: application/x-www-form-urlencoded

{
    "encriptado": "STRING", Datos del body cifrados.
    "codigo_tienda": "STRING", Código de tienda suministrado para uso del servicio.
}

    var client = new RestClient("https://apiq.finhack.in/api/pay/enkey");
    client.Timeout = -1;
    var request = new RestRequest(Method.POST);
    request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
    request.AddParameter("data[doc_id]", "00000000");
    request.AddParameter("data[full_name]", "ALIXON R BETANCOURT F");
    request.AddParameter("data[card_number]", "4521000001234567");
    request.AddParameter("data[expired_date]", "2024/08");
    request.AddParameter("data[cvv]", "000");
    request.AddParameter("data[monto_compra]", "25000");
    request.AddParameter("data[email]", "[email protected]");
    request.AddParameter("data[ip_usuario]", "127.0.0.1");
    request.AddParameter("data[compra_id]", "1");
    request.AddParameter("key", "payr3st$andbox2020");
    request.AddParameter("data[concepto][]", "Compra");
    request.AddParameter("data[card_type]", "Visa");
    IRestResponse response = client.Execute(request);
    Console.WriteLine(response.Content);
                            
    {
       "message": "Datos encriptados",
       "encriptado":
          "eyJlbmNyeXB0ZWRfZGF0YSI6IjNYSmtydThLeFg2aUF1Y0ZXeFNZMkZZRFhYb0p2
          UVU1U3lJanUrS3BnSDRSc2NuUGs1VDFhQTNWZVwvRStpcjUybmk3Zm9ZU3BwdThjU
          GVkTTJ3YXowaW9iV29LNkNpbDVuZm0xd0N2QzdjNU9TMzJMTzE2Mzh5MFwvVm5LSm
          dDOEJXTHdlTCtaU0VodVM3b3pqQlozd1FNWno2aStTamFvUmVnUnM1MzdTeDlrYzA
          yREJsbU5ESlU2aHFBUlVcL2o4SGlcL1NTaGpmbFV3V1wvY1hBQnVqcm1wMjVDS2hM
          bFpBY212d3FUOTIzREJpUCtaRmFwNHMzcXprTk9BNEJQbDM4Um5HbVd3Yk1qcHBjO
          TlpREwxRE9yTEVmMTFXb1p3VFozd2hzb3dTaHZjVnBTekJFZW9EbjMwbnBETmFMS1
          wvXC9ra0x2UTlwcGsxRUdGTXZDb1JsZWRmR0U4QlFYQk95VjNheGFpQStFTzIybHF
          cL2t0UURraWZmaVlMc2Z2ajl3MjBiVXVoYkVoaWQxMU1NUWNuVTVCaXg0em5mK0Rh
          Rm9xRWdnMmxuTG1cL1RaK2xYaHN2dE5kT1Brd0g1cEN6dDlqR01BQmVCcGFxak40M
          Hg5NlwveFUrQjNSTUkwWlBnMEtzT2FkSjIwQnhNMFlodz0iLCJpdiI6IlVHTUhcL3
          kyTVh5ejlITWZVV3lMU1pRPT0ifQ=="
    }
                            
    var client = new RestClient("https://apiq.finhack.in/api/pay/TDC");
    client.Timeout = -1;
    var request = new RestRequest(Method.POST);
    request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
    request.AddParameter("encriptado", "eyJlbmNyeXB0ZWRfZGF0YSI6InRDZ090Q1pCR
       DdyTVRwbFJxUmZvakU3bllCTVg4SjlFMVloelUrXC9YcUgxVmZ2R1hVbSt4SEZINmVsbGFLcW
       ZiT1BcL3oxNTFnUEtmeHh2em5MQjQ0YkVhblMwbm1uVExsMlFBS1ppSytLbDF0UlwvXC9DYjd
       ocmRkNVZzVXpwazhUN2J0NHcxR3htWGhaRUZYZlhKN29Gd0c1elZoUGpWTXBLelwvanc1c1ZP
       TU5XRVdvYXJ4WFBwTzVHT1owMDNVKzZHaFJOc3RCckVkSDZqMUNlejRcL1wvd3pnNjFNMGkzb
       XhyaEhIT3BmbldFQ1h6YkF2SHZwMU5Pd2g0SENjQWZRcVpqUUR2QlIwV2NxV1ZOaXVFUWMyQ2
       hcL2ZQbGJvQmxxbFhZNlZCanVodnlTUzBYSjMzNitXRlBjNFlXNXhSZGJzanZ3RklnajY3Sll
       ESlluY2VoS0M1UTBLOE9pQWhTM2Z1VkJMNFNpemRwMUVQbFltTmVQMk16TW9xQW4zNVdtYWtW
       RzhZZHZqXC9SdzU4MXREd3FOc1Z0WGc5b09McDlVU3FBQWljN2NaR2p0XC9NYUxDbFlUNTMyU
       zBhc3NKXC9id1Q2QU9TV2FQd2cyNHBXTzkwbUVHeWpTbWpWbXdNWVdwK1ZSaWR1NVNSSk53NW
       9TV1hqZStZTTY3YUlGek5sNXRjTmsiLCJpdiI6IllORzRIOVA2dlp3QituRnl2aTVVRUE9PS
       J9");
    request.AddParameter("codigo_tienda", "TESTUSER");
    IRestResponse response = client.Execute(request);
    Console.WriteLine(response.Content);
                            
    {
       "message": "Pago Exitoso",
       "monto_recibido": "25000",
       "sigla_cliente": "TESTUSER",
       "numero_confirmacion": "007556",
       "numero_factura": "1120210122111056",
       "recibo": {
           "numero_confirmacion": "007556",
           "numero_factura": "1120210122111056"
       },
       "fecha_salida": "2021-01-22",
       "hora_salida": "19:10:56",
       "intentos": 1,
       "codigo_respuesta": 2
    }
                            
    OkHttpClient client = new OkHttpClient().newBuilder()
    .build();
    MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
    RequestBody body = RequestBody.create(
           mediaType, "data[doc_id]=00000000&data[full_name]=ALIXON R BETANCOURT F&
           data[card_number]=4521000001234567&data[expired_date]=2024/08&
           data[cvv]=000&data[monto_compra]=25000&data[email][email protected]&
           data[ip_usuario]=127.0.0.1&data[compra_id]=1&key=payr3st$andbox2020&
           data[concepto][]=Compra&data[card_type]=Visa"
        );
    Request request = new Request.Builder()
    .url("https://apiq.finhack.in/api/pay/enkey")
    .method("POST", body)
    .addHeader("Content-Type", "application/x-www-form-urlencoded")
    .build();
    Response response = client.newCall(request).execute();
                            
    {
       "message": "Datos encriptados",
       "encriptado":
           "eyJlbmNyeXB0ZWRfZGF0YSI6IjNYSmtydThLeFg2aUF1Y0ZXeFNZMkZZRFhYb0p2
           UVU1U3lJanUrS3BnSDRSc2NuUGs1VDFhQTNWZVwvRStpcjUybmk3Zm9ZU3BwdThjU
           GVkTTJ3YXowaW9iV29LNkNpbDVuZm0xd0N2QzdjNU9TMzJMTzE2Mzh5MFwvVm5LSm
           dDOEJXTHdlTCtaU0VodVM3b3pqQlozd1FNWno2aStTamFvUmVnUnM1MzdTeDlrYzA
           yREJsbU5ESlU2aHFBUlVcL2o4SGlcL1NTaGpmbFV3V1wvY1hBQnVqcm1wMjVDS2hM
           bFpBY212d3FUOTIzREJpUCtaRmFwNHMzcXprTk9BNEJQbDM4Um5HbVd3Yk1qcHBjO
           TlpREwxRE9yTEVmMTFXb1p3VFozd2hzb3dTaHZjVnBTekJFZW9EbjMwbnBETmFMS1
           wvXC9ra0x2UTlwcGsxRUdGTXZDb1JsZWRmR0U4QlFYQk95VjNheGFpQStFTzIybHF
           cL2t0UURraWZmaVlMc2Z2ajl3MjBiVXVoYkVoaWQxMU1NUWNuVTVCaXg0em5mK0Rh
           Rm9xRWdnMmxuTG1cL1RaK2xYaHN2dE5kT1Brd0g1cEN6dDlqR01BQmVCcGFxak40M
           Hg5NlwveFUrQjNSTUkwWlBnMEtzT2FkSjIwQnhNMFlodz0iLCJpdiI6IlVHTUhcL3
           kyTVh5ejlITWZVV3lMU1pRPT0ifQ=="
       }
    }
                            
    OkHttpClient client = new OkHttpClient().newBuilder()
    .build();
    MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
    RequestBody body = RequestBody.create(
        mediaType, "encriptado=eyJlbmNyeXB0ZWRfZGF0YSI6IjNYSmtydThLeFg2aUF1Y
           0ZXeFNZMkZZRFhYb0p2UVU1U3lJanUrS3BnSDRSc2NuUGs1VDFhQTNWZVwvRStpcjUyb
           mk3Zm9ZU3BwdThjUGVkTTJ3YXowaW9iV29LNkNpbDVuZm0xd0N2QzdjNU9TMzJMTzE2M
           zh5MFwvVm5LSmdDOEJXTHdlTCtaU0VodVM3b3pqQlozd1FNWno2aStTamFvUmVnUnM1M
           zdTeDlrYzAyREJsbU5ESlU2aHFBUlVcL2o4SGlcL1NTaGpmbFV3V1wvY1hBQnVqcm1wM
           jVDS2hMbFpBY212d3FUOTIzREJpUCtaRmFwNHMzcXprTk9BNEJQbDM4Um5HbVd3Yk1qc
           HBjOTlpREwxRE9yTEVmMTFXb1p3VFozd2hzb3dTaHZjVnBTekJFZW9EbjMwbnBETmFMS
           1wvXC9ra0x2UTlwcGsxRUdGTXZDb1JsZWRmR0U4QlFYQk95VjNheGFpQStFTzIybHFcL
           2t0UURraWZmaVlMc2Z2ajl3MjBiVXVoYkVoaWQxMU1NUWNuVTVCaXg0em5mK0RhRm9xR
           WdnMmxuTG1cL1RaK2xYaHN2dE5kT1Brd0g1cEN6dDlqR01BQmVCcGFxak40MHg5Nlwve
           FUrQjNSTUkwWlBnMEtzT2FkSjIwQnhNMFlodz0iLCJpdiI6IlVHTUhcL3kyTVh5ejlIT
           WZVV3lMU1pRPT0ifQ==&codigo_tienda=TESTUSER"
        );
    Request request = new Request.Builder()
    .url("https://apiq.finhack.in/api/pay/TDC")
    .method("POST", body)
    .addHeader("Content-Type", "application/x-www-form-urlencoded")
    .build();
    Response response = client.newCall(request).execute();
                            
{
   "message": "Pago Exitoso",
   "monto_recibido": "25000",
   "sigla_cliente": "TESTUSER",
   "numero_confirmacion": "007556",
   "numero_factura": "1120210122111056",
   "recibo": {
       "numero_confirmacion": "007556",
       "numero_factura": "1120210122111056"
   },
   "fecha_salida": "2021-01-22",
   "hora_salida": "19:10:56",
   "intentos": 1,
   "codigo_respuesta": 2
}
                            
    var request = require('request');
    var options = {
        'method': 'POST',
        'url': 'https://apiq.finhack.in/api/pay/enkey',
        'headers': {
        'Content-Type': 'application/x-www-form-urlencoded'
        },
        form: {
        'data[doc_id]': '00000000',
        'data[full_name]': 'ALIXON R BETANCOURT F',
        'data[card_number]': '4521000001234567',
        'data[expired_date]': '2024/08',
        'data[cvv]': '000',
        'data[monto_compra]': '25000',
        'data[email]': '[email protected]',
        'data[ip_usuario]': '127.0.0.1',
        'data[compra_id]': '1',
        'key': 'payr3st$andbox2020',
        'data[concepto][]': 'Compra',
        'data[card_type]': 'Visa'
        }
    };
    request(options, function (error, response) {
        if (error) throw new Error(error);
        console.log(response.body);
    });

                            
{
   "message": "Datos encriptados",
   "encriptado":
       "eyJlbmNyeXB0ZWRfZGF0YSI6IjNYSmtydThLeFg2aUF1Y0ZXeFNZMkZZRFhYb0p2
       UVU1U3lJanUrS3BnSDRSc2NuUGs1VDFhQTNWZVwvRStpcjUybmk3Zm9ZU3BwdThjU
       GVkTTJ3YXowaW9iV29LNkNpbDVuZm0xd0N2QzdjNU9TMzJMTzE2Mzh5MFwvVm5LSm
       dDOEJXTHdlTCtaU0VodVM3b3pqQlozd1FNWno2aStTamFvUmVnUnM1MzdTeDlrYzA
       yREJsbU5ESlU2aHFBUlVcL2o4SGlcL1NTaGpmbFV3V1wvY1hBQnVqcm1wMjVDS2hM
       bFpBY212d3FUOTIzREJpUCtaRmFwNHMzcXprTk9BNEJQbDM4Um5HbVd3Yk1qcHBjO
       TlpREwxRE9yTEVmMTFXb1p3VFozd2hzb3dTaHZjVnBTekJFZW9EbjMwbnBETmFMS1
       wvXC9ra0x2UTlwcGsxRUdGTXZDb1JsZWRmR0U4QlFYQk95VjNheGFpQStFTzIybHF
       cL2t0UURraWZmaVlMc2Z2ajl3MjBiVXVoYkVoaWQxMU1NUWNuVTVCaXg0em5mK0Rh
       Rm9xRWdnMmxuTG1cL1RaK2xYaHN2dE5kT1Brd0g1cEN6dDlqR01BQmVCcGFxak40M
       Hg5NlwveFUrQjNSTUkwWlBnMEtzT2FkSjIwQnhNMFlodz0iLCJpdiI6IlVHTUhcL3
       kyTVh5ejlITWZVV3lMU1pRPT0ifQ=="
   }
}
                            
var request = require('request');
var options = {
    'method': 'POST',
    'url': 'https://apiq.finhack.in/api/pay/TDC',
    'headers': {
    'Content-Type': 'application/x-www-form-urlencoded'
    },
    form: {
    'encriptado': 'eyJlbmNyeXB0ZWRfZGF0YSI6IjNYSmtydThLeFg2aUF1Y0ZXeF
       NZMkZZRFhYb0p2UVU1U3lJanUrS3BnSDRSc2NuUGs1VDFhQTNWZVwvRStpcjUybmk
       3Zm9ZU3BwdThjUGVkTTJ3YXowaW9iV29LNkNpbDVuZm0xd0N2QzdjNU9TMzJMTzE2
       Mzh5MFwvVm5LSmdDOEJXTHdlTCtaU0VodVM3b3pqQlozd1FNWno2aStTamFvUmVnU
       nM1MzdTeDlrYzAyREJsbU5ESlU2aHFBUlVcL2o4SGlcL1NTaGpmbFV3V1wvY1hBQn
       Vqcm1wMjVDS2hMbFpBY212d3FUOTIzREJpUCtaRmFwNHMzcXprTk9BNEJQbDM4Um5
       HbVd3Yk1qcHBjOTlpREwxRE9yTEVmMTFXb1p3VFozd2hzb3dTaHZjVnBTekJFZW9E
       bjMwbnBETmFMS1wvXC9ra0x2UTlwcGsxRUdGTXZDb1JsZWRmR0U4QlFYQk95VjNhe
       GFpQStFTzIybHFcL2t0UURraWZmaVlMc2Z2ajl3MjBiVXVoYkVoaWQxMU1NUWNuVT
       VCaXg0em5mK0RhRm9xRWdnMmxuTG1cL1RaK2xYaHN2dE5kT1Brd0g1cEN6dDlqR01
       BQmVCcGFxak40MHg5NlwveFUrQjNSTUkwWlBnMEtzT2FkSjIwQnhNMFlodz0iLCJp
       diI6IlVHTUhcL3kyTVh5ejlITWZVV3lMU1pRPT0ifQ==',
    'codigo_tienda': 'TESTUSER'
    }
};
request(options, function (error, response) {
    if (error) throw new Error(error);
    console.log(response.body);
});


                            
{
   "message": "Pago Exitoso",
   "monto_recibido": "25000",
   "sigla_cliente": "TESTUSER",
   "numero_confirmacion": "007556",
   "numero_factura": "1120210122111056",
   "recibo": {
       "numero_confirmacion": "007556",
       "numero_factura": "1120210122111056"
   },
   "fecha_salida": "2021-01-22",
   "hora_salida": "19:10:56",
   "intentos": 1,
   "codigo_respuesta": 2
}
                            
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://apiq.finhack.in/api/pay/enkey',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => '',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS => 'data%5Bdoc_id%5D=00000000&data%5Bfull_name%5D=
       ALIXON%20R%20BETANCOURT%20F&data%5Bcard_number%5D=
       4521000001234567&data%5Bexpired_date%5D=2024/08&data%5Bcvv%5D=
       000&data%5Bmonto_compra%5D=25000&data%5Bemail%5D=
       correo%40dominio.com&data%5Bip_usuario%5D=
       127.0.0.1&data%5Bcompra_id%5D=1&key=
       payr3st%24andbox2020&data%5Bconcepto%5D%5B%5D=
       Compra&data%5Bcard_type%5D=Visa',
    CURLOPT_HTTPHEADER => array(
    'Content-Type: application/x-www-form-urlencoded'
    ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
                            
{
    "message": "Datos encriptados",
    "encriptado":
        "eyJlbmNyeXB0ZWRfZGF0YSI6IjNYSmtydThLeFg2aUF1Y0ZXeFNZMkZZRFhYb0p2
        UVU1U3lJanUrS3BnSDRSc2NuUGs1VDFhQTNWZVwvRStpcjUybmk3Zm9ZU3BwdThjU
        GVkTTJ3YXowaW9iV29LNkNpbDVuZm0xd0N2QzdjNU9TMzJMTzE2Mzh5MFwvVm5LSm
        dDOEJXTHdlTCtaU0VodVM3b3pqQlozd1FNWno2aStTamFvUmVnUnM1MzdTeDlrYzA
        yREJsbU5ESlU2aHFBUlVcL2o4SGlcL1NTaGpmbFV3V1wvY1hBQnVqcm1wMjVDS2hM
        bFpBY212d3FUOTIzREJpUCtaRmFwNHMzcXprTk9BNEJQbDM4Um5HbVd3Yk1qcHBjO
        TlpREwxRE9yTEVmMTFXb1p3VFozd2hzb3dTaHZjVnBTekJFZW9EbjMwbnBETmFMS1
        wvXC9ra0x2UTlwcGsxRUdGTXZDb1JsZWRmR0U4QlFYQk95VjNheGFpQStFTzIybHF
        cL2t0UURraWZmaVlMc2Z2ajl3MjBiVXVoYkVoaWQxMU1NUWNuVTVCaXg0em5mK0Rh
        Rm9xRWdnMmxuTG1cL1RaK2xYaHN2dE5kT1Brd0g1cEN6dDlqR01BQmVCcGFxak40M
        Hg5NlwveFUrQjNSTUkwWlBnMEtzT2FkSjIwQnhNMFlodz0iLCJpdiI6IlVHTUhcL3
        kyTVh5ejlITWZVV3lMU1pRPT0ifQ=="
    }
}
                            
    $curl = curl_init();

    curl_setopt_array($curl, array(
        CURLOPT_URL => 'https://apiq.finhack.in/api/pay/TDC',
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_ENCODING => '',
        CURLOPT_MAXREDIRS => 10,
        CURLOPT_TIMEOUT => 0,
        CURLOPT_FOLLOWLOCATION => true,
        CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
        CURLOPT_CUSTOMREQUEST => 'POST',
        CURLOPT_POSTFIELDS => 'encriptado=eyJlbmNyeXB0ZWRfZGF0YSI6IjNYSmtydThLe
           Fg2aUF1Y0ZXeFNZMkZZRFhYb0p2UVU1U3lJanUrS3BnSDRSc2NuUGs1VDFhQTNWZVwvRStp
           cjUybmk3Zm9ZU3BwdThjUGVkTTJ3YXowaW9iV29LNkNpbDVuZm0xd0N2QzdjNU9TMzJMTzE
           2Mzh5MFwvVm5LSmdDOEJXTHdlTCtaU0VodVM3b3pqQlozd1FNWno2aStTamFvUmVnUnM1Mz
           dTeDlrYzAyREJsbU5ESlU2aHFBUlVcL2o4SGlcL1NTaGpmbFV3V1wvY1hBQnVqcm1wMjVDS
           2hMbFpBY212d3FUOTIzREJpUCtaRmFwNHMzcXprTk9BNEJQbDM4Um5HbVd3Yk1qcHBjOTlp
           REwxRE9yTEVmMTFXb1p3VFozd2hzb3dTaHZjVnBTekJFZW9EbjMwbnBETmFMS1wvXC9ra0x
           2UTlwcGsxRUdGTXZDb1JsZWRmR0U4QlFYQk95VjNheGFpQStFTzIybHFcL2t0UURraWZmaV
           lMc2Z2ajl3MjBiVXVoYkVoaWQxMU1NUWNuVTVCaXg0em5mK0RhRm9xRWdnMmxuTG1cL1RaK
           2xYaHN2dE5kT1Brd0g1cEN6dDlqR01BQmVCcGFxak40MHg5NlwveFUrQjNSTUkwWlBnMEtz
           T2FkSjIwQnhNMFlodz0iLCJpdiI6IlVHTUhcL3kyTVh5ejlITWZVV3lMU1pRPT0ifQ%3D%3
           D&codigo_tienda=TESTUSER',
        CURLOPT_HTTPHEADER => array(
        'Content-Type: application/x-www-form-urlencoded'
        ),
    ));

    $response = curl_exec($curl);

    curl_close($curl);
    echo $response;

                            
{
   "message": "Pago Exitoso",
   "monto_recibido": "25000",
   "sigla_cliente": "TESTUSER",
   "numero_confirmacion": "007556",
   "numero_factura": "1120210122111056",
   "recibo": {
       "numero_confirmacion": "007556",
       "numero_factura": "1120210122111056"
   },
   "fecha_salida": "2021-01-22",
   "hora_salida": "19:10:56",
   "intentos": 1,
   "codigo_respuesta": 2
}
                            
    import requests

    url = "https://apiq.finhack.in/api/pay/enkey"

    payload='data%5Bdoc_id%5D=00000000&data%5Bfull_name%5D=
       ALIXON%20R%20BETANCOURT%20F&data%5Bcard_number%5D=
       4521000001234567&data%5Bexpired_date%5D=2024/08&data%5Bcvv%5D=
       000&data%5Bmonto_compra%5D=25000&data%5Bemail%5D=
       correo%40dominio.com&data%5Bip_usuario%5D=
       127.0.0.1&data%5Bcompra_id%5D=1&key=
       payr3st%24andbox2020&data%5Bconcepto%5D%5B%5D=
       Compra&data%5Bcard_type%5D=Visa'
    headers = {
        'Content-Type': 'application/x-www-form-urlencoded'
    }

    response = requests.request("POST", url, headers=headers, data=payload)

    print(response.text)

                            
{
    "message": "Datos encriptados",
    "encriptado":
        "eyJlbmNyeXB0ZWRfZGF0YSI6IjNYSmtydThLeFg2aUF1Y0ZXeFNZMkZZRFhYb0p2
        UVU1U3lJanUrS3BnSDRSc2NuUGs1VDFhQTNWZVwvRStpcjUybmk3Zm9ZU3BwdThjU
        GVkTTJ3YXowaW9iV29LNkNpbDVuZm0xd0N2QzdjNU9TMzJMTzE2Mzh5MFwvVm5LSm
        dDOEJXTHdlTCtaU0VodVM3b3pqQlozd1FNWno2aStTamFvUmVnUnM1MzdTeDlrYzA
        yREJsbU5ESlU2aHFBUlVcL2o4SGlcL1NTaGpmbFV3V1wvY1hBQnVqcm1wMjVDS2hM
        bFpBY212d3FUOTIzREJpUCtaRmFwNHMzcXprTk9BNEJQbDM4Um5HbVd3Yk1qcHBjO
        TlpREwxRE9yTEVmMTFXb1p3VFozd2hzb3dTaHZjVnBTekJFZW9EbjMwbnBETmFMS1
        wvXC9ra0x2UTlwcGsxRUdGTXZDb1JsZWRmR0U4QlFYQk95VjNheGFpQStFTzIybHF
        cL2t0UURraWZmaVlMc2Z2ajl3MjBiVXVoYkVoaWQxMU1NUWNuVTVCaXg0em5mK0Rh
        Rm9xRWdnMmxuTG1cL1RaK2xYaHN2dE5kT1Brd0g1cEN6dDlqR01BQmVCcGFxak40M
        Hg5NlwveFUrQjNSTUkwWlBnMEtzT2FkSjIwQnhNMFlodz0iLCJpdiI6IlVHTUhcL3
        kyTVh5ejlITWZVV3lMU1pRPT0ifQ=="
    }
}
                            
    import requests

    url = "https://apiq.finhack.in/api/pay/TDC"

    payload='encriptado=eyJlbmNyeXB0ZWRfZGF0YSI6IjNYSmtydThLeFg2aUF1
       Y0ZXeFNZMkZZRFhYb0p2UVU1U3lJanUrS3BnSDRSc2NuUGs1VDFhQTNWZVwvRStp
       cjUybmk3Zm9ZU3BwdThjUGVkTTJ3YXowaW9iV29LNkNpbDVuZm0xd0N2QzdjNU9T
       MzJMTzE2Mzh5MFwvVm5LSmdDOEJXTHdlTCtaU0VodVM3b3pqQlozd1FNWno2aStT
       amFvUmVnUnM1MzdTeDlrYzAyREJsbU5ESlU2aHFBUlVcL2o4SGlcL1NTaGpmbFV3
       V1wvY1hBQnVqcm1wMjVDS2hMbFpBY212d3FUOTIzREJpUCtaRmFwNHMzcXprTk9B
       NEJQbDM4Um5HbVd3Yk1qcHBjOTlpREwxRE9yTEVmMTFXb1p3VFozd2hzb3dTaHZj
       VnBTekJFZW9EbjMwbnBETmFMS1wvXC9ra0x2UTlwcGsxRUdGTXZDb1JsZWRmR0U4
       QlFYQk95VjNheGFpQStFTzIybHFcL2t0UURraWZmaVlMc2Z2ajl3MjBiVXVoYkVo
       aWQxMU1NUWNuVTVCaXg0em5mK0RhRm9xRWdnMmxuTG1cL1RaK2xYaHN2dE5kT1Br
       d0g1cEN6dDlqR01BQmVCcGFxak40MHg5NlwveFUrQjNSTUkwWlBnMEtzT2FkSjIw
       QnhNMFlodz0iLCJpdiI6IlVHTUhcL3kyTVh5ejlITWZVV3lMU1pRPT0ifQ%3D%3D
       &codigo_tienda=TESTUSER'
    headers = {
        'Content-Type': 'application/x-www-form-urlencoded'
    }

    response = requests.request("POST", url, headers=headers, data=payload)

    print(response.text)


                            
{
   "message": "Pago Exitoso",
   "monto_recibido": "25000",
   "sigla_cliente": "TESTUSER",
   "numero_confirmacion": "007556",
   "numero_factura": "1120210122111056",
   "recibo": {
       "numero_confirmacion": "007556",
       "numero_factura": "1120210122111056"
   },
   "fecha_salida": "2021-01-22",
   "hora_salida": "19:10:56",
   "intentos": 1,
   "codigo_respuesta": 2
}
                            
    import Foundation
    #if canImport(FoundationNetworking)
    import FoundationNetworking
    #endif

    var semaphore = DispatchSemaphore (value: 0)

    let parameters = "data%5Bdoc_id%5D=00000000&data%5Bfull_name%5D=
       ALIXON%20R%20BETANCOURT%20F&data%5Bcard_number%5D=
       4521000001234567&data%5Bexpired_date%5D=2024/08&data%5Bcvv%5D=
       000&data%5Bmonto_compra%5D=25000&data%5Bemail%5D=
       correo%40dominio.com&data%5Bip_usuario%5D=
       127.0.0.1&data%5Bcompra_id%5D=1&key=
       payr3st%24andbox2020&data%5Bconcepto%5D%5B%5D=
       Compra&data%5Bcard_type%5D=Visa"
    let postData =  parameters.data(using: .utf8)

    var request = URLRequest(url: URL(
        string: "https://apiq.finhack.in/api/pay/enkey"
        )!,timeoutInterval: Double.infinity)
    request.addValue(
        "application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type"
        )

    request.httpMethod = "POST"
    request.httpBody = postData

    let task = URLSession.shared.dataTask(with: request)
        { data, response, error in
           guard let data = data else {
           print(String(describing: error))
           semaphore.signal()
           return
        }
        print(String(data: data, encoding: .utf8)!)
        semaphore.signal()
    }

    task.resume()
    semaphore.wait()


                            
    {
        "message": "Datos encriptados",
        "encriptado":
            "eyJlbmNyeXB0ZWRfZGF0YSI6IjNYSmtydThLeFg2aUF1Y0ZXeFNZMkZZRFhYb0p2
            UVU1U3lJanUrS3BnSDRSc2NuUGs1VDFhQTNWZVwvRStpcjUybmk3Zm9ZU3BwdThjU
            GVkTTJ3YXowaW9iV29LNkNpbDVuZm0xd0N2QzdjNU9TMzJMTzE2Mzh5MFwvVm5LSm
            dDOEJXTHdlTCtaU0VodVM3b3pqQlozd1FNWno2aStTamFvUmVnUnM1MzdTeDlrYzA
            yREJsbU5ESlU2aHFBUlVcL2o4SGlcL1NTaGpmbFV3V1wvY1hBQnVqcm1wMjVDS2hM
            bFpBY212d3FUOTIzREJpUCtaRmFwNHMzcXprTk9BNEJQbDM4Um5HbVd3Yk1qcHBjO
            TlpREwxRE9yTEVmMTFXb1p3VFozd2hzb3dTaHZjVnBTekJFZW9EbjMwbnBETmFMS1
            wvXC9ra0x2UTlwcGsxRUdGTXZDb1JsZWRmR0U4QlFYQk95VjNheGFpQStFTzIybHF
            cL2t0UURraWZmaVlMc2Z2ajl3MjBiVXVoYkVoaWQxMU1NUWNuVTVCaXg0em5mK0Rh
            Rm9xRWdnMmxuTG1cL1RaK2xYaHN2dE5kT1Brd0g1cEN6dDlqR01BQmVCcGFxak40M
            Hg5NlwveFUrQjNSTUkwWlBnMEtzT2FkSjIwQnhNMFlodz0iLCJpdiI6IlVHTUhcL3
            kyTVh5ejlITWZVV3lMU1pRPT0ifQ=="
        }
    }
                            
    import Foundation
    #if canImport(FoundationNetworking)
    import FoundationNetworking
    #endif

    var semaphore = DispatchSemaphore (value: 0)

    let parameters = "encriptado=eyJlbmNyeXB0ZWRfZGF0YSI6IjNYSmtydThLe
       Fg2aUF1Y0ZXeFNZMkZZRFhYb0p2UVU1U3lJanUrS3BnSDRSc2NuUGs1VDFhQTNWZVw
       vRStpcjUybmk3Zm9ZU3BwdThjUGVkTTJ3YXowaW9iV29LNkNpbDVuZm0xd0N2QzdjN
       U9TMzJMTzE2Mzh5MFwvVm5LSmdDOEJXTHdlTCtaU0VodVM3b3pqQlozd1FNWno2aSt
       TamFvUmVnUnM1MzdTeDlrYzAyREJsbU5ESlU2aHFBUlVcL2o4SGlcL1NTaGpmbFV3V
       1wvY1hBQnVqcm1wMjVDS2hMbFpBY212d3FUOTIzREJpUCtaRmFwNHMzcXprTk9BNEJ
       QbDM4Um5HbVd3Yk1qcHBjOTlpREwxRE9yTEVmMTFXb1p3VFozd2hzb3dTaHZjVnBTe
       kJFZW9EbjMwbnBETmFMS1wvXC9ra0x2UTlwcGsxRUdGTXZDb1JsZWRmR0U4QlFYQk9
       5VjNheGFpQStFTzIybHFcL2t0UURraWZmaVlMc2Z2ajl3MjBiVXVoYkVoaWQxMU1NU
       WNuVTVCaXg0em5mK0RhRm9xRWdnMmxuTG1cL1RaK2xYaHN2dE5kT1Brd0g1cEN6dDl
       qR01BQmVCcGFxak40MHg5NlwveFUrQjNSTUkwWlBnMEtzT2FkSjIwQnhNMFlodz0iL
       CJpdiI6IlVHTUhcL3kyTVh5ejlITWZVV3lMU1pRPT0ifQ%3D%3D
       &codigo_tienda=TESTUSER"
    let postData =  parameters.data(using: .utf8)

    var request = URLRequest(url: URL(
        string: "https://apiq.finhack.in/api/pay/TDC"
        )!,timeoutInterval: Double.infinity)
    request.addValue(
        "application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type"
        )

    request.httpMethod = "POST"
    request.httpBody = postData

    let task = URLSession.shared.dataTask(with: request)
        { data, response, error in
           guard let data = data else {
           print(String(describing: error))
           semaphore.signal()
           return
        }
        print(String(data: data, encoding: .utf8)!)
        semaphore.signal()
    }

    task.resume()
    semaphore.wait()



                            
{
   "message": "Pago Exitoso",
   "monto_recibido": "25000",
   "sigla_cliente": "TESTUSER",
   "numero_confirmacion": "007556",
   "numero_factura": "1120210122111056",
   "recibo": {
       "numero_confirmacion": "007556",
       "numero_factura": "1120210122111056"
   },
   "fecha_salida": "2021-01-22",
   "hora_salida": "19:10:56",
   "intentos": 1,
   "codigo_respuesta": 2
}