Skip to content

Commit

Permalink
Changes generated by da170515b03deb0b1bce13292a8b19ae3069f17f
Browse files Browse the repository at this point in the history
  • Loading branch information
gocardless-robot committed Dec 4, 2024
1 parent afdd267 commit 13044b4
Show file tree
Hide file tree
Showing 5 changed files with 223 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gocardless-nodejs",
"version": "4.2.0",
"version": "4.3.0",
"description": "Node.js client for the GoCardless API - a powerful, simple solution for the collection of recurring bank-to-bank payments",
"author": "GoCardless Ltd <[email protected]>",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ enum Environments {
Sandbox = 'SANDBOX',
}

const CLIENT_VERSION = '4.2.0';
const CLIENT_VERSION = '4.3.0';
const API_VERSION = '2015-07-06';

export { Environments, CLIENT_VERSION, API_VERSION };
6 changes: 6 additions & 0 deletions src/services/billingRequestService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ interface BillingRequestCreateRequest {

fallback_enabled?: boolean;

//
instalment_schedule_request?: Types.BillingRequestInstalmentScheduleRequest;

// Resources linked to this BillingRequest.
links?: Types.BillingRequestCreateRequestLinks;

Expand All @@ -44,6 +47,9 @@ interface BillingRequestCreateRequest {
// and `other` are supported.

purpose_code?: Types.BillingRequestPurposeCode;

//
subscription_request?: Types.BillingRequestSubscriptionRequest;
}

interface BillingRequestCollectCustomerDetailsRequest {
Expand Down
215 changes: 213 additions & 2 deletions src/types/Types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,15 @@ export interface BillingRequest {
// for more information.
fallback_enabled?: boolean;

// True if the billing request was completed with direct debit.
fallback_occurred?: boolean;

// Unique identifier, beginning with "BRQ".
id: string;

// Request for an instalment schedule
instalment_schedule_request?: BillingRequestInstalmentScheduleRequest | null;

// Resources linked to this BillingRequest.
links?: BillingRequestLinks;

Expand Down Expand Up @@ -163,6 +169,9 @@ export interface BillingRequest {
// used</li>
// </ul>
status?: BillingRequestStatus;

// Request for a subscription
subscription_request?: BillingRequestSubscriptionRequest | null;
}

/** Type for a billingrequestcreaterequestlinks resource. */
Expand Down Expand Up @@ -388,6 +397,81 @@ export enum BillingRequestActionType {
SelectInstitution = 'select_institution',
}

/** Type for a billingrequestinstalmentschedulerequest resource. */
export interface BillingRequestInstalmentScheduleRequest {
// The amount to be deducted from each payment as an app fee, to be paid to
// the partner integration which created the subscription, in the lowest
// denomination for the currency (e.g. pence in GBP, cents in EUR).
app_fee?: string | null;

// [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency
// code. Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD"
// are supported.
currency?: BillingRequestInstalmentScheduleRequestCurrency;

// instalments to be created. See [create (with
// dates)](#instalment-schedules-create-with-dates) and [create (with
// schedule)](#instalment-schedules-create-with-schedule) for more information
// on how to specify instalments.
instalments?: string | null[];

// Resources linked to this BillingRequestInstalmentScheduleRequest.
links?: BillingRequestInstalmentScheduleRequestLinks;

// Key-value store of custom data. Up to 3 keys are permitted, with key names
// up to 50 characters and values up to 500 characters.
metadata?: JsonMap;

// Name of the instalment schedule, up to 100 chars. This name will also be
// copied to the payments of the instalment schedule if you use schedule-based
// creation.
name?: string;

// An optional payment reference. This will be set as the reference on each
// payment
// created and will appear on your customer's bank statement. See the
// documentation for
// the [create payment endpoint](#payments-create-a-payment) for more details.
// <br />
payment_reference?: string | null;

// On failure, automatically retry payments using [intelligent
// retries](#success-intelligent-retries). Default is `false`. <p
// class="notice"><strong>Important</strong>: To be able to use intelligent
// retries, Success+ needs to be enabled in [GoCardless
// dashboard](https://manage.gocardless.com/success-plus). </p>
retry_if_possible?: boolean;

// The total amount of the instalment schedule, defined as the sum of all
// individual
// payments, in the lowest denomination for the currency (e.g. pence in GBP,
// cents in
// EUR). If the requested payment amounts do not sum up correctly, a
// validation error
// will be returned.
total_amount?: string;
}

export enum BillingRequestInstalmentScheduleRequestCurrency {
AUD = 'AUD',
CAD = 'CAD',
DKK = 'DKK',
EUR = 'EUR',
GBP = 'GBP',
NZD = 'NZD',
SEK = 'SEK',
USD = 'USD',
}

/** Type for a billingrequestinstalmentschedulerequestlinks resource. */
export interface BillingRequestInstalmentScheduleRequestLinks {
// (Optional) ID of the
// [instalment_schedule](#core-endpoints-instalment-schedules) that was
// created from this instalment schedule request.
//
instalment_schedule?: string;
}

/** Type for a billingrequestlinks resource. */
export interface BillingRequestLinks {
// (Optional) ID of the [bank
Expand All @@ -410,6 +494,14 @@ export interface BillingRequestLinks {
// ID of the customer billing detail that will be used for this request
customer_billing_detail?: string;

// (Optional) ID of the associated instalment schedule request
instalment_schedule_request?: string;

// (Optional) ID of the
// [instalment_schedule](#core-endpoints-instalment-schedules) that was
// created from this instalment schedule request.
instalment_schedule_request_instalment_schedule?: string;

// (Optional) ID of the associated mandate request
mandate_request?: string;

Expand All @@ -429,6 +521,13 @@ export interface BillingRequestLinks {
// (Optional) ID of the [payment](#core-endpoints-payments) that was created
// from this payment request.
payment_request_payment?: string;

// (Optional) ID of the associated subscription request
subscription_request?: string;

// (Optional) ID of the [subscription](#core-endpoints-subscriptions) that was
// created from this subscription request.
subscription_request_subscription?: string;
}

/** Type for a billingrequestmandaterequest resource. */
Expand All @@ -447,8 +546,11 @@ export interface BillingRequestMandateRequest {
authorisation_source?: BillingRequestMandateRequestAuthorisationSource;

// This attribute represents the authorisation type between the payer and
// merchant. It can be set to one-off, recurring or standing for ACH scheme.
// And single, recurring and sporadic for PAD scheme.
// merchant. It can be set to `one_off`,
// `recurring` or `standing` for ACH scheme. And `single`, `recurring` and
// `sporadic` for PAD scheme. _Note:_ This is only supported for ACH and PAD
// schemes.
//
consent_type?: string | null;

// Constraints that will apply to the mandate_request. (Optional) Specifically
Expand Down Expand Up @@ -537,6 +639,12 @@ export interface BillingRequestMandateRequestConstraints {
// VRP.
max_amount_per_payment?: number;

// A constraint where you can specify info (free text string) about how
// payments are calculated. _Note:_ This is only supported for ACH and PAD
// schemes.
//
payment_method?: string;

// List of periodic limits and constraints which apply to them
periodic_limits?: BillingRequestMandateRequestConstraintsPeriodicLimit[];

Expand Down Expand Up @@ -871,6 +979,109 @@ export enum BillingRequestStatus {
Cancelled = 'cancelled',
}

/** Type for a billingrequestsubscriptionrequest resource. */
export interface BillingRequestSubscriptionRequest {
// Amount in the lowest denomination for the currency (e.g. pence in GBP,
// cents in EUR).
amount?: string;

// The amount to be deducted from each payment as an app fee, to be paid to
// the partner integration which created the subscription, in the lowest
// denomination for the currency (e.g. pence in GBP, cents in EUR).
app_fee?: string | null;

// The total number of payments that should be taken by this subscription.
count?: string | null;

// [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency
// code. Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD"
// are supported.
currency?: string;

// As per RFC 2445. The day of the month to charge customers on. `1`-`28` or
// `-1` to indicate the last day of the month.
day_of_month?: string | null;

// Number of `interval_units` between customer charge dates. Must be greater
// than or equal to `1`. Must result in at least one charge date per year.
// Defaults to `1`.
interval?: string;

// The unit of time between customer charge dates. One of `weekly`, `monthly`
// or `yearly`.
interval_unit?: BillingRequestSubscriptionRequestIntervalUnit;

// Resources linked to this BillingRequestSubscriptionRequest.
links?: BillingRequestSubscriptionRequestLinks;

// Key-value store of custom data. Up to 3 keys are permitted, with key names
// up to 50 characters and values up to 500 characters.
metadata?: JsonMap;

// Name of the month on which to charge a customer. Must be lowercase. Only
// applies
// when the interval_unit is `yearly`.
//
month?: BillingRequestSubscriptionRequestMonth;

// Optional name for the subscription. This will be set as the description on
// each payment created. Must not exceed 255 characters.
name?: string | null;

// An optional payment reference. This will be set as the reference on each
// payment
// created and will appear on your customer's bank statement. See the
// documentation for
// the [create payment endpoint](#payments-create-a-payment) for more details.
// <br />
payment_reference?: string | null;

// On failure, automatically retry payments using [intelligent
// retries](#success-intelligent-retries). Default is `false`. <p
// class="notice"><strong>Important</strong>: To be able to use intelligent
// retries, Success+ needs to be enabled in [GoCardless
// dashboard](https://manage.gocardless.com/success-plus). </p>
retry_if_possible?: boolean;

// The date on which the first payment should be charged. If fulfilled after
// this date, this will be set as the mandate's `next_possible_charge_date`.
// When left blank and `month` or `day_of_month` are provided, this will be
// set to the date of the first payment.
// If created without `month` or `day_of_month` this will be set as the
// mandate's `next_possible_charge_date`.
//
start_date?: string | null;
}

export enum BillingRequestSubscriptionRequestIntervalUnit {
Weekly = 'weekly',
Monthly = 'monthly',
Yearly = 'yearly',
}

/** Type for a billingrequestsubscriptionrequestlinks resource. */
export interface BillingRequestSubscriptionRequestLinks {
// (Optional) ID of the [subscription](#core-endpoints-subscriptions) that was
// created from this subscription request.
//
subscription?: string;
}

export enum BillingRequestSubscriptionRequestMonth {
January = 'january',
February = 'february',
March = 'march',
April = 'april',
May = 'may',
June = 'june',
July = 'july',
August = 'august',
September = 'september',
October = 'october',
November = 'november',
December = 'december',
}

/** Type for a billingrequestflow resource. */
export interface BillingRequestFlow {
// URL for a GC-controlled flow which will allow the payer to fulfil the
Expand Down

0 comments on commit 13044b4

Please sign in to comment.