diff --git a/package-lock.json b/package-lock.json index 1c61f82..7e7bf9c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "gocardless-nodejs", - "version": "3.28.0", + "version": "4.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -25,9 +25,9 @@ } }, "@babel/compat-data": { - "version": "7.25.2", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.25.2.tgz", - "integrity": "sha512-bYcppcpKBvX4znYaPEeFau03bp89ShqNMLs+rmdptMw+heSZh9+z84d2YG+K7cYLbWwzdjtDoW/uqZmPjulClQ==", + "version": "7.25.4", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.25.4.tgz", + "integrity": "sha512-+LGRog6RAsCJrrrg/IO6LGmpphNe5DiK30dGjCoxxeGv49B10/3XYGxPsAwrDlMFcFEvdAUavDT8r9k/hSyQqQ==", "dev": true }, "@babel/core": { @@ -62,12 +62,12 @@ } }, "@babel/generator": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.25.0.tgz", - "integrity": "sha512-3LEEcj3PVW8pW2R1SR1M89g/qrYk/m/mB/tLqn7dn4sbBUQyTqnlod+II2U4dqiGtUmkcnAmkMDralTFZttRiw==", + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.25.6.tgz", + "integrity": "sha512-VPC82gr1seXOpkjAAKoLhP50vx4vGNlF4msF64dSFq1P8RfB+QAuJWGHPXXPc8QyfVWwwB/TNNU4+ayZmHNbZw==", "dev": true, "requires": { - "@babel/types": "^7.25.0", + "@babel/types": "^7.25.6", "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.25", "jsesc": "^2.5.1" @@ -143,13 +143,13 @@ "dev": true }, "@babel/helpers": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.25.0.tgz", - "integrity": "sha512-MjgLZ42aCm0oGjJj8CtSM3DB8NOOf8h2l7DCTePJs29u+v7yO/RBX9nShlKMgFnRks/Q4tBAe7Hxnov9VkGwLw==", + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.25.6.tgz", + "integrity": "sha512-Xg0tn4HcfTijTwfDwYlvVCl43V6h4KyVVX2aEm4qdO/PC6L2YvzLHFdmxhoeSA3eslcE6+ZVXHgWwopXYLNq4Q==", "dev": true, "requires": { "@babel/template": "^7.25.0", - "@babel/types": "^7.25.0" + "@babel/types": "^7.25.6" } }, "@babel/highlight": { @@ -217,12 +217,12 @@ } }, "@babel/parser": { - "version": "7.25.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.3.tgz", - "integrity": "sha512-iLTJKDbJ4hMvFPgQwwsVoxtHyWpKKPBrxkANrSYewDPaPpT5py5yeVkgPIJ7XYXhndxJpaA3PyALSXQ7u8e/Dw==", + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.6.tgz", + "integrity": "sha512-trGdfBdbD0l1ZPmcJ83eNxB9rbEax4ALFTF7fN386TMYbeCQbyme5cOEXQhbGXKebwGaB/J52w1mrklMcbgy6Q==", "dev": true, "requires": { - "@babel/types": "^7.25.2" + "@babel/types": "^7.25.6" } }, "@babel/plugin-syntax-async-generators": { @@ -336,24 +336,24 @@ } }, "@babel/traverse": { - "version": "7.25.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.3.tgz", - "integrity": "sha512-HefgyP1x754oGCsKmV5reSmtV7IXj/kpaE1XYY+D9G5PvKKoFfSbiS4M77MdjuwlZKDIKFCffq9rPU+H/s3ZdQ==", + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.6.tgz", + "integrity": "sha512-9Vrcx5ZW6UwK5tvqsj0nGpp/XzqthkT0dqIc9g1AdtygFToNtTF67XzYS//dm+SAK9cp3B9R4ZO/46p63SCjlQ==", "dev": true, "requires": { "@babel/code-frame": "^7.24.7", - "@babel/generator": "^7.25.0", - "@babel/parser": "^7.25.3", + "@babel/generator": "^7.25.6", + "@babel/parser": "^7.25.6", "@babel/template": "^7.25.0", - "@babel/types": "^7.25.2", + "@babel/types": "^7.25.6", "debug": "^4.3.1", "globals": "^11.1.0" } }, "@babel/types": { - "version": "7.25.2", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.2.tgz", - "integrity": "sha512-YTnYtra7W9e6/oAZEHj0bJehPRUlLH9/fbpT5LfB0NhQXyALCRkRs3zH9v07IYhkgpqX6Z78FnuccZr/l4Fs4Q==", + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.6.tgz", + "integrity": "sha512-/l42B1qxpG6RdfYf343Uw1vmDjeNhneUXtzhojE7pDgfpEypmRhI6j1kr17XCVv4Cgl9HdAiQY2x0GwKm7rWCw==", "dev": true, "requires": { "@babel/helper-string-parser": "^7.24.8", @@ -699,11 +699,11 @@ }, "dependencies": { "@types/node": { - "version": "22.1.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.1.0.tgz", - "integrity": "sha512-AOmuRF0R2/5j1knA3c6G3HOk523Ga+l+ZXltX8SF1+5oqcXijjfTd8fY3XRZqSihEu9XhtQnKYLmkFaoxgsJHw==", + "version": "22.6.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.6.1.tgz", + "integrity": "sha512-V48tCfcKb/e6cVUigLAaJDAILdMP0fUW6BidkPK4GpGjXcfbnoHasCZDwz3N3yVt5we2RHm4XTQCpv0KJz9zqw==", "requires": { - "undici-types": "~6.13.0" + "undici-types": "~6.19.2" } } } @@ -766,11 +766,11 @@ }, "dependencies": { "@types/node": { - "version": "22.1.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.1.0.tgz", - "integrity": "sha512-AOmuRF0R2/5j1knA3c6G3HOk523Ga+l+ZXltX8SF1+5oqcXijjfTd8fY3XRZqSihEu9XhtQnKYLmkFaoxgsJHw==", + "version": "22.6.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.6.1.tgz", + "integrity": "sha512-V48tCfcKb/e6cVUigLAaJDAILdMP0fUW6BidkPK4GpGjXcfbnoHasCZDwz3N3yVt5we2RHm4XTQCpv0KJz9zqw==", "requires": { - "undici-types": "~6.13.0" + "undici-types": "~6.19.2" } } } @@ -811,11 +811,11 @@ }, "dependencies": { "@types/node": { - "version": "22.1.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.1.0.tgz", - "integrity": "sha512-AOmuRF0R2/5j1knA3c6G3HOk523Ga+l+ZXltX8SF1+5oqcXijjfTd8fY3XRZqSihEu9XhtQnKYLmkFaoxgsJHw==", + "version": "22.6.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.6.1.tgz", + "integrity": "sha512-V48tCfcKb/e6cVUigLAaJDAILdMP0fUW6BidkPK4GpGjXcfbnoHasCZDwz3N3yVt5we2RHm4XTQCpv0KJz9zqw==", "requires": { - "undici-types": "~6.13.0" + "undici-types": "~6.19.2" } } } @@ -1016,9 +1016,9 @@ "dev": true }, "aws4": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.13.1.tgz", - "integrity": "sha512-u5w79Rd7SU4JaIlA/zFqG+gOiuq25q5VLyZ8E+ijJeILuTxVzZgp2CaGw/UTw6pXYN9XMO9yiqj/nEHmhTG5CA==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.13.2.tgz", + "integrity": "sha512-lHe62zvbTB5eEABUVi/AwVh0ZKY9rMMDhmm+eeyuuUQbQ3+J+fONVQOZyj+DdrvD4BY33uYniyRJ4UJIaSKAfw==", "dev": true }, "babel-jest": { @@ -1295,9 +1295,9 @@ "dev": true }, "caniuse-lite": { - "version": "1.0.30001649", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001649.tgz", - "integrity": "sha512-fJegqZZ0ZX8HOWr6rcafGr72+xcgJKI9oWfDW5DrD7ExUtgZC7a7R7ZYmZqplh7XDocFdGeIFn7roAxhOeYrPQ==", + "version": "1.0.30001663", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001663.tgz", + "integrity": "sha512-o9C3X27GLKbLeTYZ6HBOLU1tsAcBZsLis28wrVzddShCS16RujjHp9GDHKZqrB3meE0YjhawvMFsGb/igqiPzA==", "dev": true }, "capture-exit": { @@ -1523,12 +1523,12 @@ } }, "debug": { - "version": "4.3.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", - "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", "dev": true, "requires": { - "ms": "2.1.2" + "ms": "^2.1.3" } }, "decamelize": { @@ -1645,9 +1645,9 @@ } }, "electron-to-chromium": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.5.tgz", - "integrity": "sha512-QR7/A7ZkMS8tZuoftC/jfqNkZLQO779SSW3YuZHP4eXpj3EffGLFcB/Xu9AAZQzLccTiCV+EmUo3ha4mQ9wnlA==", + "version": "1.5.28", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.28.tgz", + "integrity": "sha512-VufdJl+rzaKZoYVUijN13QcXVF5dWPZANeFTLNy+OSpHdDL5ynXTF35+60RSBbaQYB1ae723lQXHCrf4pyLsMw==", "dev": true }, "emoji-regex": { @@ -1687,9 +1687,9 @@ "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==" }, "escalade": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", - "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", "dev": true }, "escape-string-regexp": { @@ -2348,9 +2348,9 @@ } }, "is-core-module": { - "version": "2.15.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.0.tgz", - "integrity": "sha512-Dd+Lb2/zvk9SKy1TGCt1wFJFo/MWBPMX5x7KcvLajWTGuomczdQX61PvY5yK6SVACwpoexWo81IfFyoKY2QnTA==", + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz", + "integrity": "sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==", "dev": true, "requires": { "hasown": "^2.0.2" @@ -3271,9 +3271,9 @@ "dev": true }, "micromatch": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", - "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, "requires": { "braces": "^3.0.3", @@ -3352,9 +3352,9 @@ } }, "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, "nanomatch": { @@ -3389,9 +3389,9 @@ "dev": true }, "nock": { - "version": "13.5.4", - "resolved": "https://registry.npmjs.org/nock/-/nock-13.5.4.tgz", - "integrity": "sha512-yAyTfdeNJGGBFxWdzSKCBYxs5FxLbCg5X5Q4ets974hcQzG1+qCxvIyOo4j2Ry6MUlhWVMX4OoYDefAIIwupjw==", + "version": "13.5.5", + "resolved": "https://registry.npmjs.org/nock/-/nock-13.5.5.tgz", + "integrity": "sha512-XKYnqUrCwXC8DGG1xX4YH5yNIrlh9c065uaMZZHUoeUUINTOyt+x/G+ezYk0Ft6ExSREVIs+qBJDK503viTfFA==", "dev": true, "requires": { "debug": "^4.1.0", @@ -3670,9 +3670,9 @@ "dev": true }, "picocolors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", - "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.0.tgz", + "integrity": "sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==", "dev": true }, "picomatch": { @@ -3749,9 +3749,9 @@ "dev": true }, "pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.2.tgz", + "integrity": "sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw==", "requires": { "end-of-stream": "^1.1.0", "once": "^1.3.1" @@ -4450,9 +4450,9 @@ } }, "spdx-license-ids": { - "version": "3.0.18", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.18.tgz", - "integrity": "sha512-xxRs31BqRYHwiMzudOrpSiHtZ8i/GeionCBDSilhYRj+9gIcI8wCZTlXZKu9vZIVqViP3dcp9qE5G6AlIaD+TQ==", + "version": "3.0.20", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.20.tgz", + "integrity": "sha512-jg25NiDV/1fLtSgEgyvVyDunvaNHbuwF9lfNV17gSmPFAlYzdfNBlLtLzXTevwkPj7DhGbmN9VnmJIgLnhvaBw==", "dev": true }, "split-string": { @@ -4815,9 +4815,9 @@ "dev": true }, "undici-types": { - "version": "6.13.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.13.0.tgz", - "integrity": "sha512-xtFJHudx8S2DSoujjMd1WeWvn7KKWFRESZTMeL1RptAYERu29D6jphMjjY+vn96jvN3kVPDNxU/E13VTaXj6jg==" + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==" }, "union-value": { "version": "1.0.1", diff --git a/package.json b/package.json index 450e5bf..fb9480d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gocardless-nodejs", - "version": "3.28.0", + "version": "4.0.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 ", "repository": { diff --git a/src/constants.ts b/src/constants.ts index 8a29052..749fcef 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -5,7 +5,7 @@ enum Environments { Sandbox = 'SANDBOX', } -const CLIENT_VERSION = '3.28.0'; +const CLIENT_VERSION = '4.0.0'; const API_VERSION = '2015-07-06'; export { Environments, CLIENT_VERSION, API_VERSION }; 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: //