UNPKG

@adyen/react-native

Version:

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

19 lines (15 loc) 519 B
const in_app_payment_key = 'com.apple.developer.in-app-payments'; export function setEntitlements( entitlements: any, input: string | string[] ): any { const identifiers: string[] = entitlements[in_app_payment_key] ?? []; const newIdentifiers = Array.isArray(input) ? input : [input]; newIdentifiers .filter((id) => id && !identifiers.includes(id)) .forEach((id) => identifiers.push(id)); if (identifiers.length) { entitlements[in_app_payment_key] = identifiers; } return entitlements; }