Skip to content

Commit

Permalink
Merge pull request #42 from recurly/v3-v2019-10-10
Browse files Browse the repository at this point in the history
Upgrade API version v2019-10-10
  • Loading branch information
csmb authored Oct 4, 2019
2 parents e67e691 + 54b826d commit 1e506fd
Show file tree
Hide file tree
Showing 16 changed files with 2,033 additions and 967 deletions.
2,417 changes: 1,645 additions & 772 deletions docs/index.html

Large diffs are not rendered by default.

419 changes: 245 additions & 174 deletions lib/recurly/Client.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/recurly/resources/AddOn.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const Resource = require('../Resource')
* @prop {string} name - Describes your add-on and will appear in subscribers' invoices.
* @prop {string} planId - Plan ID
* @prop {string} state - Add-ons can be either active or inactive.
* @prop {string} taxCode - Used by Avalara, Vertex, and Recurly’s EU VAT tax feature. The tax code values are specific to each tax system. If you are using Recurly’s EU VAT feature `P0000000` is `physical`, `D0000000` is `digital`, and an empty string is `unknown`.
* @prop {string} taxCode - Used by Avalara, Vertex, and Recurly’s EU VAT tax feature. The tax code values are specific to each tax system. If you are using Recurly’s EU VAT feature you can use `unknown`, `physical`, or `digital`.
* @prop {datetime} updatedAt - Last updated at
*/
class AddOn extends Resource {
Expand Down
2 changes: 2 additions & 0 deletions lib/recurly/resources/Coupon.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const Resource = require('../Resource')
* @prop {number} maxRedemptions - A maximum number of redemptions for the coupon. The coupon will expire when it hits its maximum redemptions.
* @prop {number} maxRedemptionsPerAccount - Redemptions per account is the number of times a specific account can redeem the coupon. Set redemptions per account to `1` if you want to keep customers from gaming the system and getting more than one discount from the coupon campaign.
* @prop {string} name - The internal name for the coupon.
* @prop {Array.<PlanMini>} plans - A list of plans for which this coupon applies. This will be `null` if `applies_to_all_plans=true`.
* @prop {Array.<string>} plansNames - TODO
* @prop {datetime} redeemBy - The date and time the coupon will expire and can no longer be redeemed. Time is always 11:59:59, the end-of-day Pacific time.
* @prop {string} redemptionResource - Whether the discount is for all eligible charges on the account, or only a specific subscription.
Expand Down Expand Up @@ -57,6 +58,7 @@ class Coupon extends Resource {
maxRedemptions: Number,
maxRedemptionsPerAccount: Number,
name: String,
plans: ['PlanMini'],
plansNames: Array,
redeemBy: Date,
redemptionResource: String,
Expand Down
4 changes: 2 additions & 2 deletions lib/recurly/resources/CouponRedemption.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const Resource = require('../Resource')
* @prop {Coupon} coupon
* @prop {datetime} createdAt - Created at
* @prop {string} currency - 3-letter ISO 4217 currency code.
* @prop {string} discounted - The amount that was discounted upon the application of the coupon, formatted with the currency.
* @prop {number} discounted - The amount that was discounted upon the application of the coupon, formatted with the currency.
* @prop {string} id - Coupon Redemption ID
* @prop {datetime} removedAt - The date and time the redemption was removed from the account (un-redeemed).
* @prop {string} state - Coupon Redemption state
Expand All @@ -29,7 +29,7 @@ class CouponRedemption extends Resource {
coupon: 'Coupon',
createdAt: Date,
currency: String,
discounted: String,
discounted: Number,
id: String,
removedAt: Date,
state: String,
Expand Down
4 changes: 2 additions & 2 deletions lib/recurly/resources/CouponRedemptionMini.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const Resource = require('../Resource')
* @typedef {Object} CouponRedemptionMini
* @prop {CouponMini} coupon
* @prop {datetime} createdAt - Created at
* @prop {string} discounted - The amount that was discounted upon the application of the coupon, formatted with the currency.
* @prop {number} discounted - The amount that was discounted upon the application of the coupon, formatted with the currency.
* @prop {string} id - Coupon Redemption ID
* @prop {string} state - Invoice state
*/
Expand All @@ -23,7 +23,7 @@ class CouponRedemptionMini extends Resource {
return {
coupon: 'CouponMini',
createdAt: Date,
discounted: String,
discounted: Number,
id: String,
state: String
}
Expand Down
2 changes: 2 additions & 0 deletions lib/recurly/resources/Invoice.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const Resource = require('../Resource')
* @prop {string} poNumber - For manual invoicing, this identifies the PO number associated with the subscription.
* @prop {string} previousInvoiceId - On refund invoices, this value will exist and show the invoice ID of the purchase invoice the refund was created from.
* @prop {number} refundableAmount - The refundable amount on a charge invoice. It will be null for all other invoices.
* @prop {ShippingAddress} shippingAddress
* @prop {string} state - Invoice state
* @prop {Array.<string>} subscriptionIds - If the invoice is charging or refunding for one or more subscriptions, these are their IDs.
* @prop {number} subtotal - The summation of charges, discounts, and credits, before tax.
Expand Down Expand Up @@ -68,6 +69,7 @@ class Invoice extends Resource {
poNumber: String,
previousInvoiceId: String,
refundableAmount: Number,
shippingAddress: 'ShippingAddress',
state: String,
subscriptionIds: Array,
subtotal: Number,
Expand Down
2 changes: 1 addition & 1 deletion lib/recurly/resources/LineItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const Resource = require('../Resource')
* @prop {string} subscriptionId - If the line item is a charge or credit for a subscription, this is its ID.
* @prop {number} subtotal - `quantity * unit_amount`
* @prop {number} tax - The tax amount for the line item.
* @prop {string} taxCode - Used by Avalara, Vertex, and Recurly’s EU VAT tax feature. The tax code values are specific to each tax system. If you are using Recurly’s EU VAT feature `P0000000` is `physical`, `D0000000` is `digital`, and an empty string is `unknown`.
* @prop {string} taxCode - Used by Avalara, Vertex, and Recurly’s EU VAT tax feature. The tax code values are specific to each tax system. If you are using Recurly’s EU VAT feature you can use `unknown`, `physical`, or `digital`.
* @prop {boolean} taxExempt - `true` exempts tax on charges, `false` applies tax on charges. If not defined, then defaults to the Plan and Site settings. This attribute does not work for credits (negative line items). Credits are always applied post-tax. Pre-tax discounts should use the Coupons feature.
* @prop {TaxInfo} taxInfo
* @prop {boolean} taxable - `true` if the line item is taxable, `false` if it is not.
Expand Down
4 changes: 3 additions & 1 deletion lib/recurly/resources/PaymentMethod.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const Resource = require('../Resource')
* @prop {string} firstSix - Credit card number's first six digits.
* @prop {string} lastFour - Credit card number's last four digits. Will refer to bank account if payment method is ACH.
* @prop {string} routingNumber - The bank account's routing number. Only present for ACH payment methods.
* @prop {string} routingNumberBank - The bank name of this routing number.
*/
class PaymentMethod extends Resource {
static getSchema () {
Expand All @@ -31,7 +32,8 @@ class PaymentMethod extends Resource {
expYear: Number,
firstSix: String,
lastFour: String,
routingNumber: String
routingNumber: String,
routingNumberBank: String
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/recurly/resources/Plan.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const Resource = require('../Resource')
* @prop {string} name - This name describes your plan and will appear on the Hosted Payment Page and the subscriber's invoice.
* @prop {string} setupFeeAccountingCode - Accounting code for invoice line items for the plan's setup fee. If no value is provided, it defaults to plan's accounting code.
* @prop {string} state - The current state of the plan.
* @prop {string} taxCode - Used by Avalara, Vertex, and Recurly’s EU VAT tax feature. The tax code values are specific to each tax system. If you are using Recurly’s EU VAT feature `P0000000` is `physical`, `D0000000` is `digital`, and an empty string is `unknown`.
* @prop {string} taxCode - Used by Avalara, Vertex, and Recurly’s EU VAT tax feature. The tax code values are specific to each tax system. If you are using Recurly’s EU VAT feature you can use `unknown`, `physical`, or `digital`.
* @prop {boolean} taxExempt - `true` exempts tax on the plan, `false` applies tax on the plan.
* @prop {number} totalBillingCycles - Automatically terminate subscriptions after a defined number of billing cycles. Number of billing cycles before the plan automatically stops renewing, defaults to `null` for continuous, automatic renewal.
* @prop {number} trialLength - Length of plan's trial period in `trial_units`. `0` means `no trial`.
Expand Down
37 changes: 37 additions & 0 deletions lib/recurly/resources/ShippingMethod.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/* 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')

/**
* ShippingMethod
* @typedef {Object} ShippingMethod
* @prop {string} code - The internal name used identify the shipping method.
* @prop {datetime} createdAt - Created at
* @prop {datetime} deletedAt - Deleted at
* @prop {string} id - Shipping Method ID
* @prop {string} name - The name of the shipping method displayed to customers.
* @prop {string} taxCode - Used by Avalara, Vertex, and Recurly’s built-in tax feature. The tax code values are specific to each tax system. If you are using Recurly’s built-in taxes the values are: - `FR` – Common Carrier FOB Destination - `FR022000` – Common Carrier FOB Origin - `FR020400` – Non Common Carrier FOB Destination - `FR020500` – Non Common Carrier FOB Origin - `FR010100` – Delivery by Company Vehicle Before Passage of Title - `FR010200` – Delivery by Company Vehicle After Passage of Title - `NT` – Non-Taxable
* @prop {datetime} updatedAt - Last updated at
*/
class ShippingMethod extends Resource {
static getSchema () {
return {
code: String,
createdAt: Date,
deletedAt: Date,
id: String,
name: String,
taxCode: String,
updatedAt: Date
}
}
}

module.exports = ShippingMethod
29 changes: 29 additions & 0 deletions lib/recurly/resources/ShippingMethodMini.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/* 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')

/**
* ShippingMethodMini
* @typedef {Object} ShippingMethodMini
* @prop {string} code - The internal name used identify the shipping method.
* @prop {string} id - Shipping Method ID
* @prop {string} name - The name of the shipping method displayed to customers.
*/
class ShippingMethodMini extends Resource {
static getSchema () {
return {
code: String,
id: String,
name: String
}
}
}

module.exports = ShippingMethodMini
4 changes: 2 additions & 2 deletions lib/recurly/resources/Subscription.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const Resource = require('../Resource')
* @prop {number} remainingBillingCycles - The remaining billing cycles in the current term.
* @prop {number} remainingPauseCycles - Null unless subscription is paused or will pause at the end of the current billing period.
* @prop {number} renewalBillingCycles - If `auto_renew=true`, when a term completes, `total_billing_cycles` takes this value as the length of subsequent terms. Defaults to the plan's `total_billing_cycles`.
* @prop {ShippingAddress} shippingAddress
* @prop {SubscriptionShipping} shipping
* @prop {string} state - State
* @prop {number} subtotal - Estimated total, before tax.
* @prop {string} termsAndConditions - Terms and conditions
Expand Down Expand Up @@ -84,7 +84,7 @@ class Subscription extends Resource {
remainingBillingCycles: Number,
remainingPauseCycles: Number,
renewalBillingCycles: Number,
shippingAddress: 'ShippingAddress',
shipping: 'SubscriptionShipping',
state: String,
subtotal: Number,
termsAndConditions: String,
Expand Down
2 changes: 2 additions & 0 deletions lib/recurly/resources/SubscriptionChange.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const Resource = require('../Resource')
* @prop {string} id - The ID of the Subscription Change.
* @prop {PlanMini} plan
* @prop {number} quantity - Subscription quantity
* @prop {SubscriptionShipping} shipping
* @prop {string} subscriptionId - The ID of the subscription that is going to be changed.
* @prop {number} unitAmount - Unit amount
* @prop {datetime} updatedAt - Updated at
Expand All @@ -35,6 +36,7 @@ class SubscriptionChange extends Resource {
id: String,
plan: 'PlanMini',
quantity: Number,
shipping: 'SubscriptionShipping',
subscriptionId: String,
unitAmount: Number,
updatedAt: Date
Expand Down
29 changes: 29 additions & 0 deletions lib/recurly/resources/SubscriptionShipping.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/* 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')

/**
* SubscriptionShipping
* @typedef {Object} SubscriptionShipping
* @prop {ShippingAddress} address
* @prop {number} amount - Subscription's shipping cost
* @prop {ShippingMethodMini} method
*/
class SubscriptionShipping extends Resource {
static getSchema () {
return {
address: 'ShippingAddress',
amount: Number,
method: 'ShippingMethodMini'
}
}
}

module.exports = SubscriptionShipping
Loading

0 comments on commit 1e506fd

Please sign in to comment.