@yosle/tropipayjs 0.1.24 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yosle/tropipayjs",
3
- "version": "0.1.24",
3
+ "version": "0.1.27",
4
4
  "description": "Javascript / Typescript SDK for the Tropipay API",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -87,10 +87,11 @@ export class Tropipay {
87
87
 
88
88
  // Create a separate instance for login requests
89
89
  this.loginRequest = axios.create({
90
- baseURL: tpp_env,
90
+ baseURL: config.customTropipayUrl || tpp_env,
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>(