@yosle/tropipayjs 0.1.25 → 0.1.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -534,6 +534,7 @@ class Tropipay {
534
534
  headers: {
535
535
  "Content-Type": "application/json",
536
536
  Accept: "application/json",
537
+ Authorization: `Bearer ${Tropipay.accessToken}`,
537
538
  },
538
539
  });
539
540
  // Add request interceptor for Token expired
@@ -562,20 +563,24 @@ class Tropipay {
562
563
  }
563
564
  async login() {
564
565
  try {
565
- if (Tropipay.refreshToken) {
566
- const { data } = await this.loginRequest.post("/api/v2/access/token", {
567
- client_id: this.clientId,
568
- client_secret: this.clientSecret,
569
- grant_type: "refresh_token",
570
- refresh_token: Tropipay.refreshToken,
571
- }, {
572
- headers: {
573
- "Content-Type": "application/json",
574
- Accept: "application/json",
575
- },
576
- });
577
- return data;
578
- }
566
+ // if (Tropipay.refreshToken) {
567
+ // const { data } = await this.loginRequest.post<LoginResponse>(
568
+ // "/api/v2/access/token",
569
+ // {
570
+ // client_id: this.clientId,
571
+ // client_secret: this.clientSecret,
572
+ // grant_type: "refresh_token",
573
+ // refresh_token: Tropipay.refreshToken,
574
+ // },
575
+ // {
576
+ // headers: {
577
+ // "Content-Type": "application/json",
578
+ // Accept: "application/json",
579
+ // },
580
+ // }
581
+ // );
582
+ // return data;
583
+ // }
579
584
  // normal credetials login
580
585
  const { data } = await this.loginRequest.post("/api/v2/access/token", {
581
586
  client_id: this.clientId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yosle/tropipayjs",
3
- "version": "0.1.25",
3
+ "version": "0.1.27",
4
4
  "description": "Javascript / Typescript SDK for the Tropipay API",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -91,6 +91,7 @@ export class Tropipay {
91
91
  headers: {
92
92
  "Content-Type": "application/json",
93
93
  Accept: "application/json",
94
+ Authorization: `Bearer ${Tropipay.accessToken}`,
94
95
  },
95
96
  });
96
97
 
@@ -131,24 +132,24 @@ export class Tropipay {
131
132
 
132
133
  public async login() {
133
134
  try {
134
- if (Tropipay.refreshToken) {
135
- const { data } = await this.loginRequest.post<LoginResponse>(
136
- "/api/v2/access/token",
137
- {
138
- client_id: this.clientId,
139
- client_secret: this.clientSecret,
140
- grant_type: "refresh_token",
141
- refresh_token: Tropipay.refreshToken,
142
- },
143
- {
144
- headers: {
145
- "Content-Type": "application/json",
146
- Accept: "application/json",
147
- },
148
- }
149
- );
150
- return data;
151
- }
135
+ // if (Tropipay.refreshToken) {
136
+ // const { data } = await this.loginRequest.post<LoginResponse>(
137
+ // "/api/v2/access/token",
138
+ // {
139
+ // client_id: this.clientId,
140
+ // client_secret: this.clientSecret,
141
+ // grant_type: "refresh_token",
142
+ // refresh_token: Tropipay.refreshToken,
143
+ // },
144
+ // {
145
+ // headers: {
146
+ // "Content-Type": "application/json",
147
+ // Accept: "application/json",
148
+ // },
149
+ // }
150
+ // );
151
+ // return data;
152
+ // }
152
153
 
153
154
  // normal credetials login
154
155
  const { data } = await this.loginRequest.post<LoginResponse>(