From f093f5f655815d8a5d3efe76b7c71a443bba6aae Mon Sep 17 00:00:00 2001 From: Robot Date: Tue, 24 Sep 2024 14:32:23 +0000 Subject: [PATCH] Changes generated by ac5cfeab39308a479250729d34f91fd008e0a8ed --- src/services/billingRequestService.ts | 3 + src/services/billingRequestTemplateService.ts | 4 +- src/types/Types.ts | 124 +++++++++++++++++- 3 files changed, 128 insertions(+), 3 deletions(-) diff --git a/src/services/billingRequestService.ts b/src/services/billingRequestService.ts index 1bb561e..322fa4d 100644 --- a/src/services/billingRequestService.ts +++ b/src/services/billingRequestService.ts @@ -44,6 +44,9 @@ interface BillingRequestCreateRequest { // and `other` are supported. purpose_code?: Types.BillingRequestPurposeCode; + + // + subscription_request?: Types.BillingRequestSubscriptionRequest; } interface BillingRequestCollectCustomerDetailsRequest { diff --git a/src/services/billingRequestTemplateService.ts b/src/services/billingRequestTemplateService.ts index 8575882..7d9c1aa 100644 --- a/src/services/billingRequestTemplateService.ts +++ b/src/services/billingRequestTemplateService.ts @@ -92,7 +92,7 @@ interface BillingRequestTemplateCreateRequest { name?: string; - // Amount in minor unit (e.g. pence in GBP, cents in EUR). + // Amount in full. payment_request_amount?: string; @@ -191,7 +191,7 @@ interface BillingRequestTemplateUpdateRequest { name?: string; - // Amount in minor unit (e.g. pence in GBP, cents in EUR). + // Amount in full. payment_request_amount?: string; diff --git a/src/types/Types.ts b/src/types/Types.ts index 3b8629c..b39904f 100644 --- a/src/types/Types.ts +++ b/src/types/Types.ts @@ -163,6 +163,9 @@ export interface BillingRequest { // used // status?: BillingRequestStatus; + + // Request for a subscription + subscription_request?: BillingRequestSubscriptionRequest; } /** Type for a billingrequestcreaterequestlinks resource. */ @@ -429,6 +432,9 @@ 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; } /** Type for a billingrequestmandaterequest resource. */ @@ -446,6 +452,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. + consent_type?: string | null; + // Constraints that will apply to the mandate_request. (Optional) Specifically // for PayTo and VRP. constraints?: BillingRequestMandateRequestConstraints | null; @@ -753,6 +764,10 @@ export interface BillingRequestResourcesCustomerBankAccount { // details](#local-bank-details-united-states) for more information. account_type?: BillingRequestResourcesCustomerBankAccountAccountType; + // A token to uniquely refer to a set of bank account details. This feature is + // still in early access and is only available for certain organisations. + bank_account_token?: string | null; + // Name of bank, taken from the bank details. bank_name?: string; @@ -862,6 +877,91 @@ 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; + + // 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. + //
+ //

Restricted: You need your own + // Service User Number to specify a payment reference for Bacs payments.

+ payment_reference?: string | null; + + // The date on which the first payment should be charged. Must be on or after + // the [mandate](#core-endpoints-mandates)'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', +} + +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 @@ -1095,7 +1195,7 @@ export interface BillingRequestTemplate { // it is shown in the dashboard. Must not exceed 255 characters. name?: string; - // Amount in minor unit (e.g. pence in GBP, cents in EUR). + // Amount in full. payment_request_amount?: string; // [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency @@ -1731,6 +1831,10 @@ export interface CustomerBankAccount { // details](#local-bank-details-united-states) for more information. account_type?: CustomerBankAccountAccountType; + // A token to uniquely refer to a set of bank account details. This feature is + // still in early access and is only available for certain organisations. + bank_account_token?: string | null; + // Name of bank, taken from the bank details. bank_name?: string; @@ -1924,6 +2028,7 @@ export enum EventInclude { Creditor = 'creditor', InstalmentSchedule = 'instalment_schedule', Mandate = 'mandate', + OutboundPayment = 'outbound_payment', PayerAuthorisation = 'payer_authorisation', Payment = 'payment', Payout = 'payout', @@ -1966,6 +2071,9 @@ export interface EventDetails { // descriptions are not considered breaking. description?: string; + // Count of rows in the csv. This is sent for export events + item_count?: number; + // When will_attempt_retry is set to false, this field will contain // the reason the payment was not retried. This can be one of: //