Skip to content

Commit

Permalink
Merge pull request #318 from recurly/v3-v2021-02-25-7117510228
Browse files Browse the repository at this point in the history
Generated Latest Changes for v2021-02-25 (External Payment Phases)
  • Loading branch information
ELepolt authored Dec 6, 2023
2 parents 0e685e3 + af1562c commit db12ad8
Show file tree
Hide file tree
Showing 9 changed files with 368 additions and 10 deletions.
105 changes: 101 additions & 4 deletions lib/recurly.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1465,7 +1465,7 @@ export declare class Invoice {
*/
balance?: number | null;
/**
* Tax info
* Only for merchants using Recurly's In-The-Box taxes.
*/
taxInfo?: TaxInfo | null;
/**
Expand Down Expand Up @@ -1809,7 +1809,7 @@ export declare class LineItem {
*/
taxCode?: string | null;
/**
* Tax info
* Only for merchants using Recurly's In-The-Box taxes.
*/
taxInfo?: TaxInfo | null;
/**
Expand Down Expand Up @@ -2019,11 +2019,11 @@ export declare class Subscription {
*/
subtotal?: number | null;
/**
* Estimated tax
* Only for merchants using Recurly's In-The-Box taxes.
*/
tax?: number | null;
/**
* Tax info
* Only for merchants using Recurly's In-The-Box taxes.
*/
taxInfo?: TaxInfo | null;
/**
Expand Down Expand Up @@ -3446,6 +3446,70 @@ export declare class InvoiceTemplate {

}

export declare class ExternalPaymentPhase {
/**
* System-generated unique identifier for an external payment phase ID, e.g. `e28zov4fw0v2`.
*/
id?: string | null;
/**
* Object type
*/
object?: string | null;
/**
* Subscription from an external resource such as Apple App Store or Google Play Store.
*/
externalSubscription?: ExternalSubscription | null;
/**
* Started At
*/
startedAt?: Date | null;
/**
* Ends At
*/
endsAt?: Date | null;
/**
* Starting Billing Period Index
*/
startingBillingPeriodIndex?: number | null;
/**
* Ending Billing Period Index
*/
endingBillingPeriodIndex?: number | null;
/**
* Type of discount offer given, e.g. "FREE_TRIAL"
*/
offerType?: string | null;
/**
* Name of the discount offer given, e.g. "introductory"
*/
offerName?: string | null;
/**
* Number of billing periods
*/
periodCount?: number | null;
/**
* Billing cycle length
*/
periodLength?: string | null;
/**
* Allows up to 9 decimal places
*/
amount?: string | null;
/**
* 3-letter ISO 4217 currency code.
*/
currency?: string | null;
/**
* When the external subscription was created in Recurly.
*/
createdAt?: Date | null;
/**
* When the external subscription was updated in Recurly.
*/
updatedAt?: Date | null;

}

