Closed aaferna closed 1 year ago
Buenas noches, para que se necesita este fragmento de codigo para funcionar con AFIP??
if (!this.AdminClient && this.options['production'] === true) { /** @private */ this.AdminClient = axios.create({ baseURL: 'https://app.afipsdk.com/api/', timeout: 10000 }); this.AdminClient.defaults.headers.common['sdk-version-number'] = '0.7.8'; this.AdminClient.defaults.headers.common['sdk-library'] = 'javascript'; if (this.options['access_token']) { this.AdminClient.defaults.headers.common['Authorization'] = `Bearer ${this.options['access_token']}`; } try { await this.AdminClient.post('v1/sdk-events', { "name": "initialized", "properties": { "environment": this.options['production'] === true ? "prod" : "dev", "tax_id": `${this.options['CUIT']}`, "afip_sdk_library": "javascript" } }); } catch (error) { if (!error.response) { throw error; } else if (error.response.data && error.response.data.message) { throw Object.assign(new Error(error.response.data.message), error.response.data); } else { throw Object.assign(new Error(error.response.statusText), error.response); } } }
No paso a ser free el SDK, al contrario ahora es de pago, para eso sirve ese fragmento!
Buenas noches, para que se necesita este fragmento de codigo para funcionar con AFIP??