From af1562cb1ae71465f97bbcbc644f8931a1796ca1 Mon Sep 17 00:00:00 2001 From: Recurly Integrations Date: Wed, 6 Dec 2023 16:43:31 +0000 Subject: [PATCH] Generated Latest Changes for v2021-02-25 --- lib/recurly.d.ts | 105 ++++++++++- lib/recurly/Client.js | 39 ++++ lib/recurly/resources/ExternalPaymentPhase.js | 53 ++++++ lib/recurly/resources/Invoice.js | 2 +- lib/recurly/resources/LineItem.js | 2 +- lib/recurly/resources/Subscription.js | 4 +- lib/recurly/resources/index.js | 1 + openapi/api.yaml | 168 ++++++++++++++++++ package-lock.json | 4 +- 9 files changed, 368 insertions(+), 10 deletions(-) create mode 100644 lib/recurly/resources/ExternalPaymentPhase.js diff --git a/lib/recurly.d.ts b/lib/recurly.d.ts index 9a19e3a1..9107fdda 100644 --- a/lib/recurly.d.ts +++ b/lib/recurly.d.ts @@ -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; /** @@ -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; /** @@ -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; /** @@ -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 @@ -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. */ @@ -10313,6 +10381,35 @@ endpoint to obtain only the newly generated `UniqueCouponCodes`. * @return {Promise} Returns the external invoice */ showExternalInvoice(externalInvoiceId: string): Promise; + /** + * 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} A list of the the external_payment_phases on a site. + */ + listExternalSubscriptionExternalPaymentPhases(externalSubscriptionId: string, options?: object): Pager; + /** + * 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} Details for an external payment_phase. + */ + getExternalSubscriptionExternalPaymentPhase(externalSubscriptionId: string, externalPaymentPhaseId: string): Promise; /** * List entitlements granted to an account * diff --git a/lib/recurly/Client.js b/lib/recurly/Client.js index 25554e0d..fe8cea2b 100644 --- a/lib/recurly/Client.js +++ b/lib/recurly/Client.js @@ -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} 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} 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 * diff --git a/lib/recurly/resources/ExternalPaymentPhase.js b/lib/recurly/resources/ExternalPaymentPhase.js new file mode 100644 index 00000000..8d503623 --- /dev/null +++ b/lib/recurly/resources/ExternalPaymentPhase.js @@ -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 diff --git a/lib/recurly/resources/Invoice.js b/lib/recurly/resources/Invoice.js index ca35c19c..ec55d15e 100644 --- a/lib/recurly/resources/Invoice.js +++ b/lib/recurly/resources/Invoice.js @@ -45,7 +45,7 @@ const Resource = require('../Resource') * @prop {Array.} 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.} transactions - Transactions diff --git a/lib/recurly/resources/LineItem.js b/lib/recurly/resources/LineItem.js index 6f0bede7..c19b944e 100644 --- a/lib/recurly/resources/LineItem.js +++ b/lib/recurly/resources/LineItem.js @@ -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. diff --git a/lib/recurly/resources/Subscription.js b/lib/recurly/resources/Subscription.js index bc2b81fb..fe9c9dca 100644 --- a/lib/recurly/resources/Subscription.js +++ b/lib/recurly/resources/Subscription.js @@ -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. diff --git a/lib/recurly/resources/index.js b/lib/recurly/resources/index.js index 4d1bc6fd..fef3d413 100644 --- a/lib/recurly/resources/index.js +++ b/lib/recurly/resources/index.js @@ -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') diff --git a/openapi/api.yaml b/openapi/api.yaml index fe2608a2..c9e015a8 100644 --- a/openapi/api.yaml +++ b/openapi/api.yaml @@ -207,6 +207,7 @@ x-tagGroups: - external_products - external_accounts - external_product_references + - external_payment_phases - name: Products and Promotions tags: - item @@ -366,6 +367,11 @@ tags: x-displayName: External Product Reference description: Associates an external product to a corresponding resource on an external platform like the Apple App Store or Google Play Store. +- name: external_payment_phases + x-displayName: External Payment Phase + description: Details of payments in the lifecycle of a subscription from an external + resource that is not managed by the Recurly platform, e.g. App Store or Google + Play Store. - name: gift_cards x-displayName: Gift Cards description: Add gift card purchases to your checkout and allow gift card recipients @@ -15918,6 +15924,69 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: [] + "/external_subscriptions/{external_subscription_id}/external_payment_phases": + parameters: + - "$ref": "#/components/parameters/external_subscription_id" + get: + tags: + - external_subscriptions + operationId: list_external_subscription_external_payment_phases + summary: List the external payment phases on an external subscription + description: See the [Pagination Guide](/developers/guides/pagination.html) + to learn how to use pagination in the API and Client Libraries. + parameters: + - "$ref": "#/components/parameters/sort_dates" + - "$ref": "#/components/parameters/limit" + - "$ref": "#/components/parameters/order" + responses: + '200': + description: A list of the the external_payment_phases on a site. + content: + application/json: + schema: + "$ref": "#/components/schemas/ExternalPaymentPhaseList" + '404': + description: Incorrect site. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + default: + description: Unexpected error. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + x-code-samples: [] + "/external_subscriptions/{external_subscription_id}/external_payment_phases/{external_payment_phase_id}": + parameters: + - "$ref": "#/components/parameters/external_subscription_id" + - "$ref": "#/components/parameters/external_payment_phase_id" + get: + tags: + - external_payment_phases + operationId: get_external_subscription_external_payment_phase + summary: Fetch an external payment_phase + responses: + '200': + description: Details for an external payment_phase. + content: + application/json: + schema: + "$ref": "#/components/schemas/ExternalPaymentPhase" + '404': + description: Incorrect site or external subscription ID. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + default: + description: Unexpected error. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + x-code-samples: [] "/accounts/{account_id}/entitlements": parameters: - "$ref": "#/components/parameters/account_id" @@ -16355,6 +16424,13 @@ components: required: true schema: type: string + external_payment_phase_id: + name: external_payment_phase_id + in: path + description: External payment phase ID, e.g. `a34ypb2ef9w1`. + required: true + schema: + type: string invoice_template_id: name: invoice_template_id in: path @@ -21633,6 +21709,7 @@ components: type: number format: float title: Estimated tax + description: Only for merchants using Recurly's In-The-Box taxes. tax_info: "$ref": "#/components/schemas/TaxInfo" total: @@ -22464,6 +22541,12 @@ components: default: 0 net_terms_type: "$ref": "#/components/schemas/NetTermsTypeEnum" + gateway_code: + type: string + title: Gateway Code + description: If present, this subscription's transactions will use the payment + gateway with this code. + maxLength: 13 transaction_type: description: An optional type designation for the payment gateway transaction created by this request. Supports 'moto' value, which is the acronym for @@ -22805,6 +22888,7 @@ components: TaxInfo: type: object title: Tax info + description: Only for merchants using Recurly's In-The-Box taxes. properties: type: type: string @@ -23646,6 +23730,90 @@ components: type: string format: date-time description: Time the object was last updated + ExternalPaymentPhase: + type: object + description: Details of payments in the lifecycle of a subscription from an + external resource that is not managed by the Recurly platform, e.g. App Store + or Google Play Store. + properties: + id: + type: string + title: External payment phase ID + description: System-generated unique identifier for an external payment + phase ID, e.g. `e28zov4fw0v2`. + object: + type: string + title: Object type + external_subscription: + "$ref": "#/components/schemas/ExternalSubscription" + started_at: + type: string + format: date-time + title: Started At + ends_at: + type: string + format: date-time + title: Ends At + starting_billing_period_index: + type: integer + title: Starting Billing Period Index + ending_billing_period_index: + type: integer + title: Ending Billing Period Index + offer_type: + type: string + title: Offer Type + description: Type of discount offer given, e.g. "FREE_TRIAL" + offer_name: + type: string + title: Offer Name + description: Name of the discount offer given, e.g. "introductory" + period_count: + type: integer + title: Period Count + description: Number of billing periods + period_length: + type: string + title: Period Length + description: Billing cycle length + amount: + type: string + format: decimal + title: Amount + minimum: 0 + description: Allows up to 9 decimal places + currency: + type: string + title: Currency + description: 3-letter ISO 4217 currency code. + maxLength: 3 + created_at: + type: string + format: date-time + title: Created at + description: When the external subscription was created in Recurly. + updated_at: + type: string + format: date-time + title: Updated at + description: When the external subscription was updated in Recurly. + ExternalPaymentPhaseList: + type: object + properties: + object: + type: string + title: Object type + description: Will always be List. + has_more: + type: boolean + description: Indicates there are more results on subsequent pages. + next: + type: string + description: Path to subsequent page of results. + data: + type: array + items: + "$ref": "#/components/schemas/ExternalPaymentPhase" ExternalProduct: type: object description: Product from an external resource such as Apple App Store or Google diff --git a/package-lock.json b/package-lock.json index 06e0f802..12f96eef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "recurly", - "version": "4.42.0", + "version": "4.43.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "recurly", - "version": "4.42.0", + "version": "4.43.0", "license": "MIT", "devDependencies": { "@types/node": "^12.11.1",