Skip to content

Commit

Permalink
Merge pull request #339 from recurly/v3-v2021-02-25-12325353567
Browse files Browse the repository at this point in the history
Generated Latest Changes for v2021-02-25
  • Loading branch information
cbarton authored Dec 14, 2024
2 parents 4405e23 + eb4229a commit bf7d31f
Show file tree
Hide file tree
Showing 9 changed files with 748 additions and 18 deletions.
234 changes: 229 additions & 5 deletions lib/recurly.d.ts

Large diffs are not rendered by default.

36 changes: 35 additions & 1 deletion lib/recurly/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -2592,7 +2592,22 @@ endpoint to obtain only the newly generated `UniqueCouponCodes`.
}

/**
* List a site's external subscriptions
* Create an external subscription
*
* API docs: {@link https://developers.recurly.com/api/v2021-02-25#operation/create_external_subscription}
*
*
* @param {ExternalSubscriptionCreate} body - The object representing the JSON request to send to the server. It should conform to the schema of {ExternalSubscriptionCreate}
* @return {Promise<ExternalSubscription>} Returns the external subscription
*/
async createExternalSubscription (body, options = {}) {
let path = '/external_subscriptions'
path = this._interpolatePath(path)
return this._makeRequest('POST', path, body, options)
}

/**
* List the external subscriptions on a site
*
* API docs: {@link https://developers.recurly.com/api/v2021-02-25#operation/list_external_subscriptions}
*
Expand Down Expand Up @@ -2626,6 +2641,25 @@ endpoint to obtain only the newly generated `UniqueCouponCodes`.
return this._makeRequest('GET', path, null, options)
}

/**
* Update an external subscription
*
* API docs: {@link https://developers.recurly.com/api/v2021-02-25#operation/put_external_subscription}
*
*
* @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 {ExternalSubscriptionUpdate} options.body - The object representing the JSON request to send to the server. It should conform to the schema of {ExternalSubscriptionUpdate}
* @return {Promise<ExternalSubscription>} Settings for an external subscription.
*/
async putExternalSubscription (externalSubscriptionId, options = {}) {
const body = options['body']
let path = '/external_subscriptions/{external_subscription_id}'
path = this._interpolatePath(path, { 'external_subscription_id': externalSubscriptionId })
return this._makeRequest('PUT', path, body, options)
}

/**
* List the external invoices on an external subscription
*
Expand Down
31 changes: 31 additions & 0 deletions lib/recurly/resources/BusinessEntityMini.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/* 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')

/**
* BusinessEntityMini
* @typedef {Object} BusinessEntityMini
* @prop {string} code - The entity code of the business entity.
* @prop {string} id - Business entity ID
* @prop {string} name - This name describes your business entity and will appear on the invoice.
* @prop {string} object - Object type
*/
class BusinessEntityMini extends Resource {
static getSchema () {
return {
code: String,
id: String,
name: String,
object: String
}
}
}

