Skip to content

Commit

Permalink
Release 1.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
jvoliveiraGN committed Jul 30, 2021
1 parent 3468e81 commit 8eaf8b5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,10 @@ export = (options: ConfigInterface) => {
pathCert: options.pix_cert,
sandbox: options.sandbox,
};

if (options.partner_token) {
credentials.partnerToken = options.partner_token;
}

return new GnSdk(credentials);
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gn-api-sdk-typescript",
"version": "1.0.6",
"version": "1.0.7",
"description": "Module for integration with Gerencianet API\"",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
4 changes: 4 additions & 0 deletions src/gn-endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ class GnEndpoints {

headers['x-skip-mtls-checking'] = !this.options.validateMtls;

if (this.options.partnerToken) {
headers['partner-token'] = this.options.partnerToken;
}

const req: any = {
url: [this.options.baseUrl, route, query].join(''),
headers,
Expand Down
1 change: 1 addition & 0 deletions src/interfaces/config.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ export interface ConfigInterface {
client_secret: string;
pix_cert: PathLike;
sandbox: boolean;
partner_token?: string;
}

0 comments on commit 8eaf8b5

Please sign in to comment.