UNPKG

stripe-react-native-apple-pay

Version:

React Native wrapper around Stripe Apple Pay

38 lines 937 B
import NativeStripeSdk from './NativeStripeSdk'; import { PlatformPayError } from './types'; export function initStripe(params) { return NativeStripeSdk.initialise(params); } export function isPlatformPaySupported() { return NativeStripeSdk.isPlatformPaySupported(); } const APPLE_PAY_NOT_SUPPORTED_MESSAGE = 'Apple pay is not supported on this device'; export const confirmPlatformPayPayment = async (clientSecret, params) => { if (!(await NativeStripeSdk.isPlatformPaySupported())) { return { error: { code: PlatformPayError.Canceled, message: APPLE_PAY_NOT_SUPPORTED_MESSAGE } }; } try { const { result, error } = await NativeStripeSdk.confirmPlatformPay(clientSecret, params); if (error) { return { error }; } return { result }; } catch (error) { return { error }; } }; //# sourceMappingURL=functions.js.map