Socket
Socket
Sign inDemoInstall

mollie-es6

Package Overview
Dependencies
24
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.1.2 to 2.2.0

lib/customers.js

1

app.js

@@ -6,3 +6,4 @@ module.exports = {

refunds: require('./lib/refunds'),
customers: require('./lib/customers'),
api_key: null
};

4

lib/payments.js

@@ -36,6 +36,6 @@ const request = require('./request');

if (options) {
if (!denied(options, ['recurringType']) && denied(options, ['customerId'])) {
if (!denied(options, 'recurringType') && denied(options, 'customerId')) {
throw {error: 'You need a customerId if you want to use recurring payments'};
}
if (!denied(options, ['recurringType']) && ['first', 'recurring'].indexOf(options.recurringType) === -1) {
if (!denied(options, 'recurringType') && ['first', 'recurring'].indexOf(options.recurringType) === -1) {
throw {error: 'recurringType needs value "first" or "recurring"'};

@@ -42,0 +42,0 @@ }

{
"name": "mollie-es6",
"version": "2.1.2",
"version": "2.2.0",
"description": "Mollie module in ES6",

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

@@ -291,2 +291,59 @@ ![Mollie](http://www.mollie.nl/files/Mollie-Logo-Style-Small.png)

### Customers ###
#### Create ####
##### Normal #####
```ES6
try {
const customer = yield mollie.customers.create(
'Customer name',
'info@domain.tld',
{locale: 'en', metadata: {something: 'here'}}
);
// New customer created, do something fun with it
} catch (e) {
// Handle error
}
```
#### Get ####
```ES6
const customer_id = 'some_id';
try {
const customer = yield mollie.customers.get(customer_id);
// Do something with this customer data
} catch (e) {
// Handle error
}
```
#### List ####
```ES6
const options = {
count: 100,
offset: 200
}
try {
const customer_list = yield mollie.customers.list(options);
/*
customer_list = {
totalCount: Number,
offset: Number,
count: Number,
data: [Customers],
links: {
first: String(url),
previous: String(url),
next: String(url),
last: String(url)
}
}
*/
} catch (e) {
// Handle error
}
```
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc