How to use the braintree.PayPalAccount function in braintree

To help you get started, we’ve selected a few braintree 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 enhancv / mongoose-subscriptions / src / braintree / paymentMethodProcessor.js View on Github external
function fields (customer, paymentMethod) {
    const response = {};

    if (paymentMethod instanceof braintree.CreditCard) {
        Object.assign(response, {
            __t: 'CreditCard',
            maskedNumber: paymentMethod.maskedNumber,
            countryOfIssuance: paymentMethod.countryOfIssuance,
            issuingBank: paymentMethod.issuingBank,
            cardType: paymentMethod.cardType,
            cardholderName: paymentMethod.cardholderName,
            expirationMonth: paymentMethod.expirationMonth,
            expirationYear: paymentMethod.expirationYear,
        });
    } else if (paymentMethod instanceof braintree.PayPalAccount) {
        Object.assign(response, {
            __t: 'PayPalAccount',
            name: name.full(paymentMethod.payerInfo.firstName, paymentMethod.payerInfo.lastName),
            payerId: paymentMethod.payerInfo.payerId,
            email: paymentMethod.email,
        });
    } else if (paymentMethod instanceof braintree.ApplePayCard) {
        Object.assign(response, {
            __t: 'ApplePayCard',
            cardType: paymentMethod.cardType,
            paymentInstrumentName: paymentMethod.paymentInstrumentName,
            expirationMonth: paymentMethod.expirationMonth,
            expirationYear: paymentMethod.expirationYear,
        });
    } else if (paymentMethod instanceof braintree.AndroidPayCard) {
        Object.assign(response, {

braintree

A library for server-side integrating with Braintree.

MIT
Latest version published 2 months ago

Package Health Score

71 / 100
Full package analysis