From f94d9cc94c2af4671c7e559fbefd850d22eb5eb6 Mon Sep 17 00:00:00 2001 From: Arman Date: Wed, 27 Dec 2023 18:19:37 +0100 Subject: [PATCH] feat: create new billing endpoints --- src/lib/sdk/billing.ts | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/src/lib/sdk/billing.ts b/src/lib/sdk/billing.ts index 8773bb77b..156a259e4 100644 --- a/src/lib/sdk/billing.ts +++ b/src/lib/sdk/billing.ts @@ -702,6 +702,46 @@ export class Billing { ); } + async getOrganizationPaymentMethod( + organizationId: string, + paymentMethodId: string + ): Promise { + const path = `/organizations/${organizationId}/payment-methods/${paymentMethodId}`; + const params = { + organizationId, + paymentMethodId + }; + const uri = new URL(this.client.config.endpoint + path); + return await this.client.call( + 'GET', + uri, + { + 'content-type': 'application/json' + }, + params + ); + } + + async getOrganizationBillingAddress( + organizationId: string, + billingAddressId: string + ): Promise { + const path = `/organizations/${organizationId}/payment-methods/${billingAddressId}`; + const params = { + organizationId, + billingAddressId + }; + const uri = new URL(this.client.config.endpoint + path); + return await this.client.call( + 'GET', + uri, + { + 'content-type': 'application/json' + }, + params + ); + } + //ACCOUNT async listPaymentMethods(queries: [] = []): Promise {