mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
update payment method details upon completion
This commit is contained in:
1 parent
bef77eaabd
commit
5c9579e13f
2 files changed
+14
-3
No files matched your search
@@ -27,10 +27,17 @@ export class Billing {
|
||||
);
|
||||
}
|
||||
|
||||
async updatePaymentMethod(teamId: string, paymentMethodId: string) {
|
||||
async updatePaymentMethod(teamId: string, paymentMethodId: string, providerMethodId: string) {
|
||||
const path = `/teams/${teamId}/payment-methods/${paymentMethodId}`;
|
||||
const uri = new URL(this.client.config.endpoint + path);
|
||||
return await this.client.call('PUT', uri, { 'content-type': 'application/json' }, {});
|
||||
return await this.client.call(
|
||||
'PUT',
|
||||
uri,
|
||||
{ 'content-type': 'application/json' },
|
||||
{
|
||||
providerMethodId
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
async updateProjectPlan(projectId: string, billingPlan: string) {
|
||||
|
||||
@@ -82,7 +82,11 @@
|
||||
});
|
||||
} else if (setupIntent && setupIntent.status === 'succeeded') {
|
||||
//update payment method
|
||||
cloudSdk.billing.updatePaymentMethod($organization.$id, paymentMethod.$id);
|
||||
await cloudSdk.billing.updatePaymentMethod(
|
||||
$organization.$id,
|
||||
paymentMethod.$id,
|
||||
setupIntent.payment_method
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user