UNPKG

@fawry_pay/rn-fawry-pay-sdk

Version:
35 lines (34 loc) 1.64 kB
import { NativeEventEmitter, NativeModules, Platform } from 'react-native'; const LINKING_ERROR = ` The package '@fawry_pay/rn-fawry-pay-sdk' doesn't seem to be linked. Make sure: ${Platform.select({ ios: "- You have run 'pod install'\n", default: '' })} - You rebuilt the app after installing the package - You are not using Expo Go `; const RnFawryPaySdk = NativeModules.RnFawryPaySdk || new Proxy({}, { get() { throw new Error(LINKING_ERROR); } }); export async function startPayment(fawryLaunchModel) { RnFawryPaySdk.startPayment(fawryLaunchModel.baseUrl, fawryLaunchModel.lang, fawryLaunchModel.merchantInfo, fawryLaunchModel.customerInfo, fawryLaunchModel.items, fawryLaunchModel.allow3DPayment, fawryLaunchModel.skipReceipt, fawryLaunchModel.skipLogin, fawryLaunchModel.payWithCardToken, fawryLaunchModel.authCaptureMode, fawryLaunchModel.allowVoucher, fawryLaunchModel.signature); } export async function openCardsManager(baseUrl, lang, merchantInfo, customerInfo) { RnFawryPaySdk.openCardsManager(baseUrl, lang, merchantInfo, customerInfo); } export let FawryLanguages = /*#__PURE__*/function (FawryLanguages) { FawryLanguages["ENGLISH"] = "ENGLISH"; FawryLanguages["ARABIC"] = "ARABIC"; return FawryLanguages; }({}); export class FawryCallbacks { static FawryEmitter = new NativeEventEmitter(RnFawryPaySdk); static FAWRY_EVENT_PAYMENT_COMPLETED = 'FAWRY_EVENT_PAYMENT_COMPLETED'; static FAWRY_EVENT_ON_SUCCESS = 'FAWRY_EVENT_ON_SUCCESS'; static FAWRY_EVENT_ON_FAIL = 'FAWRY_EVENT_ON_FAIL'; static FAWRY_EVENT_CardManager_FAIL = 'FAWRY_EVENT_CardManager_FAIL'; } //# sourceMappingURL=index.js.map