• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Adyen / adyen-web / 11108566114

30 Sep 2024 02:47PM UTC coverage: 69.572%. First build
11108566114

Pull #2879

github

web-flow
Merge b615e5af8 into 098f006e6
Pull Request #2879: V5: Whitelabel Pay by Bank in the US

3369 of 5311 branches covered (63.43%)

Branch coverage included in aggregate %.

14 of 18 new or added lines in 5 files covered. (77.78%)

5514 of 7457 relevant lines covered (73.94%)

107.25 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

73.91
/packages/lib/src/components/PayByBankUS/PayByBankUS.tsx
1
import { Fragment, h } from 'preact';
2
import CoreProvider from '../../core/Context/CoreProvider';
3
import RedirectElement from '../Redirect';
4
import RedirectButton from '../internal/RedirectButton';
5
import './PayByBankUS.scss';
6
import getIssuerImageUrl from '../../utils/get-issuer-image';
7
import PayButton, { payAmountLabel } from '../internal/PayButton';
8

9
export default class PayByBankUS extends RedirectElement {
10
    public static type = 'paybybank_AIS_DD';
16✔
11

12
    public static defaultProps = {
16✔
13
        type: PayByBankUS.type,
14
        showPayButton: true,
15
        // paymentMethodBrands configuration
16
        keepBrandsVisible: true,
17
        showOtherInsteafOfNumber: true
18
    };
19

20
    get displayName() {
21
        if (this.props.storedPaymentMethodId && this.props.label) {
6✔
22
            return this.props.label;
2✔
23
        }
24
        return this.props.name;
4✔
25
    }
26

27
    get additionalInfo() {
NEW
28
        return this.props.storedPaymentMethodId ? this.props.name : '';
×
29
    }
30

31
    /*
32
    Hardcode US brands 
33
    */
34
    get brands(): { icon: string; name: string }[] {
NEW
35
        const getImage = props => this.resources.getImage(props);
×
36
        // paybybank_AIS_DD / tx_variant not used here since images are kept in paybybank subfolder
NEW
37
        const getIssuerIcon = getIssuerImageUrl({}, 'paybybank', getImage);
×
38

39
        // hardcoding
NEW
40
        return [
×
41
            { icon: getIssuerIcon('US-1'), name: 'Wells Fargo' },
42
            { icon: getIssuerIcon('US-2'), name: 'Bank of America' },
43
            { icon: getIssuerIcon('US-3'), name: 'Chase' },
44
            { icon: getIssuerIcon('US-4'), name: 'Citi' }
45
        ];
46
    }
47

48
    render() {
49
        return (
10✔
50
            <CoreProvider i18n={this.props.i18n} loadingContext={this.props.loadingContext} resources={this.resources}>
51
                {this.props.storedPaymentMethodId ? (
10✔
52
                    this.props.showPayButton && (
8✔
53
                        <PayButton
54
                            {...this.props}
55
                            classNameModifiers={['standalone']}
56
                            amount={this.props.amount}
57
                            label={payAmountLabel(this.props.i18n, this.props.amount)}
58
                            onClick={this.submit}
59
                        />
60
                    )
61
                ) : (
62
                    <Fragment>
63
                        <div className="adyen-checkout-paybybank_AIS_DD">
64
                            <p className="adyen-checkout-paybybank_AIS_DD__description-header">
65
                                {this.props.i18n.get('payByBankAISDD.disclaimer.header')}
66
                            </p>
67
                            <p className="adyen-checkout-paybybank_AIS_DD__description-body">
68
                                {this.props.i18n.get('payByBankAISDD.disclaimer.body')}
69
                            </p>
70
                        </div>
71

72
                        {this.props.showPayButton && (
10✔
73
                            <RedirectButton
74
                                {...this.props}
75
                                showPayButton={this.props.showPayButton}
76
                                name={this.displayName}
77
                                onSubmit={this.submit}
78
                                payButton={this.payButton}
79
                                ref={ref => {
80
                                    this.componentRef = ref;
8✔
81
                                }}
82
                            />
83
                        )}
84
                    </Fragment>
85
                )}
86
            </CoreProvider>
87
        );
88
    }
89
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc