Skip to content

Commit

Permalink
Add currentBillingCycle attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
ivank committed Aug 25, 2017
1 parent ce6ef38 commit 4ca3d03
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mongoose-subscriptions-braintree",
"version": "1.4.6",
"version": "1.4.7",
"description": "Braintree processor for mongoose-subscriptions",
"main": "src/index.js",
"repository": "[email protected]:enhancv/mongoose-subscriptions-braintree.git",
Expand All @@ -24,7 +24,7 @@
"istanbul": "^0.4.5",
"mocha": "^3.2.0",
"mongoose": "^4.8",
"mongoose-subscriptions": "^1.13.7",
"mongoose-subscriptions": "^1.13.8",
"prettier": "^1.4.4",
"sinon": "^2.1.0"
}
Expand Down
1 change: 1 addition & 0 deletions src/subscriptionProcessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ function fields(customer, originalDiscounts, subscription) {
descriptor: subscription.descriptor,
status: subscription.status,
price: subscription.price,
currentBillingCycle: subscription.currentBillingCycle,
statusHistory: uniqWith(
(a, b) => isEqual(a, b),
map(pick(["timestamp", "status"]), subscription.statusHistory)
Expand Down
1 change: 1 addition & 0 deletions test/integrationTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ describe(
phone: "0888415433",
url: "enhancv.com",
},
currentBillingCycle: 1,
paymentMethodId: "three",
},
],
Expand Down
2 changes: 2 additions & 0 deletions test/subscriptionProcessorTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ describe(
processor: { id: "gzsxjb", state: "saved" },
firstBillingDate: "2016-09-29",
trialDuration: 5,
currentBillingCycle: 1,
trialDurationUnit: "day",
isTrial: true,
},
Expand Down Expand Up @@ -476,6 +477,7 @@ describe(
status: "Active",
},
],
currentBillingCycle: 1,
firstBillingDate: "2016-09-29",
nextBillingDate: "2016-10-29",
billingDayOfMonth: 29,
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -430,9 +430,9 @@ mongoose-originals@^1.3.2:
dependencies:
lodash "^4.17.4"

mongoose-subscriptions@^1.13.7:
version "1.13.7"
resolved "https://registry.yarnpkg.com/mongoose-subscriptions/-/mongoose-subscriptions-1.13.7.tgz#c5ecdc72851751f5c0460c91206f4164884df59a"
mongoose-subscriptions@^1.13.8:
version "1.13.8"
resolved "https://registry.yarnpkg.com/mongoose-subscriptions/-/mongoose-subscriptions-1.13.8.tgz#8eaa7389a8e84ee2819acd02915d3b42e749546a"
dependencies:
mongoose-originals "^1.3.2"
shortid "^2.2.8"
Expand Down

0 comments on commit 4ca3d03

Please sign in to comment.