-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #138 from recurly/v3-v2019-10-10
Latest Changes for 2019-10-10 (usage, measured units, etc)
- Loading branch information
Showing
11 changed files
with
1,824 additions
and
248 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* istanbul ignore file */ | ||
/** | ||
* This file is automatically created by Recurly's OpenAPI generation process | ||
* and thus any edits you make by hand will be lost. If you wish to make a | ||
* change to this file, please create a Github issue explaining the changes you | ||
* need and we will usher them to the appropriate places. | ||
*/ | ||
'use strict' | ||
|
||
const Resource = require('../Resource') | ||
|
||
/** | ||
* MeasuredUnit | ||
* @typedef {Object} MeasuredUnit | ||
* @prop {Date} createdAt - Created at | ||
* @prop {Date} deletedAt - Deleted at | ||
* @prop {string} description - Optional internal description. | ||
* @prop {string} displayName - Display name for the measured unit. Can only contain spaces, underscores and must be alphanumeric. | ||
* @prop {string} id - Item ID | ||
* @prop {string} name - Unique internal name of the measured unit on your site. | ||
* @prop {string} object - Object type | ||
* @prop {string} state - The current state of the measured unit. | ||
* @prop {Date} updatedAt - Last updated at | ||
*/ | ||
class MeasuredUnit extends Resource { | ||
static getSchema () { | ||
return { | ||
createdAt: Date, | ||
deletedAt: Date, | ||
description: String, | ||
displayName: String, | ||
id: String, | ||
name: String, | ||
object: String, | ||
state: String, | ||
updatedAt: Date | ||
} | ||
} | ||
} | ||
|
||
module.exports = MeasuredUnit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* istanbul ignore file */ | ||
/** | ||
* This file is automatically created by Recurly's OpenAPI generation process | ||
* and thus any edits you make by hand will be lost. If you wish to make a | ||
* change to this file, please create a Github issue explaining the changes you | ||
* need and we will usher them to the appropriate places. | ||
*/ | ||
'use strict' | ||
|
||
const Resource = require('../Resource') | ||
|
||
/** | ||
* Usage | ||
* @typedef {Object} Usage | ||
* @prop {number} amount - The amount of usage. Can be positive, negative, or 0. No decimals allowed, we will strip them. If the usage-based add-on is billed with a percentage, your usage will be a monetary amount you will want to format in cents. (e.g., $5.00 is "500"). | ||
* @prop {Date} billedAt - When the usage record was billed on an invoice. | ||
* @prop {Date} createdAt - When the usage record was created in Recurly. | ||
* @prop {string} id | ||
* @prop {string} measuredUnitId - The ID of the measured unit associated with the add-on the usage record is for. | ||
* @prop {string} merchantTag - Custom field for recording the id in your own system associated with the usage, so you can provide auditable usage displays to your customers using a GET on this endpoint. | ||
* @prop {string} object - Object type | ||
* @prop {Date} recordingTimestamp - When the usage was recorded in your system. | ||
* @prop {string} tierType - The pricing model for the add-on. For more information, [click here](https://docs.recurly.com/docs/billing-models#section-quantity-based). | ||
* @prop {Array.<SubscriptionAddOnTier>} tiers - The tiers and prices of the subscription based on the usage_timestamp. If tier_type = flat, tiers = null | ||
* @prop {Date} updatedAt - When the usage record was billed on an invoice. | ||
* @prop {Date} usageTimestamp - When the usage actually happened. This will define the line item dates this usage is billed under and is important for revenue recognition. | ||
* @prop {string} usageType - Type of usage, returns usage type if `add_on_type` is `usage`. | ||
*/ | ||
class Usage extends Resource { | ||
static getSchema () { | ||
return { | ||
amount: Number, | ||
billedAt: Date, | ||
createdAt: Date, | ||
id: String, | ||
measuredUnitId: String, | ||
merchantTag: String, | ||
object: String, | ||
recordingTimestamp: Date, | ||
tierType: String, | ||
tiers: ['SubscriptionAddOnTier'], | ||
updatedAt: Date, | ||
usageTimestamp: Date, | ||
usageType: String | ||
} | ||
} | ||
} | ||
|
||
module.exports = Usage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.