Skip to content

Commit fb2d12d

Browse files
Copilotstnguyen90
andauthored
Remove payment mandate setup functionality (#2748)
* Initial plan * Remove all mandate-related code including setupPaymentMandate, checkForMandate, and paymentMandate component Co-authored-by: stnguyen90 <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: stnguyen90 <[email protected]>
1 parent 11a42cf commit fb2d12d

File tree

4 files changed

+1
-68
lines changed

4 files changed

+1
-68
lines changed

src/lib/components/billing/alerts/paymentMandate.svelte

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/lib/sdk/billing.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1300,26 +1300,6 @@ export class Billing {
13001300
);
13011301
}
13021302

1303-
async setupPaymentMandate(
1304-
organizationId: string,
1305-
paymentMethodId: string
1306-
): Promise<PaymentMethodData> {
1307-
const path = `/account/payment-methods/${paymentMethodId}/setup`;
1308-
const params = {
1309-
organizationId,
1310-
paymentMethodId
1311-
};
1312-
const uri = new URL(this.client.config.endpoint + path);
1313-
return await this.client.call(
1314-
'patch',
1315-
uri,
1316-
{
1317-
'content-type': 'application/json'
1318-
},
1319-
params
1320-
);
1321-
}
1322-
13231303
async listAddresses(queries: string[] = []): Promise<AddressesList> {
13241304
const path = `/account/billing-addresses`;
13251305
const params = {

src/lib/stores/billing.ts

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import MarkedForDeletion from '$lib/components/billing/alerts/markedForDeletion.
88
import MissingPaymentMethod from '$lib/components/billing/alerts/missingPaymentMethod.svelte';
99
import newDevUpgradePro from '$lib/components/billing/alerts/newDevUpgradePro.svelte';
1010
import PaymentAuthRequired from '$lib/components/billing/alerts/paymentAuthRequired.svelte';
11-
import PaymentMandate from '$lib/components/billing/alerts/paymentMandate.svelte';
11+
1212
import { BillingPlan, NEW_DEV_PRO_UPGRADE_COUPON } from '$lib/constants';
1313
import { cachedStore } from '$lib/helpers/cache';
1414
import { type Size, sizeToBytes } from '$lib/helpers/sizeConvertion';
@@ -18,7 +18,6 @@ import type {
1818
Invoice,
1919
InvoiceList,
2020
PaymentList,
21-
PaymentMethodData,
2221
Plan,
2322
PlansMap
2423
} from '$lib/sdk/billing';
@@ -535,24 +534,6 @@ export function checkForMarkedForDeletion(org: Organization) {
535534
}
536535
}
537536

538-
export const paymentMissingMandate = writable<PaymentMethodData>(null);
539-
540-
export async function checkForMandate(org: Organization) {
541-
const paymentId = org.paymentMethodId ?? org.backupPaymentMethodId;
542-
if (!paymentId) return;
543-
const paymentMethod = await sdk.forConsole.billing.getPaymentMethod(paymentId);
544-
if (paymentMethod?.mandateId === null && paymentMethod?.country.toLowerCase() === 'in') {
545-
headerAlert.add({
546-
id: 'paymentMandate',
547-
component: PaymentMandate,
548-
show: true,
549-
importance: 8
550-
});
551-
activeHeaderAlert.set(headerAlert.get());
552-
paymentMissingMandate.set(paymentMethod);
553-
}
554-
}
555-
556537
export async function checkForMissingPaymentMethod() {
557538
const orgs = await sdk.forConsole.billing.listOrganization([
558539
Query.notEqual('billingPlan', BillingPlan.FREE),

src/routes/(console)/+layout.svelte

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import {
1616
calculateTrialDay,
1717
checkForEnterpriseTrial,
18-
checkForMandate,
1918
checkForMarkedForDeletion,
2019
checkForMissingPaymentMethod,
2120
checkForNewDevUpgradePro,
@@ -308,7 +307,6 @@
308307
if (org?.billingPlan !== BillingPlan.FREE) {
309308
await paymentExpired(org);
310309
await checkPaymentAuthorizationRequired(org);
311-
await checkForMandate(org);
312310
313311
if ($plansInfo.get(org.billingPlan)?.trialDays) {
314312
calculateTrialDay(org);

0 commit comments

Comments
 (0)