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A;WACA;WACA;WACA,GAAG;WACH;WACA;WACA;WACA;WACA;WACA,GAAG;WACH;WACA,EAAE;WACF;WACA;;;;;WChEA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;UENA;UACA;UACA;UACA","sources":["webpack://moyasar-payments/./assets/blocks/src/js/forms/applepay.js","webpack://moyasar-payments/./assets/blocks/src/js/forms/creditcard.js","webpack://moyasar-payments/./assets/blocks/src/js/forms/samsungpay.js","webpack://moyasar-payments/./assets/blocks/src/js/forms/stcpay.js","webpack://moyasar-payments/./assets/blocks/src/js/index.js","webpack://moyasar-payments/external window \"React\"","webpack://moyasar-payments/external window [\"wp\",\"htmlEntities\"]","webpack://moyasar-payments/webpack/bootstrap","webpack://moyasar-payments/webpack/runtime/async module","webpack://moyasar-payments/webpack/runtime/compat get default export","webpack://moyasar-payments/webpack/runtime/define property getters","webpack://moyasar-payments/webpack/runtime/hasOwnProperty shorthand","webpack://moyasar-payments/webpack/runtime/make namespace object","webpack://moyasar-payments/webpack/before-startup","webpack://moyasar-payments/webpack/startup","webpack://moyasar-payments/webpack/after-startup"],"sourcesContent":["import React, {useEffect, useRef, useState} from 'react';\nimport {decodeEntities} from '@wordpress/html-entities';\n\nconst ApplePayContent = (props) => {\n /**\n * Props\n */\n const {\n eventRegistration,\n emitResponse,\n setting,\n onSubmit,\n billing\n } = props;\n\n let data = decodeEntities(setting.description || '');\n\n /**\n * @description Define the events\n */\n const {onPaymentSetup, onCheckoutSuccess, onCheckoutFail} = eventRegistration;\n\n /**\n * @description To save the payment token\n * @type {null}\n */\n let paymentToken = null;\n\n /**\n * @description Total Checkout Amount\n * @type {React.MutableRefObject}\n */\n const totalPrice = useRef(0);\n\n /**\n * @description Payment Status\n */\n const [paymentStatus, setPaymentStatus] = useState({\n status: '',\n message: ''\n });\n\n /**\n * @description Detect the total price change\n */\n useEffect(() => {\n totalPrice.current = billing.cartTotal.value;\n }, [billing.cartTotal.value]);\n\n /**\n * @description Handle Apple Pay Button Clicked\n */\n function handleApplePayButtonClicked() {\n setPaymentStatus({\n status: '',\n message: ''\n })\n\n const request = new MoyasarRequest(setting.baseUrl, setting.publishableKey, setting.id)\n const currency = billing.currency.code;\n\n if (!ApplePaySession) {\n return;\n }\n MoyasarAppleHelper.startSession(setting.countryCode, currency, setting.supportedNetworks, setting.supportedCountries, setting.storeName, `${request.getFinalPrice(totalPrice.current)}`);\n\n\n MoyasarAppleHelper.appleSession.oncancel = event => {\n MoyasarAppleHelper.appleSession.abort();\n }\n MoyasarAppleHelper.appleSession.abort = event => {\n }\n\n // Validating Merchant\n MoyasarAppleHelper.appleSession.onvalidatemerchant = async event => {\n const body = {\n \"validation_url\": event.validationURL,\n \"display_name\": setting.storeName,\n \"domain_name\": window.location.hostname,\n \"publishable_api_key\": setting.publishableKey,\n }\n request.initiateApplePay(body).then(merchantSession => {\n MoyasarAppleHelper.appleSession.completeMerchantValidation(merchantSession);\n\n }).catch(error => {\n MoyasarAppleHelper.appleSession.completeMerchantValidation({});\n MoyasarAppleHelper.appleSession.abort();\n setPaymentStatus({\n status: 'failed',\n message: error?.message || 'An error occurred'\n })\n })\n\n }\n\n MoyasarAppleHelper.appleSession.onpaymentauthorized = event => {\n paymentToken = event.payment.token;\n onSubmit();\n };\n\n MoyasarAppleHelper.appleSession.begin();\n }\n\n /**\n * @description Set Apple Pay Button on component mount & remove on unmount\n */\n useEffect(() => {\n MoyasarAppleHelper.setApplePayButton(handleApplePayButtonClicked);\n return () => {\n // Remove the Apple Pay button\n MoyasarAppleHelper.resetPlaceOrderButton();\n };\n }, []);\n\n /**\n * @description Attach the payment token (apple pay) to the form before submitting\n */\n useEffect(() => {\n const unsubscribe = onPaymentSetup(async () => {\n return {\n type: emitResponse.responseTypes.SUCCESS,\n meta: {\n paymentMethodData: {\n 'mysr_token': JSON.stringify(paymentToken),\n 'moyasar-ap-nonce-field': moyasar_notice.value\n },\n },\n };\n });\n // Unsubscribes when this component is unmounted.\n return () => {\n unsubscribe();\n };\n }, [\n emitResponse.responseTypes.ERROR,\n emitResponse.responseTypes.SUCCESS,\n onPaymentSetup,\n ]);\n\n /**\n * @description Checkout Success\n */\n useEffect(() => {\n const unsubscribe = onCheckoutSuccess(async (data) => {\n const response = data.processingResponse.paymentDetails;\n MoyasarAppleHelper.appleSession.completePayment({\n status: MoyasarAppleHelper.appleSession.STATUS_SUCCESS\n });\n return {\n type: emitResponse.responseTypes.SUCCESS,\n message: '',\n }\n });\n return () => {\n unsubscribe();\n };\n }, [onCheckoutSuccess, emitResponse.responseTypes.ERROR]);\n\n /**\n * @description Checkout Fail\n */\n useEffect(() => {\n const unsubscribe = onCheckoutFail(async (data) => {\n const response = data.processingResponse.paymentDetails;\n MoyasarAppleHelper.appleSession.completeMerchantValidation({});\n MoyasarAppleHelper.appleSession.abort();\n return {\n type: emitResponse.responseTypes.ERROR,\n message: '',\n }\n });\n return () => {\n unsubscribe();\n };\n }, [onCheckoutFail, emitResponse.responseTypes.ERROR]);\n\n return (\n
\n
\n {paymentStatus.message && (\n \n {paymentStatus.message}\n
\n )}\n {data}\n\n {data}\n
\n \n );\n};\n\n\nexport default ApplePayContent;","import React, {useState, useEffect, useRef} from \"react\";\nimport {decodeEntities} from '@wordpress/html-entities';\nconst __mysr_cc = wp.i18n.__\nconst CreditCardContent = (props) => {\n /**\n * Props\n */\n const {setting, eventRegistration, emitResponse, billing} = props;\n\n /**\n * @description Define the events\n */\n const {onPaymentSetup, onCheckoutSuccess, onCheckoutFail} = eventRegistration;\n\n let data = decodeEntities(setting.description || '');\n\n /**\n * @description Form Ref\n */\n const [errors, setErrors] = useState({});\n const [formData, setFormData] = useState({\n name: '',\n number: '',\n expiry: '',\n cvc: '',\n });\n\n const form = useRef(formData);\n\n /**\n * @description Detect the form data change\n */\n useEffect(() => {\n form.current = formData;\n }, [formData]); // Update the ref every time myState changes\n\n /**\n * @description Setup Payment and get card token before submitting the form\n */\n useEffect(() => {\n const unsubscribe = onPaymentSetup(async () => {\n const payload = form.current;\n\n const submitCard = {};\n // Loop through fields\n for (const field in payload) {\n let validationResult = validateField(field, payload[field]);\n if (validationResult.isValid === false) {\n return {\n type: emitResponse.responseTypes.ERROR,\n message: validationResult.message\n };\n }\n if (field === 'expiry') {\n submitCard['month'] = validationResult.submitValue.substring(0, 2);\n submitCard['year'] = validationResult.submitValue.substring(2);\n } else {\n submitCard[field] = validationResult.submitValue;\n }\n }\n\n\n const request = new MoyasarRequest(setting.baseUrl, setting.publishableKey, setting.id)\n try {\n let init = await request.initiateCreditCard(submitCard);\n return {\n type: emitResponse.responseTypes.SUCCESS,\n meta: {\n paymentMethodData: {\n 'mysr_token': init.id,\n 'mysr_form': 'blocks',\n 'moyasar-cc-nonce-field': moyasar_notice.value\n },\n },\n };\n } catch (error) {\n let message = '';\n if (error.type === 'authentication_error'){\n message = error.message\n }else{\n const fields = error.errors;\n // Get First field\n message = fields[Object.keys(fields)[0]][0];\n }\n return {\n type: emitResponse.responseTypes.ERROR,\n message: message\n };\n }\n });\n // Unsubscribes when this component is unmounted.\n return () => {\n unsubscribe();\n };\n }, [\n emitResponse.responseTypes.ERROR,\n emitResponse.responseTypes.SUCCESS,\n onPaymentSetup,\n ]);\n\n /**\n * @description Checkout Success, start the 3D Secure process (Modal)\n */\n useEffect(() => {\n const unsubscribe = onCheckoutSuccess(async (data) => {\n const response = data.processingResponse.paymentDetails;\n const iframe = jQuery('#mysr-3d-secure-iframe');\n iframe.attr('src', response.transactionUrl);\n await popupManager();\n return {\n type: emitResponse.responseTypes.SUCCESS,\n message: '',\n }\n });\n return () => {\n unsubscribe();\n };\n }, [onCheckoutSuccess, emitResponse.responseTypes.SUCCESS]);\n\n /**\n * @description Checkout Fail\n */\n useEffect(() => {\n const unsubscribe = onCheckoutFail(async (data) => {\n return {\n type: emitResponse.responseTypes.ERROR,\n message: data.message,\n }\n });\n return () => {\n unsubscribe();\n };\n }, [onCheckoutFail, emitResponse.responseTypes.ERROR]);\n\n /**\n * @description Popup Manager\n * @returns {Promise}\n */\n const popupManager = () => {\n return new Promise(async (resolve, reject) => {\n await showModal();\n resolve(true);\n });\n }\n\n /**\n * @description Show Modal\n * @returns {Promise}\n */\n const showModal = () => {\n return new Promise((resolve, reject) => {\n const modal = document.getElementById('mysr-modal');\n const iframe = document.getElementById('mysr-3d-secure-iframe');\n modal.style.display = \"block\";\n const interval = setInterval(() => {\n try {\n let location = iframe.contentWindow?.location;\n let href = location?.href;\n if (href && href.includes('mysr_checkout')) {\n clearInterval(interval);\n modal.style.display = \"none\";\n resolve(true);\n }\n } catch (e) {}\n // TODO: Timeout\n }, 50)\n });\n }\n\n\n /**\n * @description Validate Field\n */\n const validateField = (field, value, showError = true) => {\n let result = {};\n if (field === 'name') {\n result = MoyasarValidation.cardName(value);\n } else if (field === 'number') {\n result = MoyasarValidation.cardNumber(value);\n } else if (field === 'expiry') {\n result = MoyasarValidation.cardExpiry(value);\n } else if (field === 'cvc') {\n result = MoyasarValidation.cvc(value);\n } else {\n return {isValid: false, showValue: ''};\n }\n\n\n if (result.isValid === false && showError) {\n setErrors({...errors, field: result.message});\n } else {\n setErrors({});\n }\n\n return result;\n }\n\n /**\n * @description Handle Change\n * @param e\n */\n const handleChange = (e) => {\n let {name, value} = e.target;\n\n let result = validateField(name, value, false);\n value = result.showValue;\n\n setFormData({...formData, [name]: value});\n };\n\n /**\n * @description Set submit button\n */\n useEffect(() => {\n console.log(props)\n console.log(billing)\n MoyasarTriggers.setMoyasarSubmitButton(`${(billing.cartTotal.value / 100).toFixed(2)}`);\n return () => {\n // Remove the submit button\n MoyasarTriggers.resetPlaceOrderButton();\n };\n }, []);\n\n\n return (\n
\n
\n
\n \n
\n\n\n
\n
\n {data}\n
\n \n \n
\n\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n );\n};\n\n\nexport default CreditCardContent;","import React, {useEffect, useRef, useState} from 'react';\nimport {decodeEntities} from '@wordpress/html-entities';\n\nconst SamsungPayContent = (props) => {\n /**\n * Props\n */\n const {\n eventRegistration,\n emitResponse,\n setting,\n onSubmit,\n billing\n } = props;\n\n let data = decodeEntities(setting.description || '');\n\n /**\n * @description Define the events\n */\n const {onPaymentSetup, onCheckoutSuccess, onCheckoutFail} = eventRegistration;\n\n /**\n * @description To save the payment token\n * @type {null}\n */\n let paymentToken = null;\n\n /**\n * @description Total Checkout Amount\n * @type {React.MutableRefObject}\n */\n const totalPrice = useRef(0);\n\n /**\n * @description Payment Status\n */\n const [paymentStatus, setPaymentStatus] = useState({\n status: '',\n message: ''\n });\n\n /**\n * @description Detect the total price change\n */\n useEffect(() => {\n totalPrice.current = billing.cartTotal.value;\n }, [billing.cartTotal.value]);\n\n /**\n * @description Handle Samsung Pay Button Clicked\n */\n function handleSamsungPayButtonClicked() {\n setPaymentStatus({\n status: '',\n message: ''\n })\n const request = new MoyasarRequest(setting.baseUrl, setting.publishableKey, setting.id)\n\n const transactionDetail = {\n orderNumber: 'ORDER-' + new Date().getTime(),\n merchant: {\n name: setting.storeName,\n countryCode: setting.countryCode,\n url: window.location.hostname\n },\n amount: {\n option: 'FORMAT_TOTAL_PRICE_ONLY',\n currency: setting.storeCurrency,\n total: `${request.getFinalPrice(totalPrice.current)}`\n }\n };\n MoyasarSamsungHelper.SamsungPaySession.loadPaymentSheet(MoyasarSamsungHelper.samsungPaymentMethods, transactionDetail)\n .then((credentials) => {\n paymentToken = credentials['3DS']['data'];\n onSubmit();\n })\n .catch(function (err) {\n console.log(err)\n // The user canceled or something else failed\n MoyasarSamsungHelper.SamsungPaySession.notify({status: 'CANCELED', provider: 'Moyasar'});\n });\n }\n\n /**\n * @description Set Samsung Pay Button on component mount & remove on unmount\n */\n useEffect(() => {\n MoyasarSamsungHelper.setSamsungPayButton(handleSamsungPayButtonClicked);\n return () => {\n // Remove the Samsung Pay button\n MoyasarSamsungHelper.resetPlaceOrderButton();\n };\n }, []);\n\n /**\n * @description Attach the payment token (samsung pay) to the form before submitting\n */\n useEffect(() => {\n const unsubscribe = onPaymentSetup(async () => {\n return {\n type: emitResponse.responseTypes.SUCCESS,\n meta: {\n paymentMethodData: {\n 'mysr_token': paymentToken,\n 'moyasar-sp-nonce-field': moyasar_notice.value\n },\n },\n };\n });\n // Unsubscribes when this component is unmounted.\n return () => {\n unsubscribe();\n };\n }, [\n emitResponse.responseTypes.ERROR,\n emitResponse.responseTypes.SUCCESS,\n onPaymentSetup,\n ]);\n\n /**\n * @description Checkout Success\n */\n useEffect(() => {\n const unsubscribe = onCheckoutSuccess(async (data) => {\n const response = data.processingResponse.paymentDetails;\n MoyasarSamsungHelper.SamsungPaySession.notify({status: 'CHARGED', provider: 'Moyasar'});\n return {\n type: emitResponse.responseTypes.SUCCESS,\n message: '',\n }\n });\n return () => {\n unsubscribe();\n };\n }, [onCheckoutSuccess, emitResponse.responseTypes.ERROR]);\n\n /**\n * @description Checkout Fail\n */\n useEffect(() => {\n const unsubscribe = onCheckoutFail(async (data) => {\n const response = data.processingResponse.paymentDetails;\n MoyasarSamsungHelper.SamsungPaySession.notify({status: 'ERRED', provider: 'Moyasar'});\n return {\n type: emitResponse.responseTypes.ERROR,\n message: '',\n }\n });\n return () => {\n unsubscribe();\n };\n }, [onCheckoutFail, emitResponse.responseTypes.ERROR]);\n\n return (\n
\n
\n {paymentStatus.message && (\n \n {paymentStatus.message}\n
\n )}\n {data}\n
\n \n );\n};\n\n\nexport default SamsungPayContent;","import React, {useState, useEffect, useRef} from 'react';\nimport {decodeEntities} from '@wordpress/html-entities';\nconst __mysr_sp = wp.i18n.__\n\nconst STCPayContent = (props) => {\n /**\n * Props\n */\n const {setting, onSubmit, eventRegistration, emitResponse, billing} = props;\n\n /**\n * @description Define the events\n */\n const {onPaymentSetup, onCheckoutSuccess, onCheckoutFail} = eventRegistration;\n\n /**\n * @description Payment Status\n */\n const [paymentStatus, setPaymentStatus] = useState({\n status: '',\n message: ''\n });\n\n /**\n * @description Payment Step\n */\n const [paymentStep, setPaymentStep] = useState('PHONE');\n\n /**\n * @description Payment Validation URL (Redirect with OTP)\n */\n const [paymentValidationUrl, setPaymentValidationUrl] = useState('');\n\n\n let data = decodeEntities(setting.description || '');\n const [formData, setFormData] = useState({\n phone: '',\n otp: ''\n });\n\n const form = useRef(formData);\n useEffect(() => {\n form.current = formData;\n }, [formData]);\n\n\n const [errors, setErrors] = useState({phone: '', otp: ''});\n\n /**\n * @description Detect the total price change, reset step to PHONE\n */\n useEffect((data) => {\n setPaymentStep('PHONE');\n setPaymentStatus({\n status: '',\n message: ''\n });\n // Reset payment cycle\n\n }, [ billing.cartTotal.value ]);\n\n\n /**\n * @description Disable Place Order Button on Mount\n */\n useEffect(() => {\n let placeOrderButton = null\n // On document load\n window.onload = () => {\n // Disable Place Order Button\n placeOrderButton = document.getElementsByClassName('wc-block-components-checkout-place-order-button')[0];\n placeOrderButton.disabled = true;\n };\n\n\n\n return () => {\n // Reset Place Order Button\n if (placeOrderButton){\n placeOrderButton.disabled = false;\n }\n };\n }, []);\n\n /**\n * @description attach phone before submitting the form\n */\n useEffect(() => {\n const unsubscribe = onPaymentSetup(async () => {\n const payload = form.current;\n let validationResult = validateField('phone', payload.phone);\n if (validationResult.isValid === false) {\n return {\n type: emitResponse.responseTypes.ERROR,\n message: validationResult.message,\n };\n }\n\n return {\n type: emitResponse.responseTypes.SUCCESS,\n meta: {\n paymentMethodData: {\n 'mysr_token': validationResult.submitValue,\n 'moyasar-stc-nonce-field': moyasar_notice.value\n },\n },\n };\n });\n // Unsubscribes when this component is unmounted.\n return () => {\n unsubscribe();\n };\n }, [\n emitResponse.responseTypes.ERROR,\n emitResponse.responseTypes.SUCCESS,\n onPaymentSetup,\n ]);\n\n\n /**\n * @description Checkout Success, Switch to OTP Step\n */\n useEffect( () => {\n const unsubscribe = onCheckoutSuccess(async (data) => {\n const response = data.processingResponse.paymentDetails;\n setPaymentStatus({\n status: 'success',\n message: __mysr_sp('OTP Sent Successfully. Please enter the OTP code you received.', 'moyasar')\n });\n setPaymentStep('OTP');\n setPaymentValidationUrl(response.redirect);\n await new Promise(resolve => setTimeout(resolve, 100000));\n\n if (paymentStep === 'PHONE') {\n return;\n }\n\n return {\n type: emitResponse.responseTypes.ERROR,\n message: 'Timeout',\n }\n });\n return () => {\n unsubscribe();\n };\n }, [onCheckoutSuccess, emitResponse.responseTypes.SUCCESS]);\n\n\n /**\n * @description Checkout Fail\n */\n useEffect(() => {\n const unsubscribe = onCheckoutFail(async (data) => {\n const response = data.processingResponse.paymentDetails;\n setPaymentStatus({\n status: 'failed',\n message: response.message\n })\n return {\n type: emitResponse.responseTypes.ERROR,\n message: response.message,\n }\n });\n return () => {\n unsubscribe();\n };\n }, [onCheckoutFail, emitResponse.responseTypes.ERROR]);\n\n\n /**\n * @description Handle OTP Submission\n * @param e\n */\n const handleSubmit = (e) => {\n e.preventDefault();\n onSubmit();\n };\n\n /**\n * @description Redirect to Validation URL with OTP\n * @param e\n */\n const handleVerify = (e) => {\n e.preventDefault();\n // Redirect to Validation URL\n window.location.href = paymentValidationUrl + '&otp=' + formData.otp;\n };\n\n /**\n * @description Validate Field\n */\n const validateField = (field, value, showError = true) => {\n let result = {};\n if (field === 'phone') {\n result = MoyasarValidation.phoneNumber(value);\n } else if (field === 'otp') {\n result = MoyasarValidation.otp(value);\n } else {\n return {isValid: false, showValue: ''};\n }\n\n\n if (result.isValid === false && showError) {\n setErrors({...errors, field: result.message});\n } else {\n setErrors({});\n }\n\n return result;\n }\n\n const handleChange = (e) => {\n let {name, value} = e.target;\n\n let result = validateField(name, value, false);\n value = result.showValue;\n\n setFormData({...formData, [name]: value});\n };\n\n return (\n
\n
\n {paymentStatus.message && (\n
\n {paymentStatus.message}\n
\n )}\n {data}\n\n

{ __mysr_sp('Please enter your mobile number and press \\'Send OTP\\'. You will receive an SMS code required to complete the payment process.', 'moyasar') }

\n {paymentStep === 'PHONE' && (\n \n \n
)}\n\n {paymentStep === 'OTP' && (\n \n \n
)}\n\n\n {/* Submit Button */}\n {paymentStep === 'PHONE' && ()}\n\n {paymentStep === 'OTP' && ()}\n \n \n );\n};\n\n\nexport default STCPayContent;","/**\n * External dependencies\n */\nconst registerPaymentMethod = window.wc.wcBlocksRegistry.registerPaymentMethod;\nconst getPaymentMethodData = window.wc.wcSettings.getPaymentMethodData;\n\n/**\n * Payment Methods\n */\nimport CreditCardContent from \"./forms/creditcard\";\nimport STCPayContent from \"./forms/stcpay\";\nimport ApplePayContent from \"./forms/applepay\";\nimport SamsungPayContent from \"./forms/samsungpay\";\n\nconst i18n = window.wp.i18n\nconst settings = getPaymentMethodData('moyasar', {});\n\nconst isEnabled = (method) => settings[method].enabled;\nconst getTitle = (method) => settings[method].title;\nconst getIcon = (method) => settings[method].icon;\nconst getSupports = (method) => settings[method].supports;\nconst Icon = (props) => {\n const icons = props.images;\n if (!icons) {\n return '';\n }\n return icons.map((icon, index) => {\n return {icon}/\n });\n\n}\nconst Label = (props) => {\n return \n {getTitle(props.setting)}\n \n \n};\n\n\n/**\n * Credit card payment method\n */\nconst creditCardPaymentName = 'moyasar-credit-card';\nif (settings[creditCardPaymentName]) {\n const creditCardPaymentMethod = {\n name: creditCardPaymentName,\n label: