mollie-es6
Advanced tools
Comparing version 0.7.3 to 0.7.4
@@ -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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
0
50192
10
429
1