From 36fdc42862be58faa82ef27f34dfbcd49bbd6b1e Mon Sep 17 00:00:00 2001 From: DX Codefresh Date: Fri, 9 Apr 2021 21:42:14 +0000 Subject: [PATCH] Generated Latest Changes for v2021-02-25 --- lib/recurly.d.ts | 14 ++++++++++++- lib/recurly/resources/BillingInfo.js | 2 ++ lib/recurly/resources/Transaction.js | 2 ++ openapi/api.yaml | 30 ++++++++++++++++++++++------ 4 files changed, 41 insertions(+), 7 deletions(-) diff --git a/lib/recurly.d.ts b/lib/recurly.d.ts index 6f184a21..27fa4574 100644 --- a/lib/recurly.d.ts +++ b/lib/recurly.d.ts @@ -281,6 +281,10 @@ export declare class BillingInfo { * The `primary_payment_method` indicator is used to designate the primary billing info on the account. The first billing info created on an account will always become primary. Adding additional billing infos provides the flexibility to mark another billing info as primary, or adding additional non-primary billing infos. This can be accomplished by passing the `primary_payment_method` indicator. When adding billing infos via the billing_info and /accounts endpoints, this value is not permitted, and will return an error if provided. */ primaryPaymentMethod?: boolean | null; + /** + * The `backup_payment_method` indicator is used to designate a billing info as a backup on the account that will be tried if the billing info marked `primary_payment_method` fails. + */ + backupPaymentMethod?: boolean | null; /** * When the billing information was created. */ @@ -931,6 +935,10 @@ export declare class Transaction { * Did this transaction complete successfully? */ success?: boolean | null; + /** + * Indicates if the transaction was completed using a backup payment + */ + backupPaymentMethodUsed?: boolean | null; /** * Indicates if part or all of this transaction was refunded. */ @@ -2910,6 +2918,10 @@ export interface BillingInfoCreate { * The `primary_payment_method` indicator is used to designate the primary billing info on the account. The first billing info created on an account will always become primary. Adding additional billing infos provides the flexibility to mark another billing info as primary, or adding additional non-primary billing infos. This can be accomplished by passing the `primary_payment_method` indicator. When adding billing infos via the billing_info and /accounts endpoints, this value is not permitted, and will return an error if provided. */ primaryPaymentMethod?: boolean | null; + /** + * The `backup_payment_method` indicator is used to designate a billing info as a backup on the account that will be tried if the billing info marked `primary_payment_method` fails. All payment methods, including the billing info marked `primary_payment_method` can be set as a backup. An account can have a maximum of 1 backup, if a user sets a different payment method as a backup, the existing backup will no longer be marked as such. + */ + backupPaymentMethod?: boolean | null; } @@ -4623,7 +4635,7 @@ export interface SubscriptionPurchase { */ planId?: string | null; /** - * Override the unit amount of the subscription plan by setting this value in cents. If not provided, the subscription will inherit the price from the subscription plan for the provided currency. + * Override the unit amount of the subscription plan by setting this value. If not provided, the subscription will inherit the price from the subscription plan for the provided currency. */ unitAmount?: number | null; /** diff --git a/lib/recurly/resources/BillingInfo.js b/lib/recurly/resources/BillingInfo.js index 2aa2cea0..2f94d494 100644 --- a/lib/recurly/resources/BillingInfo.js +++ b/lib/recurly/resources/BillingInfo.js @@ -14,6 +14,7 @@ const Resource = require('../Resource') * @typedef {Object} BillingInfo * @prop {string} accountId * @prop {Address} address + * @prop {boolean} backupPaymentMethod - The `backup_payment_method` indicator is used to designate a billing info as a backup on the account that will be tried if the billing info marked `primary_payment_method` fails. * @prop {string} company * @prop {Date} createdAt - When the billing information was created. * @prop {string} firstName @@ -33,6 +34,7 @@ class BillingInfo extends Resource { return { accountId: String, address: 'Address', + backupPaymentMethod: Boolean, company: String, createdAt: Date, firstName: String, diff --git a/lib/recurly/resources/Transaction.js b/lib/recurly/resources/Transaction.js index c3343aae..01af4f3d 100644 --- a/lib/recurly/resources/Transaction.js +++ b/lib/recurly/resources/Transaction.js @@ -15,6 +15,7 @@ const Resource = require('../Resource') * @prop {AccountMini} account - Account mini details * @prop {number} amount - Total transaction amount sent to the payment gateway. * @prop {string} avsCheck - When processed, result from checking the overall AVS on the transaction. + * @prop {boolean} backupPaymentMethodUsed - Indicates if the transaction was completed using a backup payment * @prop {AddressWithName} billingAddress * @prop {Date} collectedAt - Collected at, or if not collected yet, the time the transaction was created. * @prop {string} collectionMethod - The method by which the payment was collected. @@ -56,6 +57,7 @@ class Transaction extends Resource { account: 'AccountMini', amount: Number, avsCheck: String, + backupPaymentMethodUsed: Boolean, billingAddress: 'AddressWithName', collectedAt: Date, collectionMethod: String, diff --git a/openapi/api.yaml b/openapi/api.yaml index 602e4223..436c414b 100644 --- a/openapi/api.yaml +++ b/openapi/api.yaml @@ -2033,7 +2033,7 @@ paths: description: | If you're using Recurly.js to securely submit data from webforms without sending it through your server, you can associate the billing information with an account by passing in the `token_id`. The only other - field permitted with `token_id` is `primary_payment_method`. + fields permitted with `token_id` are `primary_payment_method` and/or `backup_payment_method`. For credit card payments you'll need the following required fields: @@ -2350,7 +2350,7 @@ paths: description: | If you're using Recurly.js to securely submit data from webforms without sending it through your server, you can associate the billing information with an account by passing in the `token_id`. The only other - field permitted with `token_id` is `primary_payment_method`. + fields permitted with `token_id` are `primary_payment_method` and/or `backup_payment_method`. For credit card payments you'll need the following required fields: @@ -2434,7 +2434,7 @@ paths: description: | If you're using Recurly.js to securely submit data from webforms without sending it through your server, you can associate the billing information with an account by passing in the `token_id`. The only other - field permitted with `token_id` is `primary_payment_method`. + fields permitted with `token_id` are `primary_payment_method` and/or `backup_payment_method`. For credit card payments you'll need the following required fields: @@ -16037,6 +16037,11 @@ components: the `primary_payment_method` indicator. When adding billing infos via the billing_info and /accounts endpoints, this value is not permitted, and will return an error if provided. + backup_payment_method: + type: boolean + description: The `backup_payment_method` indicator is used to designate + a billing info as a backup on the account that will be tried if the billing + info marked `primary_payment_method` fails. created_at: type: string format: date-time @@ -16151,9 +16156,9 @@ components: a consumer card in Brazil. This would be the customer's CPF, CPF is a Brazilian tax identifier for all tax paying residents. tax_identifier_type: - "$ref": "#/components/schemas/TaxIdentifierTypeEnum" description: this field and a value of 'cpf' are required if adding a billing info that is an elo or hipercard type in Brazil. + "$ref": "#/components/schemas/TaxIdentifierTypeEnum" primary_payment_method: type: boolean title: Primary Payment Method @@ -16165,6 +16170,15 @@ components: the `primary_payment_method` indicator. When adding billing infos via the billing_info and /accounts endpoints, this value is not permitted, and will return an error if provided. + backup_payment_method: + type: boolean + description: The `backup_payment_method` indicator is used to designate + a billing info as a backup on the account that will be tried if the billing + info marked `primary_payment_method` fails. All payment methods, including + the billing info marked `primary_payment_method` can be set as a backup. + An account can have a maximum of 1 backup, if a user sets a different + payment method as a backup, the existing backup will no longer be marked + as such. Coupon: type: object properties: @@ -19863,8 +19877,8 @@ components: format: float title: Custom subscription pricing description: Override the unit amount of the subscription plan by setting - this value in cents. If not provided, the subscription will inherit the - price from the subscription plan for the provided currency. + this value. If not provided, the subscription will inherit the price from + the subscription plan for the provided currency. minimum: 0 maximum: 1000000 quantity: @@ -20188,6 +20202,10 @@ components: type: boolean title: Success? description: Did this transaction complete successfully? + backup_payment_method_used: + type: boolean + title: Backup Payment Method Used? + description: Indicates if the transaction was completed using a backup payment refunded: type: boolean title: Refunded?