-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add ACH payment method #3616
base: main
Are you sure you want to change the base?
Changes from 1 commit
34bfe3e
1a8560e
f428955
0f6d1c3
0c413de
747f183
8912835
a59427f
616eaa8
6e35b3b
eaaf86d
4aacfb6
2dc8211
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,8 @@ import { SubscriptionDetailSchema } from 'services/account/useAccountDetails' | |
import AddressForm from './Address/AddressForm' | ||
import PaymentMethodForm from './PaymentMethod/PaymentMethodForm' | ||
|
||
import { SECONDARY_PAYMENT_FEATURE_ENABLED } from '../BillingDetails' | ||
|
||
interface EditPaymentMethodProps { | ||
setEditMode: (isEditMode: boolean) => void | ||
provider: string | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: This can be typed as Provider now |
||
|
@@ -20,7 +22,8 @@ const EditPaymentMethod = ({ | |
existingSubscriptionDetail, | ||
}: EditPaymentMethodProps) => { | ||
const [activeTab, setActiveTab] = useState<'primary' | 'secondary'>('primary') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. might be able to clean this up with a specific type. Like type PaymentMethod = 'primary' | 'secondary', which you could then use on line 45 as well |
||
const isSecondaryPaymentMethodFeatureEnabled = false | ||
|
||
const secondaryPaymentMethodFeatureEnabled = SECONDARY_PAYMENT_FEATURE_ENABLED | ||
|
||
return ( | ||
<div className="flex flex-col gap-4 p-4"> | ||
|
@@ -30,7 +33,7 @@ const EditPaymentMethod = ({ | |
<div className="ml-2 flex border-b border-ds-gray-tertiary"> | ||
{[ | ||
'primary', | ||
...(isSecondaryPaymentMethodFeatureEnabled ? ['secondary'] : []), | ||
...(secondaryPaymentMethodFeatureEnabled ? ['secondary'] : []), | ||
].map((tab) => ( | ||
<button | ||
key={tab} | ||
|
@@ -71,22 +74,21 @@ const EditPaymentMethod = ({ | |
/> | ||
</div> | ||
)} | ||
{activeTab === 'secondary' && | ||
isSecondaryPaymentMethodFeatureEnabled && ( | ||
<div> | ||
<PaymentMethodForm | ||
closeForm={() => setEditMode(false)} | ||
provider={provider} | ||
owner={owner} | ||
existingSubscriptionDetail={existingSubscriptionDetail} | ||
/> | ||
<AddressForm | ||
closeForm={() => setEditMode(false)} | ||
provider={provider} | ||
owner={owner} | ||
/> | ||
</div> | ||
)} | ||
{activeTab === 'secondary' && ( | ||
<div> | ||
<PaymentMethodForm | ||
closeForm={() => setEditMode(false)} | ||
provider={provider} | ||
owner={owner} | ||
existingSubscriptionDetail={existingSubscriptionDetail} | ||
/> | ||
<AddressForm | ||
closeForm={() => setEditMode(false)} | ||
provider={provider} | ||
owner={owner} | ||
/> | ||
</div> | ||
)} | ||
</div> | ||
</div> | ||
</div> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This flag can get removed when we build out the rest of the secondary payment method feature (next quarter)