@yosle/tropipayjs
Advanced tools
Comparing version 0.1.25 to 0.1.27
33
index.js
@@ -537,2 +537,3 @@ 'use strict'; | ||
Accept: "application/json", | ||
Authorization: `Bearer ${Tropipay.accessToken}`, | ||
}, | ||
@@ -566,16 +567,20 @@ }); | ||
try { | ||
if (Tropipay.refreshToken) { | ||
const { data } = await this.loginRequest.post("/api/v2/access/token", { | ||
client_id: this.clientId, | ||
client_secret: this.clientSecret, | ||
grant_type: "refresh_token", | ||
refresh_token: Tropipay.refreshToken, | ||
}, { | ||
headers: { | ||
"Content-Type": "application/json", | ||
Accept: "application/json", | ||
}, | ||
}); | ||
return data; | ||
} | ||
// if (Tropipay.refreshToken) { | ||
// const { data } = await this.loginRequest.post<LoginResponse>( | ||
// "/api/v2/access/token", | ||
// { | ||
// client_id: this.clientId, | ||
// client_secret: this.clientSecret, | ||
// grant_type: "refresh_token", | ||
// refresh_token: Tropipay.refreshToken, | ||
// }, | ||
// { | ||
// headers: { | ||
// "Content-Type": "application/json", | ||
// Accept: "application/json", | ||
// }, | ||
// } | ||
// ); | ||
// return data; | ||
// } | ||
// normal credetials login | ||
@@ -582,0 +587,0 @@ const { data } = await this.loginRequest.post("/api/v2/access/token", { |
{ | ||
"name": "@yosle/tropipayjs", | ||
"version": "0.1.25", | ||
"version": "0.1.27", | ||
"description": "Javascript / Typescript SDK for the Tropipay API", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -94,2 +94,3 @@ /** | ||
Accept: "application/json", | ||
Authorization: `Bearer ${Tropipay.accessToken}`, | ||
}, | ||
@@ -135,20 +136,20 @@ }); | ||
try { | ||
if (Tropipay.refreshToken) { | ||
const { data } = await this.loginRequest.post<LoginResponse>( | ||
"/api/v2/access/token", | ||
{ | ||
client_id: this.clientId, | ||
client_secret: this.clientSecret, | ||
grant_type: "refresh_token", | ||
refresh_token: Tropipay.refreshToken, | ||
}, | ||
{ | ||
headers: { | ||
"Content-Type": "application/json", | ||
Accept: "application/json", | ||
}, | ||
} | ||
); | ||
return data; | ||
} | ||
// if (Tropipay.refreshToken) { | ||
// const { data } = await this.loginRequest.post<LoginResponse>( | ||
// "/api/v2/access/token", | ||
// { | ||
// client_id: this.clientId, | ||
// client_secret: this.clientSecret, | ||
// grant_type: "refresh_token", | ||
// refresh_token: Tropipay.refreshToken, | ||
// }, | ||
// { | ||
// headers: { | ||
// "Content-Type": "application/json", | ||
// Accept: "application/json", | ||
// }, | ||
// } | ||
// ); | ||
// return data; | ||
// } | ||
@@ -155,0 +156,0 @@ // normal credetials login |
139947
3723