Skip to content

Commit 2d0db6a

Browse files
Add Stripe links ACH option (#378)
Switch to enable ACH for Stripe link (currently disabled) Addresses #377 <img width="589" height="339" alt="Screenshot 2025-11-04 at 17 22 23" src="https://github.com/user-attachments/assets/003c10cf-c5e1-41c0-a282-e7522b85e129" /> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added an "Enable ACH Payment (upcoming)" toggle to the invoice link creation form. It defaults to off, is rendered disabled, and will display "Feature not yet available" if users attempt to enable it. The control prepares the UI for future ACH payment support and preserves current invoice link behavior. * **Tests** * Updated tests to include the new toggle in form payloads. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 9e7e177 commit 2d0db6a

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

src/common/types/stripe.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ export const invoiceLinkPostRequestSchema = z.object({
99
invoiceId: z.string().min(1),
1010
invoiceAmountUsd: z.number().min(50),
1111
contactName: z.string().min(1),
12-
contactEmail: z.string().email()
12+
contactEmail: z.string().email(),
13+
achPaymentsEnabled: z.optional(z.boolean()).default(false),
1314
});
1415

1516
export type PostInvoiceLinkRequest = z.infer<
@@ -33,4 +34,4 @@ export const invoiceLinkGetResponseSchema = z.array(
3334
);
3435

3536
export type GetInvoiceLinksResponse = z.infer<
36-
typeof invoiceLinkGetResponseSchema>;
37+
typeof invoiceLinkGetResponseSchema>;

src/ui/pages/stripe/CreateLink.test.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ describe("StripeCreateLinkPanel Tests", () => {
7272

7373
await act(async () => {
7474
expect(createLinkMock).toHaveBeenCalledWith({
75+
achPaymentsEnabled: false,
7576
invoiceId: "INV123",
7677
invoiceAmountUsd: 100,
7778
contactName: "John Doe",

src/ui/pages/stripe/CreateLink.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
Text,
77
TextInput,
88
NumberInput,
9+
Switch,
910
Title,
1011
Modal,
1112
Anchor,
@@ -42,6 +43,7 @@ export const StripeCreateLinkPanel: React.FC<StripeCreateLinkPanelProps> = ({
4243
invoiceAmountUsd: 100,
4344
contactName: "",
4445
contactEmail: "",
46+
achPaymentsEnabled: false,
4547
},
4648
validate: {
4749
invoiceId: (value) =>
@@ -52,6 +54,8 @@ export const StripeCreateLinkPanel: React.FC<StripeCreateLinkPanelProps> = ({
5254
value.length < 1 ? "Contact Name is required" : null,
5355
contactEmail: (value) =>
5456
/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value) ? null : "Invalid email",
57+
achPaymentsEnabled: (value) =>
58+
value ? "Feature not yet available" : null,
5559
},
5660
});
5761

@@ -110,6 +114,14 @@ export const StripeCreateLinkPanel: React.FC<StripeCreateLinkPanelProps> = ({
110114
{...form.getInputProps("contactEmail")}
111115
required
112116
/>
117+
<Switch
118+
mt="lg"
119+
mb="lg"
120+
label="Enable ACH Payment (upcoming)"
121+
description="Accept only bank transfer payments for this link"
122+
disabled
123+
{...form.getInputProps("achPaymentsEnabled")}
124+
/>
113125

114126
<Button type="submit" fullWidth mt="md" disabled={isLoading}>
115127
{isLoading ? "Creating..." : "Create Link"}{" "}

0 commit comments

Comments
 (0)