Socket
Socket
Sign inDemoInstall

mollie-es6

Package Overview
Dependencies
23
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.0.1

2

package.json
{
"name": "mollie-es6",
"version": "1.0.0",
"version": "1.0.1",
"description": "Mollie module ready for ES6 usage",

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

# Mollie ES6 API client for Node.js #
Mollie API made ready for ES6 usage.
*You can see a list of implemented functions at the bottom.*
*Till Version 1.0.0, this is WIP*
## Requirements ##

@@ -51,4 +48,5 @@ To use the Mollie API client, the following things are required:

```ES6
const payment_id = 'some_id';
try {
const payment = yield mollie.payments.get(payment.id);
const payment = yield mollie.payments.get(payment_id);
if(payment.isPaid()) {

@@ -66,8 +64,62 @@ console.log('Payment is paid');

| Functionality |Implemented |
|:-------------:|:-------------:|
| Create | Yes |
| Get | Yes |
| List | Yes |
#### Create ####
```ES6
try {
const payment = yield mollie.payments.create({
amount: 10.00,
description: "My first API payment",
redirectUrl: "https://webshop.com/api/payments/response"
});
res.redirect(payment.getPaymentUrl());
} catch (e) {
// Handle error
}
```
#### Get ####
```ES6
const payment_id = 'some_id';
const options = {
method: 'creditcard'
};
try {
const payment = yield mollie.payments.get(payment_id, options);
if(payment.isPaid()) {
console.log('Payment is paid');
}
} catch (e) {
// Handle error
}
```
#### List ####
```ES6
const options = {
count: 100,
offset: 200
}
try {
const payments_list = yield mollie.payments.list(options);
/*
payments_list = {
totalCount: Number,
offset: Number,
count: Number,
data: [Payments],
links: {
first: String(url),
previous: String(url),
next: String(url),
last: String(url)
}
}
*/
} catch (e) {
// Handle error
}
```
### Methods ###

@@ -74,0 +126,0 @@

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