diff --git a/src/lib/stores/billing.ts b/src/lib/stores/billing.ts new file mode 100644 index 000000000..5aaf0fbbc --- /dev/null +++ b/src/lib/stores/billing.ts @@ -0,0 +1,16 @@ +import type { Client } from "@aw-labs/appwrite-console"; + +export class Billing { + client: Client; + + constructor(client: Client) { + this.client = client; + } + + async createPaymentMethod(teamId: string) { + const path = `/teams/${teamId}/payment-methods`; + const params = {}; + const uri = new URL(this.client.config.endpoint + path); + this.client.call('POST', uri, {}, params); + } +} \ No newline at end of file diff --git a/src/lib/stores/sdk.ts b/src/lib/stores/sdk.ts index cffc23dec..3625958a4 100644 --- a/src/lib/stores/sdk.ts +++ b/src/lib/stores/sdk.ts @@ -48,4 +48,9 @@ const sdkForProject = { users: new Users(clientProject) }; -export { sdkForConsole, sdkForProject, setProject }; +const cloudSdk = { + ...sdkForConsole, + billing: new Billing(clientConsole), +} + +export { sdkForConsole, sdkForProject, cloudSdk, setProject };