Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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, {
__t: 'AndroidPayCard',
sourceCardLast4: paymentMethod.sourceCardLast4,
virtualCardLast4: paymentMethod.virtualCardLast4,
sourceCardType: paymentMethod.sourceCardType,
virtualCardType: paymentMethod.virtualCardType,
expirationMonth: paymentMethod.expirationMonth,
expirationYear: paymentMethod.expirationYear,