export declare class Entitlements {
/**
* Object Type
Expand Down Expand Up @@ -5496,6 +5560,10 @@ export interface SubscriptionCreate {
* Optionally supplied string that may be either `net` or `eom` (end-of-month). When `net`, an invoice becomes past due the specified number of `Net Terms` days from the current date. When `eom` an invoice becomes past due the specified number of `Net Terms` days from the last day of the current month. This field is only available when the EOM Net Terms feature is enabled.
*/
netTermsType?: string | null;
/**
* If present, this subscription's transactions will use the payment gateway with this code.
*/
gatewayCode?: string | null;
/**
* An optional type designation for the payment gateway transaction created by this request. Supports 'moto' value, which is the acronym for mail order and telephone transactions.
*/
Expand Down Expand Up @@ -10313,6 +10381,35 @@ endpoint to obtain only the newly generated `UniqueCouponCodes`.
* @return {Promise<ExternalInvoice>} Returns the external invoice
*/
showExternalInvoice(externalInvoiceId: string): Promise<ExternalInvoice>;
/**
* List the external payment phases on an external subscription
*
* API docs: https://developers.recurly.com/api/v2021-02-25#operation/list_external_subscription_external_payment_phases
*
*
* @param {string} externalSubscriptionId - External subscription id
* @param {Object} options - Optional configurations for the request
* @param {Object} options.params - The optional url parameters for this request.
* @param {string} options.params.sort - Sort field. You *really* only want to sort by `updated_at` in ascending
* order. In descending order updated records will move behind the cursor and could
* prevent some records from being returned.
*
* @param {number} options.params.limit - Limit number of records 1-200.
* @param {string} options.params.order - Sort order.
* @return {Pager<ExternalPaymentPhase>} A list of the the external_payment_phases on a site.
*/
listExternalSubscriptionExternalPaymentPhases(externalSubscriptionId: string, options?: object): Pager<ExternalPaymentPhase>;
/**
* Fetch an external payment_phase
*
* API docs: https://developers.recurly.com/api/v2021-02-25#operation/get_external_subscription_external_payment_phase
*
*
* @param {string} externalSubscriptionId - External subscription id
* @param {string} externalPaymentPhaseId - External payment phase ID, e.g. `a34ypb2ef9w1`.
* @return {Promise<ExternalPaymentPhase>} Details for an external payment_phase.
*/
getExternalSubscriptionExternalPaymentPhase(externalSubscriptionId: string, externalPaymentPhaseId: string): Promise<ExternalPaymentPhase>;
/**
* List entitlements granted to an account
*
Expand Down
39 changes: 39 additions & 0 deletions lib/recurly/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -4906,6 +4906,45 @@ endpoint to obtain only the newly generated `UniqueCouponCodes`.
return this._makeRequest('GET', path, null, options)
}

/**
* List the external payment phases on an external subscription
*
* API docs: {@link https://developers.recurly.com/api/v2021-02-25#operation/list_external_subscription_external_payment_phases}
*
*
* @param {string} externalSubscriptionId - External subscription id
* @param {Object} options - Optional configurations for the request
* @param {Object} options.params - The optional url parameters for this request.
* @param {string} options.params.sort - Sort field. You *really* only want to sort by `updated_at` in ascending
* order. In descending order updated records will move behind the cursor and could
* prevent some records from being returned.
*
* @param {number} options.params.limit - Limit number of records 1-200.
* @param {string} options.params.order - Sort order.
* @return {Pager<ExternalPaymentPhase>} A list of the the external_payment_phases on a site.
*/
listExternalSubscriptionExternalPaymentPhases (externalSubscriptionId, options = {}) {
let path = '/external_subscriptions/{external_subscription_id}/external_payment_phases'
path = this._interpolatePath(path, { 'external_subscription_id': externalSubscriptionId })
return new Pager(this, path, options)
}

/**
* Fetch an external payment_phase
*
* API docs: {@link https://developers.recurly.com/api/v2021-02-25#operation/get_external_subscription_external_payment_phase}
*
*
* @param {string} externalSubscriptionId - External subscription id
* @param {string} externalPaymentPhaseId - External payment phase ID, e.g. `a34ypb2ef9w1`.
* @return {Promise<ExternalPaymentPhase>} Details for an external payment_phase.
*/
async getExternalSubscriptionExternalPaymentPhase (externalSubscriptionId, externalPaymentPhaseId, options = {}) {
let path = '/external_subscriptions/{external_subscription_id}/external_payment_phases/{external_payment_phase_id}'
path = this._interpolatePath(path, { 'external_subscription_id': externalSubscriptionId, 'external_payment_phase_id': externalPaymentPhaseId })
return this._makeRequest('GET', path, null, options)
}

/**
* List entitlements granted to an account
*
Expand Down
53 changes: 53 additions & 0 deletions lib/recurly/resources/ExternalPaymentPhase.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/* 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')

/**
* ExternalPaymentPhase
* @typedef {Object} ExternalPaymentPhase
* @prop {string} amount - Allows up to 9 decimal places
* @prop {Date} createdAt - When the external subscription was created in Recurly.
* @prop {string} currency - 3-letter ISO 4217 currency code.
* @prop {number} endingBillingPeriodIndex - Ending Billing Period Index
* @prop {Date} endsAt - Ends At
* @prop {ExternalSubscription} externalSubscription - Subscription from an external resource such as Apple App Store or Google Play Store.
* @prop {string} id - System-generated unique identifier for an external payment phase ID, e.g. `e28zov4fw0v2`.
* @prop {string} object - Object type
* @prop {string} offerName - Name of the discount offer given, e.g. "introductory"
* @prop {string} offerType - Type of discount offer given, e.g. "FREE_TRIAL"
* @prop {number} periodCount - Number of billing periods
* @prop {string} periodLength - Billing cycle length
* @prop {Date} startedAt - Started At
* @prop {number} startingBillingPeriodIndex - Starting Billing Period Index
* @prop {Date} updatedAt - When the external subscription was updated in Recurly.
*/
class ExternalPaymentPhase extends Resource {
static getSchema () {
return {
amount: String,
createdAt: Date,
currency: String,
endingBillingPeriodIndex: Number,
endsAt: Date,
externalSubscription: 'ExternalSubscription',
id: String,
object: String,
offerName: String,
offerType: String,
periodCount: Number,
periodLength: String,
startedAt: Date,
startingBillingPeriodIndex: Number,
updatedAt: Date
}
}
}

module.exports = ExternalPaymentPhase
2 changes: 1 addition & 1 deletion lib/recurly/resources/Invoice.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const Resource = require('../Resource')
* @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 and credits, before discounts and taxes.
* @prop {number} tax - The total tax on this invoice.
* @prop {TaxInfo} taxInfo - Tax info
* @prop {TaxInfo} taxInfo - Only for merchants using Recurly's In-The-Box taxes.
* @prop {string} termsAndConditions - This will default to the Terms and Conditions text specified on the Invoice Settings page in your Recurly admin. Specify custom notes to add or override Terms and Conditions.
* @prop {number} total - The final total on this invoice. The summation of invoice charges, discounts, credits, and tax.
* @prop {Array.<Transaction>} transactions - Transactions
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 @@ -58,7 +58,7 @@ const Resource = require('../Resource')
* @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 {boolean} taxInclusive - Determines whether or not tax is included in the unit amount. The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing feature) must be enabled to utilize this flag.
* @prop {TaxInfo} taxInfo - Tax info
* @prop {TaxInfo} taxInfo - Only for merchants using Recurly's In-The-Box taxes.
* @prop {boolean} taxable - `true` if the line item is taxable, `false` if it is not.
* @prop {string} type - Charges are positive line items that debit the account. Credits are negative line items that credit the account.
* @prop {number} unitAmount - Positive amount for a charge, negative amount for a credit.
Expand Down
4 changes: 2 additions & 2 deletions lib/recurly/resources/Subscription.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ const Resource = require('../Resource')
* @prop {boolean} startedWithGift - Whether the subscription was started with a gift certificate.
* @prop {string} state - State
* @prop {number} subtotal - Estimated total, before tax.
* @prop {number} tax - Estimated tax
* @prop {number} tax - Only for merchants using Recurly's In-The-Box taxes.
* @prop {boolean} taxInclusive - Determines whether or not tax is included in the unit amount. The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing feature) must be enabled to utilize this flag.
* @prop {TaxInfo} taxInfo - Tax info
* @prop {TaxInfo} taxInfo - Only for merchants using Recurly's In-The-Box taxes.
* @prop {string} termsAndConditions - Terms and conditions
* @prop {number} total - Estimated total
* @prop {number} totalBillingCycles - The number of cycles/billing periods in a term. When `remaining_billing_cycles=0`, if `auto_renew=true` the subscription will renew and a new term will begin, otherwise the subscription will expire.
Expand Down
1 change: 1 addition & 0 deletions lib/recurly/resources/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ module.exports.DunningCycle = require('./DunningCycle')
module.exports.DunningInterval = require('./DunningInterval')
module.exports.DunningCampaignsBulkUpdateResponse = require('./DunningCampaignsBulkUpdateResponse')
module.exports.InvoiceTemplate = require('./InvoiceTemplate')
module.exports.ExternalPaymentPhase = require('./ExternalPaymentPhase')
module.exports.Entitlements = require('./Entitlements')
module.exports.Entitlement = require('./Entitlement')
module.exports.CustomerPermission = require('./CustomerPermission')
Expand Down
Loading

0 comments on commit db12ad8

Please sign in to comment.