module.exports = BusinessEntityMini
2 changes: 2 additions & 0 deletions lib/recurly/resources/Subscription.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const Resource = require('../Resource')
* @prop {boolean} autoRenew - Whether the subscription renews at the end of its term.
* @prop {Date} bankAccountAuthorizedAt - Recurring subscriptions paid with ACH will have this attribute set. This timestamp is used for alerting customers to reauthorize in 3 years in accordance with NACHA rules. If a subscription becomes inactive or the billing info is no longer a bank account, this timestamp is cleared.
* @prop {string} billingInfoId - Billing Info ID.
* @prop {string} businessEntityId - The ID of the business entity associated with the subscription. This will be `null` if the subscription relies on resolving the business entity during renewal.
* @prop {Date} canceledAt - Canceled at
* @prop {string} collectionMethod - Collection method
* @prop {Date} convertedAt - When the subscription was converted from a gift card.
Expand Down Expand Up @@ -78,6 +79,7 @@ class Subscription extends Resource {
autoRenew: Boolean,
bankAccountAuthorizedAt: Date,
billingInfoId: String,
businessEntityId: String,
canceledAt: Date,
collectionMethod: String,
convertedAt: Date,
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 @@ -16,6 +16,7 @@ const Resource = require('../Resource')
* @prop {boolean} activated - Returns `true` if the subscription change is activated.
* @prop {Array.<SubscriptionAddOn>} addOns - These add-ons will be used when the subscription renews.
* @prop {SubscriptionChangeBillingInfo} billingInfo - Accept nested attributes for three_d_secure_action_result_token_id
* @prop {BusinessEntityMini} businessEntity - Business entity details
* @prop {Date} createdAt - Created at
* @prop {Array.<CustomField>} customFields - The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
* @prop {Date} deletedAt - Deleted at
Expand All @@ -39,6 +40,7 @@ class SubscriptionChange extends Resource {
activated: Boolean,
addOns: ['SubscriptionAddOn'],
billingInfo: 'SubscriptionChangeBillingInfo',
businessEntity: 'BusinessEntityMini',
createdAt: Date,
customFields: ['CustomField'],
deletedAt: Date,
Expand Down
4 changes: 4 additions & 0 deletions lib/recurly/resources/Transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ const Resource = require('../Resource')
* @prop {number} gatewayResponseTime - Time, in seconds, for gateway to process the transaction.
* @prop {Object} gatewayResponseValues - The values in this field will vary from gateway to gateway.
* @prop {string} id - Transaction ID
* @prop {string} indicator - Must be sent for one-time transactions in order to provide context on which entity is submitting the transaction to ensure proper fraud checks are observed, such as 3DS. If the customer is in session, send `customer`. If this is a merchant initiated one-time transaction, send `merchant`.
* @prop {InvoiceMini} invoice - Invoice mini details
* @prop {string} ipAddressCountry - Origin IP address country, 2-letter ISO 3166-1 alpha-2 code, if known by Recurly.
* @prop {string} ipAddressV4 - IP address provided when the billing information was collected: - When the customer enters billing information into the Recurly.js or Hosted Payment Pages, Recurly records the IP address. - When the merchant enters billing information using the API, the merchant may provide an IP address. - When the merchant enters billing information using the UI, no IP address is recorded.
* @prop {string} merchantReasonCode - This conditional parameter is useful for merchants in specific industries who need to submit one-time Merchant Initiated transactions in specific cases. Not all gateways support these methods, but will support a generic one-time Merchant Initiated transaction. Only use this if the initiator value is "merchant". Otherwise, it will be ignored. - Incremental: Send `incremental` with an additional purchase if the original authorization amount is not sufficient to cover the costs of your service or product. For example, if the customer adds goods or services or there are additional expenses. - No Show: Send `no_show` if you charge customers a fee due to an agreed-upon cancellation policy in your industry. - Resubmission: Send `resubmission` if you need to attempt collection on a declined transaction. You may also use the force collection behavior which has the same effect. - Service Extension: Send `service_extension` if you are in a service industry and the customer has increased/extended their service in some way. For example: adding a day onto a car rental agreement. - Split Shipment: Send `split_shipment` if you sell physical product and need to split up a shipment into multiple transactions when the customer is no longer in session. - Top Up: Send `top_up` if you process one-time transactions based on a pre-arranged agreement with your customer where there is a pre-arranged account balance that needs maintaining. For example, if the customer has agreed to maintain an account balance of 30.00 and their current balance is 20.00, the MIT amount would be at least 10.00 to meet that 30.00 threshold.
* @prop {string} object - Object type
* @prop {string} origin - Describes how the transaction was triggered.
* @prop {string} originalTransactionId - If this transaction is a refund (`type=refund`), this will be the ID of the original transaction on the invoice being refunded.
Expand Down Expand Up @@ -78,9 +80,11 @@ class Transaction extends Resource {
gatewayResponseTime: Number,
gatewayResponseValues: Object,
id: String,
indicator: String,
invoice: 'InvoiceMini',
ipAddressCountry: String,
ipAddressV4: String,
merchantReasonCode: String,
object: String,
origin: String,
originalTransactionId: String,
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 @@ -64,6 +64,7 @@ module.exports.SubscriptionAddOn = require('./SubscriptionAddOn')
module.exports.AddOnMini = require('./AddOnMini')
module.exports.SubscriptionAddOnTier = require('./SubscriptionAddOnTier')
module.exports.SubscriptionAddOnPercentageTier = require('./SubscriptionAddOnPercentageTier')
module.exports.BusinessEntityMini = require('./BusinessEntityMini')
module.exports.SubscriptionChangeBillingInfo = require('./SubscriptionChangeBillingInfo')
module.exports.SubscriptionRampIntervalResponse = require('./SubscriptionRampIntervalResponse')
module.exports.UniqueCouponCodeParams = require('./UniqueCouponCodeParams')
Expand Down
Loading

0 comments on commit bf7d31f

Please sign in to comment.