ghost-payment-service
Advanced tools
Comparing version 1.1.2 to 1.1.3
@@ -28,32 +28,3 @@ 'use strict'; | ||
* @param {object} data | ||
* @param {string} data.cardId | ||
* @param {string} data.customerId | ||
* @return Promise | ||
*/ | ||
deleteCard (data) { | ||
return new Promise((resolve, reject) => { | ||
this._stripe.customers.deleteCard(data.customerId, data.cardId, (err, confirmation) => { | ||
if (err) reject(err); | ||
else resolve(confirmation); | ||
}) | ||
}) | ||
} | ||
/** | ||
* @param {object} data | ||
* @param {string} data.customerId | ||
* @return Promise | ||
*/ | ||
deleteCustomer (data) { | ||
return new Promise((resolve, reject) => { | ||
this._stripe.customers.del(data.customerId, (err, confirmation) => { | ||
if (err) reject(err); | ||
else resolve(confirmation); | ||
}) | ||
}) | ||
} | ||
/** | ||
* @param {object} data | ||
* @param {string} data.customerId | ||
* @param {object} data.card | ||
@@ -102,2 +73,14 @@ * @param {string} data.card.number | ||
* @param {object} data | ||
*/ | ||
createCustomer (data) { | ||
return new Promise((resolve, reject) => { | ||
this._stripe.customers.create(data, (err, customer) => { | ||
if (err) reject(err); | ||
else resolve(customer) | ||
}) | ||
}) | ||
} | ||
/** | ||
* @param {object} data | ||
* @param {int} data.amount | ||
@@ -120,9 +103,11 @@ * @param {string} data.interval | ||
} | ||
/** | ||
* @param {object} data | ||
* @param {string} data.customerId | ||
* @param {string} data.planId | ||
*/ | ||
createCustomer (data) { | ||
createSubscription (data) { | ||
return new Promise((resolve, reject) => { | ||
this._stripe.customers.create(data, (err, customer) => { | ||
return this._stripe.customers.update(data.customerId, { plan: data.planId }, (err, customer) => { | ||
if (err) reject(err); | ||
@@ -136,2 +121,31 @@ else resolve(customer) | ||
* @param {object} data | ||
* @param {string} data.cardId | ||
* @param {string} data.customerId | ||
* @return Promise | ||
*/ | ||
deleteCard (data) { | ||
return new Promise((resolve, reject) => { | ||
this._stripe.customers.deleteCard(data.customerId, data.cardId, (err, confirmation) => { | ||
if (err) reject(err); | ||
else resolve(confirmation); | ||
}) | ||
}) | ||
} | ||
/** | ||
* @param {object} data | ||
* @param {string} data.customerId | ||
* @return Promise | ||
*/ | ||
deleteCustomer (data) { | ||
return new Promise((resolve, reject) => { | ||
this._stripe.customers.del(data.customerId, (err, confirmation) => { | ||
if (err) reject(err); | ||
else resolve(confirmation); | ||
}) | ||
}) | ||
} | ||
/** | ||
* @param {object} data | ||
* @param {int} data.limit | ||
@@ -138,0 +152,0 @@ */ |
{ | ||
"name": "ghost-payment-service", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "nodejs client to interact with the authorize.net & stripe apis", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
33539
971