How to use the @paypal/sdk-constants.FUNDING.CARD 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-checkout-components / test / screenshot / config.js View on Github external
label
            }
        }
    });
}

for (const fundingSource of Object.values(FUNDING)) {
    buttonConfigs.push({
        fundingEligibility: {
            paypal: {
                eligible: true
            },
            // $FlowFixMe
            [ fundingSource ]: {
                eligible: true,
                vendors:  fundingSource === FUNDING.CARD
                    ? {
                        visa: {
                            eligible: true
                        },
                        amex: {
                            eligible: true
                        },
                        mastercard: {
                            eligible: true
                        }
                    }
                    : null
            }
        },
        rememberedFunding: fundingSource === FUNDING.VENMO
            // $FlowFixMe
github paypal / paypal-smart-payment-buttons / server / service / fundingEligibility.js View on Github external
if (isDefined(basicCardEligibility[card].eligible)) {
                delete vendorsQuery[card].eligible;
            }

            // if (isDefined(basicCardEligibility[card].vaultable)) {
            //    delete vendorsQuery[card].vaultable;
            // }

            if (!Object.keys(vendorsQuery[card]).length) {
                delete vendorsQuery[card];
            }
        }
    }

    if (!Object.keys(vendorsQuery).length) {
        delete fundingQuery[FUNDING.CARD].vendors;
    }

    for (const fundingSource of values(FUNDING)) {
        if ([ FUNDING.VENMO, FUNDING.ITAU ].includes(fundingSource)) {
            continue;
        }

        if (basicFundingEligibility[fundingSource] && fundingQuery[fundingSource]) {
            if (isDefined(basicFundingEligibility[fundingSource].eligible)) {
                delete fundingQuery[fundingSource].eligible;
            }

            // if (isDefined(basicFundingEligibility[fundingSource].vaultable)) {
            //    delete fundingQuery[fundingSource].vaultable;
            // }
github paypal / paypal-smart-payment-buttons / server / service / fraudnet.js View on Github external
export function shouldRenderFraudnet({ fundingEligibility } : { fundingEligibility : FundingEligibility }) : boolean {
    for (const fundingSource of Object.values(FUNDING)) {
        // $FlowFixMe
        const fundingConfig = fundingEligibility[fundingSource];

        if (fundingConfig && fundingConfig.vaultedInstruments && fundingConfig.vaultedInstruments.length) {
            return true;
        }

        if (fundingSource === FUNDING.CARD && fundingConfig && fundingConfig.vendors) {
            for (const card of Object.values(CARD)) {
                const cardConfig = fundingConfig.vendors[card];

                if (cardConfig && cardConfig.vaultedInstruments && cardConfig.vaultedInstruments.length) {
                    return true;
                }
            }
        }
    }

    return false;
}
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 / server / service / fundingEligibility.js View on Github external
vaultable:          types.boolean,
            vaultedInstruments: getVaultedInstrumentQuery()
        };
    };

    const getCardQuery = () => {
        return {
            eligible: types.boolean,
            branded:  types.boolean,
            vendors:  getVendorQuery()
        };
    };

    const fundingQuery = {
        [ FUNDING.PAYPAL ]:     getPayPalQuery(),
        [ FUNDING.CARD ]:       getCardQuery(),
        [ FUNDING.VENMO ]:      getBasicFundingEligibilityQuery(),
        [ FUNDING.ITAU ]:       getBasicFundingEligibilityQuery(),
        [ FUNDING.CREDIT ]:     getBasicFundingEligibilityQuery(),
        [ FUNDING.SEPA ]:       getBasicFundingEligibilityQuery(),
        [ FUNDING.IDEAL ]:      getBasicFundingEligibilityQuery(),
        [ FUNDING.BANCONTACT ]: getBasicFundingEligibilityQuery(),
        [ FUNDING.GIROPAY ]:    getBasicFundingEligibilityQuery(),
        [ FUNDING.EPS ]:        getBasicFundingEligibilityQuery(),
        [ FUNDING.SOFORT ]:     getBasicFundingEligibilityQuery(),
        [ FUNDING.MYBANK ]:     getBasicFundingEligibilityQuery(),
        [ FUNDING.P24 ]:        getBasicFundingEligibilityQuery(),
        [ FUNDING.ZIMPLER ]:    getBasicFundingEligibilityQuery(),
        [ FUNDING.WECHATPAY ]:  getBasicFundingEligibilityQuery(),
        [ FUNDING.PAYU ]:       getBasicFundingEligibilityQuery(),
        [ FUNDING.BLIK ]:       getBasicFundingEligibilityQuery(),
        [ FUNDING.TRUSTLY ]:    getBasicFundingEligibilityQuery(),