Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function conectarWoo() {
- var url = $("#txtURLtiendaWoo").val();
- var apiKey = $("#txtAPIkey").val();
- var apiKeySecret = $("#txtAPIkeysecret").val();
- //var version = $("#cboVersion").val();
- var cboDireccion = $("#cboDirecciones").val();
- if (url == "") {
- alert("Ingresa Url de la tienda");
- return false
- }
- else if (apiKey == "") {
- alert("Ingresa Api key");
- return false
- }
- else if (apiKeySecret == "") {
- alert("Ingresa Api secret key");
- return false
- }
- else if (cboDireccion == "") {
- alert("Seleccion Dirección");
- return false
- }
- var registros, Error = '';
- var urlFetch = "http://emissarywebservice.site?url=" + url + "&consumer_key=" + apiKey + "&consumer_secret=" + apiKeySecret;
- var pJData = [];
- pJData.push({
- url: url,
- apiKey: apiKey,
- apiKeySecret: apiKeySecret,
- nombreRemitente: nombreRemitente,
- correoRemitente: correoRemitente,
- telefonoRemitente: telefonoRemitente,
- direccionRemitente: direccionRemitente,
- referenciaRemitente: referenciaRemitente,
- coloniaRemitente: coloniaRemitente,
- codigoPostalRemitente: codigoPostalRemitente,
- estadoRemitente: estadoRemitente,
- cboDireccion: cboDireccion,
- urlFetch: urlFetch
- });
- console.log(pJData);
- pJData = JSON.stringify(pJData);
- $.ajax({
- type: "POST",
- url: "listadoEnvios.aspx/conectarWoo",
- data: JSON.stringify({ pJData: pJData }),
- async: false,
- cache: false,
- contentType: "application/json; charset=utf-8",
- dataType: "json",
- success: function (result) {
- alert("Cuenta sincronizada")
- },
- error: function (result) {
- alert("No hay Órdenes por guardar")
- }
- });
- // alert("Cuenta sincronizada");
- //}).catch(function (err) {
- // console.log(err);
- //});
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement