How to use the @paypal/sdk-constants/src.CARD.VISA function in @paypal/sdk-constants

To help you get started, we’ve selected a few @paypal/sdk-constants examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github paypal / paypal-smart-payment-buttons / test / client / card.js View on Github external
},
                        [ CARD.AMEX ]: {
                            eligible: true
                        },
                        [ CARD.MASTERCARD ]: {
                            eligible: true
                        }
                    }
                }
            };

            createButtonHTML(fundingEligibility);

            await mockSetupButton({ merchantID: [ 'XYZ12345' ], fundingEligibility });

            await clickButton(FUNDING.CARD, CARD.VISA);
        });
    });
github paypal / paypal-smart-payment-buttons / test / client / card.js View on Github external
return renderToOriginal(...args);
                    });
                }));

                return checkoutInstance;
            }));

            const fundingEligibility = {
                [ FUNDING.PAYPAL ]: {
                    eligible: true
                },
                [ FUNDING.CARD]: {
                    eligible: true,
                    vendors:  {
                        [ CARD.VISA ]: {
                            eligible: true
                        },
                        [ CARD.AMEX ]: {
                            eligible: true
                        },
                        [ CARD.MASTERCARD ]: {
                            eligible: true
                        }
                    }
                }
            };

            createButtonHTML(fundingEligibility);

            await mockSetupButton({ merchantID: [ 'XYZ12345' ], fundingEligibility });
github paypal / paypal-smart-payment-buttons / test / client / mocks.js View on Github external
export async function clickButton(fundingSource? : string = FUNDING.PAYPAL, card? : string = CARD.VISA) : ZalgoPromise {
    let selector = `button[data-funding-source=${ fundingSource }]`;
    if (fundingSource === FUNDING.CARD) {
        selector = `${ selector }[data-card=${ card }]`;
    }
    const button = window.document.querySelector(selector);
    button.click();
    await button.payPromise;
}
github paypal / paypal-smart-payment-buttons / test / client / clientConfig.js View on Github external
const fundingEligibility = {
                [ FUNDING.CARD ]: {
                    eligible: true,
                    vendors:  {
                        [ CARD.VISA ]: {
                            eligible: true
                        }
                    }
                }
            };

            createButtonHTML(fundingEligibility);

            await mockSetupButton({ merchantID: [ 'XYZ12345' ], fundingEligibility });

            await clickButton(FUNDING.CARD, CARD.VISA);
        });
    });
github paypal / paypal-smart-payment-buttons / test / client / clientConfig.js View on Github external
})
            }).expectCalls();

            window.xprops.onApprove = mockAsyncProp(expect('onApprove', async () => {
                gqlMock.done();

                if (!clientConfigCalled) {
                    throw new Error(`Expected clientConfig mutation to be called`);
                }
            }));

            const fundingEligibility = {
                [ FUNDING.CARD ]: {
                    eligible: true,
                    vendors:  {
                        [ CARD.VISA ]: {
                            eligible: true
                        }
                    }
                }
            };

            createButtonHTML(fundingEligibility);

            await mockSetupButton({ merchantID: [ 'XYZ12345' ], fundingEligibility });

            await clickButton(FUNDING.CARD, CARD.VISA);
        });
    });
github paypal / paypal-checkout-components / src / funding / card / config.jsx View on Github external
import { CARD, FUNDING, COUNTRY, COMPONENTS } from '@paypal/sdk-constants/src';

import { BUTTON_LAYOUT, BUTTON_COLOR, DEFAULT, CLASS, ATTRIBUTE } from '../../constants';
import { DEFAULT_FUNDING_CONFIG, type FundingSourceConfig, type CardConfig } from '../common';
import { Text } from '../../ui';

import { getVisaConfig } from './visa';
import { getMastercardConfig } from './mastercard';
import { getAmexConfig } from './amex';
import { getDiscoverConfig } from './discover';
import { getHiperConfig } from './hiper';
import { getEloConfig } from './elo';
import { getJCBConfig } from './jcb';

const CARD_PRIORITY : $ReadOnlyArray<$Values> = [
    CARD.VISA,
    CARD.MASTERCARD,
    CARD.AMEX,
    CARD.DISCOVER,
    CARD.HIPER,
    CARD.ELO,
    CARD.JCB
];

function getVendorConfig() : { [$Values] : ?CardConfig } {
    return {
        [ CARD.VISA ]:       (!__TREE_SHAKE__ || (__paypal_checkout__.serverConfig.fundingEligibility.card && __paypal_checkout__.serverConfig.fundingEligibility.card.vendors && __paypal_checkout__.serverConfig.fundingEligibility.card.vendors.visa && __paypal_checkout__.serverConfig.fundingEligibility.card.vendors.visa.eligible)) ? getVisaConfig() : null,
        [ CARD.AMEX ]:       (!__TREE_SHAKE__ || (__paypal_checkout__.serverConfig.fundingEligibility.card && __paypal_checkout__.serverConfig.fundingEligibility.card.vendors && __paypal_checkout__.serverConfig.fundingEligibility.card.vendors.amex && __paypal_checkout__.serverConfig.fundingEligibility.card.vendors.amex.eligible)) ? getAmexConfig() : null,
        [ CARD.MASTERCARD ]: (!__TREE_SHAKE__ || (__paypal_checkout__.serverConfig.fundingEligibility.card && __paypal_checkout__.serverConfig.fundingEligibility.card.vendors && __paypal_checkout__.serverConfig.fundingEligibility.card.vendors.mastercard && __paypal_checkout__.serverConfig.fundingEligibility.card.vendors.mastercard.eligible)) ? getMastercardConfig() : null,
        [ CARD.DISCOVER ]:   (!__TREE_SHAKE__ || (__paypal_checkout__.serverConfig.fundingEligibility.card && __paypal_checkout__.serverConfig.fundingEligibility.card.vendors && __paypal_checkout__.serverConfig.fundingEligibility.card.vendors.discover && __paypal_checkout__.serverConfig.fundingEligibility.card.vendors.discover.eligible)) ? getDiscoverConfig() : null,
        [ CARD.JCB ]:        (!__TREE_SHAKE__ || (__paypal_checkout__.serverConfig.fundingEligibility.card && __paypal_checkout__.serverConfig.fundingEligibility.card.vendors && __paypal_checkout__.serverConfig.fundingEligibility.card.vendors.jcb && __paypal_checkout__.serverConfig.fundingEligibility.card.vendors.jcb.eligible)) ? getJCBConfig() : null,
        [ CARD.ELO ]:        (!__TREE_SHAKE__ || (__paypal_checkout__.serverConfig.fundingEligibility.card && __paypal_checkout__.serverConfig.fundingEligibility.card.vendors && __paypal_checkout__.serverConfig.fundingEligibility.card.vendors.elo && __paypal_checkout__.serverConfig.fundingEligibility.card.vendors.elo.eligible)) ? getEloConfig() : null,