File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
packages/donate-button-v4/src/components/widget
components/PaymentProcess/PaymentMethodSelect Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -45,8 +45,11 @@ const usePaymentMethods = () => {
4545 ( ) =>
4646 methods
4747 . filter ( ( method ) => {
48+ // There is a bug where instead of being a proper array of disabled methods,
49+ // it comes as an array of length 1 with a comma-separated string inside
4850 if (
49- nonprofit ?. metadata ?. disabledPaymentFlowOptions ?. includes ( method )
51+ nonprofit ?. metadata ?. disabledPaymentFlowOptions ?. length === 1 &&
52+ nonprofit ?. metadata ?. disabledPaymentFlowOptions [ 0 ] ?. includes ( method )
5053 ) {
5154 return false ;
5255 }
Original file line number Diff line number Diff line change @@ -18,9 +18,9 @@ export interface Nonprofit {
1818 nteeCode : string | null ;
1919 metadata ?: {
2020 customTaxDeductible ?: string ;
21- // Note that multiple payment methods can be disabled, but it still arrives as a single
22- // comma-separated string from the API eg "card,paypal" so we type it as such here
23- disabledPaymentFlowOptions ?: string ;
21+ // Note that multiple payment methods can be disabled, but for some reason it arrives
22+ // as an array of length 1 eg [ "card,paypal"] from the API, so we type it as such here
23+ disabledPaymentFlowOptions ?: string [ ] ;
2424 disablePrivateNotes ?: boolean ;
2525 granteeName ?: string ;
2626 prefixWithThe ?: boolean ;
You can’t perform that action at this time.
0 commit comments