Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

xendit-node

Package Overview
Dependencies
Maintainers
3
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xendit-node - npm Package Compare versions

Comparing version 1.8.0 to 1.9.0

2

package.json
{
"name": "xendit-node",
"version": "1.8.0",
"version": "1.9.0",
"description": "NodeJS client for Xendit API",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -422,2 +422,3 @@ # Xendit API Node.js Client

midLabel?: string;
forUserID?: string;
})

@@ -429,3 +430,3 @@ ```

```ts
i.getInvoice(data: { invoiceID: string })
i.getInvoice(data: { invoiceID: string; forUserID?: string })
```

@@ -436,3 +437,6 @@

```ts
i.expireInvoice(data: { invoiceID: string })
i.expireInvoice(data: {
invoiceID: string;
forUserID?: string;
})
```

@@ -457,2 +461,3 @@

recurringPaymentID?: string;
forUserID?: string;
})

@@ -459,0 +464,0 @@ ```

@@ -21,5 +21,9 @@ import { XenditOptions } from '../xendit_opts';

midLabel?: string;
forUserID?: string;
}): Promise<object>;
getInvoice(data: { invoiceID: string }): Promise<object>;
expireInvoice(data: { invoiceID: string }): Promise<object>;
getInvoice(data: { invoiceID: string; forUserID?: string }): Promise<object>;
expireInvoice(data: {
invoiceID: string;
forUserID?: string;
}): Promise<object>;
getAllInvoices(data?: {

@@ -39,3 +43,4 @@ statuses?: string[];

recurringPaymentID?: string;
forUserID?: string;
}): Promise<object>;
};

@@ -35,8 +35,14 @@ const {

let headers = {
'Content-Type': 'application/json',
Authorization: Auth.basicAuthHeader(this.opts.secretKey),
};
if (data.forUserID) {
headers['for-user-id'] = data.forUserID;
}
fetchWithHTTPErr(`${this.API_ENDPOINT}/v2/invoices`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: Auth.basicAuthHeader(this.opts.secretKey),
},
headers,
body: JSON.stringify({

@@ -67,7 +73,13 @@ external_id: data.externalID,

let headers = {
Authorization: Auth.basicAuthHeader(this.opts.secretKey),
};
if (data.forUserID) {
headers['for-user-id'] = data.forUserID;
}
fetchWithHTTPErr(`${this.API_ENDPOINT}/v2/invoices/${data.invoiceID}`, {
method: 'GET',
headers: {
Authorization: Auth.basicAuthHeader(this.opts.secretKey),
},
headers,
})

@@ -83,2 +95,10 @@ .then(resolve)

let headers = {
Authorization: Auth.basicAuthHeader(this.opts.secretKey),
};
if (data.forUserID) {
headers['for-user-id'] = data.forUserID;
}
fetchWithHTTPErr(

@@ -88,5 +108,3 @@ `${this.API_ENDPOINT}/invoices/${data.invoiceID}/expire!`,

method: 'POST',
headers: {
Authorization: Auth.basicAuthHeader(this.opts.secretKey),
},
headers,
},

@@ -131,2 +149,10 @@ )

let headers = {
Authorization: Auth.basicAuthHeader(this.opts.secretKey),
};
if (data && data.forUserID) {
headers['for-user-id'] = data.forUserID;
}
fetchWithHTTPErr(

@@ -136,5 +162,3 @@ `${this.API_ENDPOINT}/v2/invoices${queryStrWithQuestionMark}`,

method: 'GET',
headers: {
Authorization: Auth.basicAuthHeader(this.opts.secretKey),
},
headers,
},

@@ -141,0 +165,0 @@ )

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc