Skip to content

Commit

Permalink
Merge pull request #196 from recurly/v3-v2021-02-25-1618003929
Browse files Browse the repository at this point in the history
Generated Latest Changes for v2021-02-25 (Backup Payment Method)
  • Loading branch information
douglasmiller authored Apr 12, 2021
2 parents ec3d2d1 + 36fdc42 commit 27cec31
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 7 deletions.
14 changes: 13 additions & 1 deletion lib/recurly.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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;

}

Expand Down Expand Up @@ -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;
/**
Expand Down
2 changes: 2 additions & 0 deletions lib/recurly/resources/BillingInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -33,6 +34,7 @@ class BillingInfo extends Resource {
return {
accountId: String,
address: 'Address',
backupPaymentMethod: Boolean,
company: String,
createdAt: Date,
firstName: String,
Expand Down
2 changes: 2 additions & 0 deletions lib/recurly/resources/Transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -56,6 +57,7 @@ class Transaction extends Resource {
account: 'AccountMini',
amount: Number,
avsCheck: String,
backupPaymentMethodUsed: Boolean,
billingAddress: 'AddressWithName',
collectedAt: Date,
collectionMethod: String,
Expand Down
30 changes: 24 additions & 6 deletions openapi/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -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:

Expand Down Expand Up @@ -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:

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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?
Expand Down

0 comments on commit 27cec31

Please sign in to comment.