Comparing version
{ | ||
"name": "stripe", | ||
"version": "2.3.2", | ||
"version": "2.3.3", | ||
"description": "Stripe API wrapper", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/stripe/stripe-node", |
@@ -92,3 +92,3 @@ # Stripe node.js bindings [](https://travis-ci.org/stripe/stripe-node) | ||
* [`updateSubscription(customerId[, params])`](https://stripe.com/docs/api/node#update_subscription) | ||
* [`cancelSubscription(customerId)`](https://stripe.com/docs/api/node#cancel_subscription) | ||
* [`cancelSubscription(customerId[, params])`](https://stripe.com/docs/api/node#cancel_subscription) | ||
* [`createCard(customerId[, params])`](https://stripe.com/docs/api/node#create_card) | ||
@@ -95,0 +95,0 @@ * [`listCards(customerId)`](https://stripe.com/docs/api/node#list_cards) |
@@ -95,2 +95,35 @@ 'use strict'; | ||
it('Allows me to: subscribe then cancel with `at_period_end` defined', function() { | ||
return expect( | ||
when.join( | ||
stripe.plans.create({ | ||
id: 'plan' + +new Date, | ||
amount: 1700, | ||
currency: CURRENCY, | ||
interval: 'month', | ||
name: 'Silver Super Amazing Tier' | ||
}), | ||
stripe.customers.create(CUSTOMER_DETAILS) | ||
).then(function(j) { | ||
var plan = j[0]; | ||
var customer = j[1]; | ||
cleanup.deleteCustomer(customer.id); | ||
cleanup.deletePlan(plan.id); | ||
return stripe.customers.updateSubscription(customer.id, { | ||
plan: plan.id | ||
}); | ||
}).then(function(subscription) { | ||
return stripe.customers.cancelSubscription(subscription.customer, { | ||
at_period_end: true | ||
}); | ||
}) | ||
).to.eventually.have.property('cancel_at_period_end', true); | ||
}); | ||
}); | ||
@@ -97,0 +130,0 @@ |
@@ -168,2 +168,15 @@ 'use strict'; | ||
describe('With at_period_end defined', function() { | ||
it('Sends the correct request', function() { | ||
stripe.customers.cancelSubscription('customerIdFoo321', {at_period_end: true}); | ||
expect(stripe.LAST_REQUEST).to.deep.equal({ | ||
method: 'DELETE', | ||
url: '/v1/customers/customerIdFoo321/subscription', | ||
data: { at_period_end: true } | ||
}); | ||
}); | ||
}); | ||
}); | ||
@@ -170,0 +183,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
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
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
88351
1.7%2354
1.55%7
-12.5%