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 0.7.3 to 0.7.4

2

lib/payments.js

@@ -13,3 +13,3 @@ import request from './request';

/**
* Returns a boollean stating the order is paid or not
* Returns a boolean stating the order is paid or not
* @returns {Boolean} Order is paid or not

@@ -16,0 +16,0 @@ */

@@ -5,8 +5,20 @@ import request from './request';

const refund_functions = {
/**
* Returns a boolean stating the order is paid or not
* @returns {Boolean} Order is paid or not
*/
isPaid() {
return ['paid', 'paidout'].indexOf(this.status.toLowerCase()) > -1;
},
/**
* Returns a boolean stating the order is partially refunded or not
* @returns {Boolean} Order is partially refunded or not
*/
isPartiallyRefunded() {
return this.amountRemaining && this.amountRemaining > 0;
},
/**
* Returns a boolean stating the order is fully paid out or not
* @returns {Boolean} Order is fully paid out or not
*/
isFullyRefunded() {

@@ -17,2 +29,9 @@ return this.amountRefunded === this.amount;

/**
* Creates a new refund
* @param {String} id The Payments id you'd like to refund
* @param {Number} amount Optional amount you'd like to refund.
* If omitted, the full amount will be refunded
* @returns {Object} New Refund or error, created by Mollie
*/
function *create(id, amount) {

@@ -38,2 +57,8 @@ if (!id) {

/**
* Get information about a payments specific refund
* @param {String} payment_id The Payments id
* @param {String} refund_id The Refunds id
* @returns {Object} Refund info or error, given by Mollie
*/
function *get(payment_id, refund_id) {

@@ -52,3 +77,3 @@ if (!payment_id || !refund_id) {

} else {
readifyRefunds(result);
readifyRefunds(result.payment);
return result;

@@ -58,2 +83,8 @@ }

/**
* Retrieves a list of Refunds from Mollie for a Payment
* @param {String} id The Payments id
* @param {Object} options Options Mollie accepts for Refunds.List
* @returns {Object} New Payment or error, created by Mollie
*/
function *list(id, options) {

@@ -82,2 +113,8 @@ if (!id) {

/**
* Cancels a Refund
* @param {String} payment_id The Payments id
* @param {String} refund_id The Refunds id
* @returns {Object} Refund info or error, given by Mollie
*/
function *cancel(payment_id, refund_id) {

@@ -84,0 +121,0 @@ if (!payment_id || !refund_id) {

{
"name": "mollie-es6",
"version": "0.7.3",
"version": "0.7.4",
"description": "Mollie module ready for ES6 usage",

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

Sorry, the diff of this file is not supported yet

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