UNPKG

@adyen/react-native

Version:

Wraps Adyen Checkout Drop-In and Components for iOS and Android for convenient use with React Native

20 lines (17 loc) 638 B
"use strict"; /** * Find payment method in JSON response or \paymentMethods API */ export function find(paymentMethods, typeName) { return paymentMethods.paymentMethods.find(pm => pm.type === mapCreatedComponentType(typeName)); } /** * Map component name to txVariable name from \paymentMethod response * @param {string} pmType * @returns {string} matching txVariable name or original name */ function mapCreatedComponentType(pmType) { // Components created as 'card' need to be matched with paymentMethod response objects with type 'scheme' return pmType === 'card' ? 'scheme' : pmType; } //# sourceMappingURL=utils.js.map