Comparing version 2.3.2 to 2.3.3
{ | ||
"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 [![Build Status](https://travis-ci.org/stripe/stripe-node.png?branch=master)](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
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
88351
2354
7