UNPKG

@fawry_pay/rn-fawry-pay-registered-sdk

Version:

This is the only official Fawrypay Registered SDK package for React Native

58 lines (57 loc) 2.47 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(addressHierarchy, allow3DPayment, apiPath, baseUrl, customerInfo, items, lang, merchantInfo, showLoyaltyContainer, showTipsView, showVoucherContainer, skipReceipt, beid, branchCode, branchName, scheduledTime, serviceTypeCode, tableId, shippingAddress) { const optionalParams = { beid, branchCode, branchName, scheduledTime, serviceTypeCode, tableId, shippingAddress }; RnFawryPaySdk.startPayment(baseUrl, lang, addressHierarchy, allow3DPayment, apiPath, customerInfo, items, merchantInfo, showLoyaltyContainer, showTipsView, showVoucherContainer, skipReceipt, optionalParams); } export async function openCardsManager(baseUrl, lang, merchantInfo, customerInfo) { RnFawryPaySdk.openCardsManager(baseUrl, lang, merchantInfo, customerInfo); } export async function openAddressManager(baseUrl, lang, merchantInfo, customerInfo, beid, addressHierarchy) { RnFawryPaySdk.openAddressManager(baseUrl, lang, merchantInfo, customerInfo, beid, addressHierarchy); } export let FawryLanguages = /*#__PURE__*/function (FawryLanguages) { FawryLanguages["ENGLISH"] = "ENGLISH"; FawryLanguages["ARABIC"] = "ARABIC"; return FawryLanguages; }({}); export let AddressHierarchy = /*#__PURE__*/function (AddressHierarchy) { AddressHierarchy["MATRIX"] = "MATRIX"; AddressHierarchy["GEOLOCATION"] = "GEOLOCATION"; return AddressHierarchy; }({}); export class Address {} export class AddressType {} export class Area {} export class Geolocation {} class OptionalPaymentParams {} 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_CARD_MANAGER_FAIL = 'FAWRY_EVENT_CARD_MANAGER_FAIL'; static FAWRY_EVENT_ADDRESS_MANAGER_FAIL = 'FAWRY_EVENT_ADDRESS_MANAGER_FAIL'; } //# sourceMappingURL=index.js.map