ghost-payment-service
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -84,2 +84,3 @@ 'use strict'; | ||
* @param {object} data | ||
* @param {string} data.id | ||
* @param {int} data.amount | ||
@@ -246,4 +247,23 @@ * @param {string} data.interval | ||
} | ||
/** | ||
* @param {object} data | ||
* @param {id} data.planId | ||
* @param {string} data.name | ||
* @param {object} data.metadata | ||
* @param {string} data.metadata.description | ||
* @return Promise | ||
*/ | ||
updatePlan (data) { | ||
return new Promise((resolve, reject) => { | ||
let planData = { name : data.name }; | ||
if (data.metadata && data.metadata.description) planData.metadata = data.metadata; | ||
this._stripe.plans.update(data.planId, planData, (err, plan) => { | ||
if (err) reject(err); | ||
else resolve(plan); | ||
}) | ||
}) | ||
} | ||
} | ||
module.exports = StripeService; |
{ | ||
"name": "ghost-payment-service", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "nodejs client to interact with the authorize.net & stripe apis", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -141,2 +141,30 @@ const Chai = require('chai'); | ||
<<<<<<< HEAD | ||
describe('plans', () => { | ||
it('should create a plan', () => { | ||
const id = Chance.natural({min: 10000000, max: 99999999}); | ||
const plan = { | ||
amount: 10000, | ||
id: id, | ||
interval: "month", | ||
name: "New Test Plan", | ||
currency: "usd", | ||
metadata: { | ||
description: "This plan is a test." | ||
}, | ||
trial_period_days: 1 | ||
}; | ||
return service.createPlan(plan) | ||
.then(_plan_ => { | ||
console.log('plan', _plan_); | ||
expect(_plan_).to.exist; | ||
expect(_plan_).id.to.be.equal(id); | ||
}) | ||
}) | ||
}) | ||
======= | ||
>>>>>>> 6a67f0ce8172f445c0d0d4e570a7e0650f4da686 | ||
}); | ||
@@ -143,0 +171,0 @@ |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
37720
1109
0