-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Commerce: Added support for card payments in checkout (#59)
* added pay with card option to checkout * added server action to process payment * moved square payment processing to utils * added user verification for card payments * added google pay and apple pay, restyled payment step on checkout * added secure payments info * [email protected] and [email protected]; added missing dep --------- Co-authored-by: artem ash <[email protected]>
- Loading branch information
1 parent
0da8f94
commit 4c57bc5
Showing
27 changed files
with
1,052 additions
and
311 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 0 additions & 76 deletions
76
packages/commerce/components/checkout/pay-by-bank-transfer.tsx
This file was deleted.
Oops, something went wrong.
59 changes: 59 additions & 0 deletions
59
packages/commerce/components/checkout/payment/contact-info.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import { | ||
Form, | ||
FormControl, | ||
FormField, | ||
FormItem, | ||
FormLabel, | ||
FormMessage, | ||
} from '@hanzo/ui/primitives/form' | ||
import { Input } from '@hanzo/ui/primitives' | ||
import type { UseFormReturn } from 'react-hook-form' | ||
|
||
const ContactInfo: React.FC<{ | ||
form: UseFormReturn<{ | ||
name: string | ||
email: string | ||
}, any, { | ||
name: string | ||
email: string | ||
}>, | ||
}> = ({ | ||
form, | ||
}) => { | ||
return ( | ||
<Form {...form}> | ||
<form className='text-left'> | ||
<div className='flex flex-col sm:flex-row gap-2'> | ||
<FormField | ||
control={form.control} | ||
name='name' | ||
render={({ field }) => ( | ||
<FormItem className='space-y-1 w-full'> | ||
<FormLabel>Full name</FormLabel> | ||
<FormControl> | ||
<Input {...field} /> | ||
</FormControl> | ||
<FormMessage /> | ||
</FormItem> | ||
)} | ||
/> | ||
<FormField | ||
control={form.control} | ||
name='email' | ||
render={({ field }) => ( | ||
<FormItem className='space-y-1 w-full'> | ||
<FormLabel>Email</FormLabel> | ||
<FormControl> | ||
<Input {...field} /> | ||
</FormControl> | ||
<FormMessage /> | ||
</FormItem> | ||
)} | ||
/> | ||
</div> | ||
</form> | ||
</Form> | ||
) | ||
} | ||
|
||
export default ContactInfo |
Oops, something went wrong.