mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
Merge branch 'billing' into billing-copy
This commit is contained in:
@@ -112,8 +112,7 @@
|
||||
bind:value={zip}
|
||||
id="zip"
|
||||
label="Postal code"
|
||||
placeholder="Enter postal code"
|
||||
required />
|
||||
placeholder="Enter postal code" />
|
||||
</FormItem>
|
||||
</FormList>
|
||||
|
||||
|
||||
@@ -96,8 +96,7 @@
|
||||
bind:value={selectedAddress.postalCode}
|
||||
id="zip"
|
||||
label="Postal code"
|
||||
placeholder="Enter postal code"
|
||||
required />
|
||||
placeholder="Enter postal code" />
|
||||
</FormItem>
|
||||
</FormList>
|
||||
<svelte:fragment slot="footer">
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
const dispatch = createEventDispatcher();
|
||||
export let show = false;
|
||||
let coupon: string = null;
|
||||
let error: string = null;
|
||||
|
||||
async function redeem() {
|
||||
try {
|
||||
@@ -28,17 +29,14 @@
|
||||
});
|
||||
coupon = null;
|
||||
dispatch('success');
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
message: error.message
|
||||
});
|
||||
trackError(error, Submit.CreditRedeem);
|
||||
} catch (e) {
|
||||
error = e.message;
|
||||
trackError(e, Submit.CreditRedeem);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<Modal bind:show title="Add credits" headerDivider={false} onSubmit={redeem} size="big">
|
||||
<Modal bind:show title="Add credits" headerDivider={false} onSubmit={redeem} size="big" bind:error>
|
||||
Apply Appwrite credits to your organization.
|
||||
|
||||
<FormList>
|
||||
|
||||
@@ -105,8 +105,7 @@
|
||||
bind:value={$createOrganization.billingAddress.postalCode}
|
||||
id="zip"
|
||||
label="Postal code"
|
||||
placeholder="Enter postal code"
|
||||
required />
|
||||
placeholder="Enter postal code" />
|
||||
</FormItem>
|
||||
</FormList>
|
||||
</RadioBoxes>
|
||||
|
||||
@@ -27,6 +27,9 @@
|
||||
});
|
||||
|
||||
async function handleSubmit() {
|
||||
if ($createOrganization.billingBudget < 0) {
|
||||
throw new Error('Budget cannot be negative');
|
||||
}
|
||||
try {
|
||||
const method = await submitStripeCard(name);
|
||||
$createOrganization.paymentMethodId = method.$id;
|
||||
@@ -83,6 +86,7 @@
|
||||
id="budget"
|
||||
label="Budget cap ($USD)"
|
||||
placeholder="0"
|
||||
min={0}
|
||||
bind:value={$createOrganization.billingBudget} />
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
@@ -108,8 +108,7 @@
|
||||
bind:value={$changeOrganizationTier.billingAddress.postalCode}
|
||||
id="zip"
|
||||
label="Postal code"
|
||||
placeholder="Enter postal code"
|
||||
required />
|
||||
placeholder="Enter postal code" />
|
||||
</FormItem>
|
||||
</FormList>
|
||||
</RadioBoxes>
|
||||
|
||||
@@ -33,6 +33,10 @@
|
||||
});
|
||||
|
||||
async function handleSubmit() {
|
||||
if ($changeOrganizationTier.billingBudget < 0) {
|
||||
throw new Error('Budget cannot be negative');
|
||||
}
|
||||
|
||||
try {
|
||||
await submitStripeCard(name);
|
||||
const latestMethods = await sdk.forConsole.billing.listPaymentMethods();
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
|
||||
<svelte:fragment slot="buttons">
|
||||
<!-- TODO: add link when available -->
|
||||
<Button text>Learn more</Button>
|
||||
<Button text href="#/">Learn more</Button>
|
||||
</svelte:fragment>
|
||||
</Alert>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user