UNPKG

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

Version:

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

74 lines (72 loc) 3.03 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Geolocation = exports.FawryLanguages = exports.FawryCallbacks = exports.Area = exports.AddressType = exports.AddressHierarchy = exports.Address = void 0; exports.openAddressManager = openAddressManager; exports.openCardsManager = openCardsManager; exports.startPayment = startPayment; var _reactNative = require("react-native"); const LINKING_ERROR = ` The package '@fawry_pay/rn-fawry-pay-sdk' doesn't seem to be linked. Make sure: ${_reactNative.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 = _reactNative.NativeModules.RnFawryPaySdk || new Proxy({}, { get() { throw new Error(LINKING_ERROR); } }); 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); } async function openCardsManager(baseUrl, lang, merchantInfo, customerInfo) { RnFawryPaySdk.openCardsManager(baseUrl, lang, merchantInfo, customerInfo); } async function openAddressManager(baseUrl, lang, merchantInfo, customerInfo, beid, addressHierarchy) { RnFawryPaySdk.openAddressManager(baseUrl, lang, merchantInfo, customerInfo, beid, addressHierarchy); } let FawryLanguages = /*#__PURE__*/function (FawryLanguages) { FawryLanguages["ENGLISH"] = "ENGLISH"; FawryLanguages["ARABIC"] = "ARABIC"; return FawryLanguages; }({}); exports.FawryLanguages = FawryLanguages; let AddressHierarchy = /*#__PURE__*/function (AddressHierarchy) { AddressHierarchy["MATRIX"] = "MATRIX"; AddressHierarchy["GEOLOCATION"] = "GEOLOCATION"; return AddressHierarchy; }({}); exports.AddressHierarchy = AddressHierarchy; class Address {} exports.Address = Address; class AddressType {} exports.AddressType = AddressType; class Area {} exports.Area = Area; class Geolocation {} exports.Geolocation = Geolocation; class OptionalPaymentParams {} class FawryCallbacks { static FawryEmitter = new _reactNative.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'; } exports.FawryCallbacks = FawryCallbacks; //# sourceMappingURL=index.js.map