@pinerohit11/testwidget 0.1.21 → 0.1.22
Sign up to get free protection for your applications and to get access to all the features.
- package/.next/app-build-manifest.json +1 -0
- package/.next/build-manifest.json +13 -2
- package/.next/cache/webpack/client-development/0.pack.gz +0 -0
- package/.next/cache/webpack/client-development/1.pack.gz +0 -0
- package/.next/cache/webpack/client-development/10.pack.gz +0 -0
- package/.next/cache/webpack/client-development/14.pack.gz +0 -0
- package/.next/cache/webpack/client-development/15.pack.gz +0 -0
- package/.next/cache/webpack/client-development/16.pack.gz +0 -0
- package/.next/cache/webpack/client-development/17.pack.gz +0 -0
- package/.next/cache/webpack/client-development/18.pack.gz +0 -0
- package/.next/cache/webpack/client-development/19.pack.gz +0 -0
- package/.next/cache/webpack/client-development/2.pack.gz +0 -0
- package/.next/cache/webpack/client-development/3.pack.gz +0 -0
- package/.next/cache/webpack/client-development/4.pack.gz +0 -0
- package/.next/cache/webpack/client-development/6.pack.gz +0 -0
- package/.next/cache/webpack/client-development/7.pack.gz +0 -0
- package/.next/cache/webpack/client-development/index.pack.gz +0 -0
- package/.next/cache/webpack/client-development/index.pack.gz.old +0 -0
- package/.next/cache/webpack/client-development-fallback/0.pack.gz +0 -0
- package/.next/cache/webpack/client-development-fallback/1.pack.gz +0 -0
- package/.next/cache/webpack/client-development-fallback/index.pack.gz +0 -0
- package/.next/cache/webpack/client-development-fallback/index.pack.gz.old +0 -0
- package/.next/cache/webpack/server-development/10.pack.gz +0 -0
- package/.next/cache/webpack/server-development/11.pack.gz +0 -0
- package/.next/cache/webpack/server-development/12.pack.gz +0 -0
- package/.next/cache/webpack/server-development/13.pack.gz +0 -0
- package/.next/cache/webpack/server-development/2.pack.gz +0 -0
- package/.next/cache/webpack/server-development/4.pack.gz +0 -0
- package/.next/cache/webpack/server-development/5.pack.gz +0 -0
- package/.next/cache/webpack/server-development/6.pack.gz +0 -0
- package/.next/cache/webpack/server-development/7.pack.gz +0 -0
- package/.next/cache/webpack/server-development/8.pack.gz +0 -0
- package/.next/cache/webpack/server-development/9.pack.gz +0 -0
- package/.next/cache/webpack/server-development/index.pack.gz +0 -0
- package/.next/cache/webpack/server-development/index.pack.gz.old +0 -0
- package/.next/fallback-build-manifest.json +28 -0
- package/.next/server/_error.js +76 -0
- package/.next/server/app/_not-found/page.js +2 -2
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page.js +15 -15
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +1 -0
- package/.next/server/middleware-build-manifest.js +13 -2
- package/.next/server/pages/_app.js +46 -0
- package/.next/server/pages/_document.js +66 -0
- package/.next/server/pages/_error.js +76 -0
- package/.next/server/pages-manifest.json +5 -1
- package/.next/server/vendor-chunks/@swc.js +20 -0
- package/.next/server/vendor-chunks/bootstrap.js +2 -2
- package/.next/server/vendor-chunks/next.js +537 -0
- package/.next/server/webpack-runtime.js +6 -1
- package/.next/static/chunks/_error.js +28 -0
- package/.next/static/chunks/app/layout.js +8 -30
- package/.next/static/chunks/app/page.js +23 -1
- package/.next/static/chunks/fallback/amp.js +885 -0
- package/.next/static/chunks/fallback/main.js +2057 -0
- package/.next/static/chunks/fallback/pages/_app.js +28 -0
- package/.next/static/chunks/fallback/pages/_error.js +28 -0
- package/.next/static/chunks/fallback/react-refresh.js +62 -0
- package/.next/static/chunks/fallback/webpack.js +1210 -0
- package/.next/static/chunks/main.js +2057 -0
- package/.next/static/chunks/pages/_app.js +28 -0
- package/.next/static/chunks/pages/_error.js +28 -0
- package/.next/static/chunks/react-refresh.js +62 -0
- package/.next/static/chunks/webpack.js +1 -1
- package/.next/static/css/app/layout.css +0 -699
- package/.next/static/css/app/page.css +9 -9
- package/.next/static/development/_buildManifest.js +1 -1
- package/.next/static/webpack/09b6bf9d551718e6.webpack.hot-update.json +1 -0
- package/.next/static/webpack/255312d1130cf6ec.webpack.hot-update.json +1 -0
- package/.next/static/webpack/32e5c09644d13662.webpack.hot-update.json +1 -0
- package/.next/static/webpack/33df40926ef177b8.webpack.hot-update.json +1 -0
- package/.next/static/webpack/5a1cff97146b50bb.webpack.hot-update.json +1 -0
- package/.next/static/webpack/605a7773ba1d798b.webpack.hot-update.json +1 -0
- package/.next/static/webpack/7e9ea68e1248f8c4.webpack.hot-update.json +1 -0
- package/.next/static/webpack/954c98691962cd98.webpack.hot-update.json +1 -0
- package/.next/static/webpack/973f3512b11e3d54.webpack.hot-update.json +1 -0
- package/.next/static/webpack/a6280d0500ceb91c.webpack.hot-update.json +1 -0
- package/.next/static/webpack/app/layout.255312d1130cf6ec.hot-update.js +31 -0
- package/.next/static/webpack/app/layout.32e5c09644d13662.hot-update.js +32 -0
- package/.next/static/webpack/app/layout.33df40926ef177b8.hot-update.js +21 -0
- package/.next/static/webpack/app/layout.5a1cff97146b50bb.hot-update.js +21 -0
- package/.next/static/webpack/app/layout.7e9ea68e1248f8c4.hot-update.js +31 -0
- package/.next/static/webpack/app/layout.954c98691962cd98.hot-update.js +21 -0
- package/.next/static/webpack/app/layout.a6280d0500ceb91c.hot-update.js +22 -0
- package/.next/static/webpack/app/layout.c6e67d2545c174a8.hot-update.js +21 -0
- package/.next/static/webpack/app/layout.f678ffea2e9fb9a3.hot-update.js +32 -0
- package/.next/static/webpack/app/page.09b6bf9d551718e6.hot-update.js +32 -0
- package/.next/static/webpack/app/page.605a7773ba1d798b.hot-update.js +32 -0
- package/.next/static/webpack/app/page.954c98691962cd98.hot-update.js +22 -0
- package/.next/static/webpack/c6e67d2545c174a8.webpack.hot-update.json +1 -0
- package/.next/static/webpack/f678ffea2e9fb9a3.webpack.hot-update.json +1 -0
- package/.next/static/webpack/webpack.09b6bf9d551718e6.hot-update.js +18 -0
- package/.next/static/webpack/webpack.255312d1130cf6ec.hot-update.js +18 -0
- package/.next/static/webpack/webpack.32e5c09644d13662.hot-update.js +18 -0
- package/.next/static/webpack/webpack.33df40926ef177b8.hot-update.js +18 -0
- package/.next/static/webpack/webpack.5a1cff97146b50bb.hot-update.js +18 -0
- package/.next/static/webpack/webpack.605a7773ba1d798b.hot-update.js +18 -0
- package/.next/static/webpack/webpack.7e9ea68e1248f8c4.hot-update.js +18 -0
- package/.next/static/webpack/webpack.954c98691962cd98.hot-update.js +18 -0
- package/.next/static/webpack/webpack.973f3512b11e3d54.hot-update.js +18 -0
- package/.next/static/webpack/webpack.a6280d0500ceb91c.hot-update.js +18 -0
- package/.next/static/webpack/webpack.c6e67d2545c174a8.hot-update.js +18 -0
- package/.next/static/webpack/webpack.f678ffea2e9fb9a3.hot-update.js +18 -0
- package/.next/trace +44 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";var ae=Object.create;var y=Object.defineProperty,oe=Object.defineProperties,te=Object.getOwnPropertyDescriptor,ie=Object.getOwnPropertyDescriptors,re=Object.getOwnPropertyNames,E=Object.getOwnPropertySymbols,ne=Object.getPrototypeOf,C=Object.prototype.hasOwnProperty,le=Object.prototype.propertyIsEnumerable;var M=(i,t,l)=>t in i?y(i,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):i[t]=l,d=(i,t)=>{for(var l in t||(t={}))C.call(t,l)&&M(i,l,t[l]);if(E)for(var l of E(t))le.call(t,l)&&M(i,l,t[l]);return i},c=(i,t)=>oe(i,ie(t));var pe=(i,t)=>{for(var l in t)y(i,l,{get:t[l],enumerable:!0})},X=(i,t,l,q)=>{if(t&&typeof t=="object"||typeof t=="function")for(let h of re(t))!C.call(i,h)&&h!==l&&y(i,h,{get:()=>t[h],enumerable:!(q=te(t,h))||q.enumerable});return i};var N=(i,t,l)=>(l=i!=null?ae(ne(i)):{},X(t||!i||!i.__esModule?y(l,"default",{value:i,enumerable:!0}):l,i)),de=i=>X(y({},"__esModule",{value:!0}),i);var me={};pe(me,{PaywithFractal:()=>ce});module.exports=de(me);var ke=require("bootstrap/dist/css/bootstrap.min.css");var U=N(require("axios"),1),e=N(require("react"),1),b=require("react-bootstrap");function ce({name:i,amount:t,orderId:l,fractalPayClientKey:q}){let h="http://192.168.1.52:8082/",Q="http://192.168.1.52:8081/";console.log(i,"name",window==null?void 0:window.DatacapWebToken);let[G,Y]=(0,e.useState)(""),[m,p]=(0,e.useState)({}),[V,j]=(0,e.useState)(!1),[n,K]=(0,e.useState)({name:"John Doe",card_number:"4761 7310 0000 0043",exp_month:"12",exp_year:"2024",cvv:"201",zip:""}),[xe,u]=(0,e.useState)(!1),[T,v]=(0,e.useState)(!1),z=async o=>{var r,f,J,W,S,F,w;o.preventDefault();let a={description:"widget payment",amount:t||"1.00",phone_number:"1234567908",zip:n.zip,orderId:l||"",fractalpayPublicKey:q};if(Object.keys(m).length<1)try{u(!0);let x=await U.default.post(`${h}create-widget-order`,a,{headers:{"Content-Type":"application/json"}});if(x.data&&((r=x.data)!=null&&r.result)){console.log("token",(f=x.data)==null?void 0:f.data),Y((W=(J=x.data)==null?void 0:J.data)==null?void 0:W.dctoken);let _=async k=>{var A,P,Z;if(console.log("response for token call back",k),k.Error)alert("if"),console.log("Error: ",k),u(!1);else{let $={"Content-Type":"application/x-www-form-urlencoded"},ee=d({name:n.name,postal_code:n.zip},k);try{let s=await U.default.post(`${Q}quick-pay/${(P=(A=x.data)==null?void 0:A.data)==null?void 0:P.posSalesIdEncode}`,ee,{headers:$});u(!1),console.log("quick response",s),(Z=s==null?void 0:s.data)!=null&&Z.result&&(s==null?void 0:s.status)===200?(console.log("Payment success!",s==null?void 0:s.data),K({name:"John Doe",card_number:"4761 7310 0000 0043",exp_month:"12",exp_year:"2024",cvv:"201",zip:""})):console.log("Payment failed!",s==null?void 0:s.data)}catch(s){console.log("Error: ",s),u(!1)}}};window==null||window.DatacapWebToken.requestToken((F=(S=x.data)==null?void 0:S.data)==null?void 0:F.dctoken,"PaymentForm",_)}else u(!1),console.log("res",(w=x.data)==null?void 0:w.data)}catch(x){u(!1),console.log(x)}},R=o=>{let r=(""+o).replace(/\D/g,"").match(/^(\d{4})(\d{4})(\d{4})(\d{4})$/);return r?`${r[1]} ${r[2]} ${r[3]} ${r[4]}`:o},D=o=>{p(a=>c(d({},a),{card_number:""})),o&&o.match(/[a-zA-Z]/)?p(a=>c(d({},a),{card_number:"Invalid input. Please enter only numbers."})):o.length>12&&!(window!=null&&window.DatacapWebToken.validateCardNumber(o==null?void 0:o.replaceAll(" ","")))?p(a=>c(d({},a),{card_number:"Invalid Card Number"})):o.length?p({}):p(a=>c(d({},a),{card_number:"Card Number required"}))},I=o=>{p(a=>c(d({},a),{exp_month:""})),/^\d{0,2}$/.test(o)&&(o===""||parseInt(o,10)>=1&&parseInt(o,10)<=12)?p({}):o.length?p(a=>c(d({},a),{exp_month:"Value should be between 1 and 12"})):p(a=>c(d({},a),{exp_month:"Month is required"}))},O=o=>{p(a=>c(d({},a),{exp_year:""})),window!=null&&window.DatacapWebToken.validateExpirationDate(n.exp_month,o)?p({}):o.length?p(a=>c(d({},a),{exp_year:"Invalid Expiration Date."})):p(a=>c(d({},a),{exp_year:"Year is required"}))},B=o=>{p(a=>c(d({},a),{cvv:""})),window!=null&&window.DatacapWebToken.validateCVV(o)?p({}):o.length?p(a=>c(d({},a),{cvv:"Invalid CVV."})):p(a=>c(d({},a),{cvv:"CVV is required"}))},g=o=>{let a=o.target.getAttribute("data-token")||"",r=o.target.value;K(f=>c(d({},f),{[a]:r})),a==="card_number"&&D(r),a==="exp_month"&&I(r),a==="exp_year"&&O(r),a==="cvv"&&B(r)};(0,e.useEffect)(()=>{let o="my-script";if(!document.getElementById(o)){let r=document.createElement("script");r.src="https://token-cert.dcap.com/v1/client",r.id=o,r.async=!0,r.onload=()=>{typeof window!="undefined"&&window.DatacapWebToken?console.log("DatacapWebToken",window.DatacapWebToken):console.log("DatacapWebToken is not loaded yet.")},document.head.appendChild(r)}return()=>{let r=document.getElementById(o);r&&document.head.removeChild(r)}},[]);let L=()=>{v(!1)},H=()=>{console.log("open"),v(!0)};return console.log(T,"open"),e.default.createElement(e.default.Fragment,null,e.default.createElement("div",{style:{width:"100%",textAlign:"center"}},e.default.createElement(b.Button,{onClick:H},"Show")),e.default.createElement(b.Modal,{show:T,onHide:L,backdrop:"static",keyboard:!1,size:"lg"},e.default.createElement(b.Modal.Body,null,e.default.createElement("div",{className:"bg-black"},e.default.createElement("div",{className:"container bg-black"},e.default.createElement("div",{className:"row bg-light no-gutters"},e.default.createElement("div",{className:"col-sm-12"},e.default.createElement("div",{className:"bd-example bd-example-tabs right-tabs mttabs m-3 "},e.default.createElement("div",{className:"payment-popup"},e.default.createElement("button",{className:"close-pop",onClick:()=>{v(!1)}},e.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:37,height:37,viewBox:"0 0 21 21"},e.default.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"m7.5 7.5l6 6m0-6l-6 6"}))),e.default.createElement("div",{className:"row"},e.default.createElement("div",{className:"comp-name"},e.default.createElement("img",{src:"https://invoicestaging.skysystemz.com/assets/products/65c49a2740ff1.png",alt:"",className:"client-logo"})),e.default.createElement("div",{className:""},e.default.createElement("div",{id:"Checkout",className:"inline"},e.default.createElement("div",{className:"header"},e.default.createElement("h1",null,"Pay"),e.default.createElement("i",{className:"fa fa-qrcode fa-2x",id:"qrIcon",title:"Show QR Code",onClick:()=>j(!V)})),e.default.createElement("div",{id:"qrCode",style:{display:V?"block":"none"}},e.default.createElement("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARQAAAEUCAYAAADqcMl5AAAAAklEQVR4AewaftIAABJaSURBVO3BQY7gRhLAQFLo/3+ZO8c8FSCoemwvMsL+YK21LnhYa61LHtZa65KHtda65GGttS55WGutSx7WWuuSh7XWuuRhrbUueVhrrUse1lrrkoe11rrkYa21LnlYa61LHtZa65KHtda65IePVP6miknlpGJSualiUjmpOFGZKk5UpopJ5YuKE5WpYlI5qZhU3qiYVKaKSeWkYlI5qXhD5aRiUvmbKr54WGutSx7WWuuSh7XWuuSHyypuUvlNFW+oTCpTxRsqU8U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ZKk5UTiomlZOKk4qTikllqphUTipOVKaKm1RuelhrrUse1lrrkoe11rrkh/8zFZPKVDGpTConFZPKVDGpnFRMKlPFpDJVfFExqZxUnKi8oXJSMalMFVPFFyonFVPFpDJVnKhMFVPFpPJFxW96WGutSx7WWuuSh7XWuuSHX1bxmyomlaliUnmj4qRiUpkqJpWTipOKSWWqOFF5Q+WkYqqYVKaKSeVE5QuVqWJSmSreUJkqJpWTikllqpgq/s0e1lrrkoe11rrkYa21LvnhMpV/UsWkMlVMKicqJxVTxRcqU8VJxRsVJypTxRsqX1S8oTJVnKhMFZPKScVUMalMFScqU8WkclIxqfyTHtZa65KHtda65GGttS6xP1hrrQse1lrrkoe11rrkYa21LnlYa61LHtZa65KHtda65GGttS55WGutSx7WWuuSh7XWuuRhrbUueVhrrUse1lrrkoe11rrkYa21Lvkf/C+HzIiJCzEAAAAASUVORK5CYII=",alt:"QRCode",srcSet:""})),e.default.createElement("form",{id:"PaymentForm",className:"payment-form",onSubmit:z},e.default.createElement("input",{type:"hidden",id:"dctoken",defaultValue:G,name:"dctoken"}),e.default.createElement("div",{className:"form-group top-amnt"},e.default.createElement("div",{className:"amtleft"},e.default.createElement("label",{htmlFor:"Amount"},"Payment amount"),e.default.createElement("div",{className:"amount-placeholder"},e.default.createElement("span",null,"$"),e.default.createElement("span",null," ",t||1," "))),e.default.createElement("div",{className:"card-row"},e.default.createElement("span",{className:"visa"}),e.default.createElement("span",{className:"mastercard"}),e.default.createElement("span",{className:"amex"}),e.default.createElement("span",{className:"discover"}))),e.default.createElement("div",{className:"form-group"},e.default.createElement("label",{htmlFor:"NameOnCard"},"Name on card"),e.default.createElement("input",{"data-token":"name",id:"NameOnCard",className:"form-control required",type:"text",maxLength:100,placeholder:"name",value:n==null?void 0:n.name,onChange:g}),e.default.createElement("span",{id:"NameOnCard-error",style:{color:"red"}})),e.default.createElement("div",{className:"form-group"},e.default.createElement("input",{"data-token":"card_number",className:"null card-image form-control required",type:"text",maxLength:19,placeholder:"0000 0000 0000 0000",value:R(n==null?void 0:n.card_number),onChange:g}),m.card_number&&e.default.createElement("span",{id:"card_number-error",style:{color:"red"}},m.card_number)),e.default.createElement("div",{className:"expiry-date-group form-group"},e.default.createElement("input",{"data-token":"exp_month",className:"form-control required",type:"text",placeholder:"MM",maxLength:2,value:n==null?void 0:n.exp_month,onChange:g}),m.exp_month&&e.default.createElement("span",{id:"exp_month-error",style:{color:"red"}},m.exp_month)),e.default.createElement("div",{className:"expiry-date-group form-group"},e.default.createElement("input",{"data-token":"exp_year",className:"form-control required",type:"text",placeholder:"YYYY",maxLength:4,value:n==null?void 0:n.exp_year,onChange:g}),m.exp_year&&e.default.createElement("span",{id:"exp_year-error",style:{color:"red"}},m.exp_year)),e.default.createElement("div",{className:"security-code-group form-group"},e.default.createElement("div",{className:"input-container"},e.default.createElement("input",{"data-token":"cvv",className:"form-control required",type:"text",maxLength:4,placeholder:"CVC",value:n==null?void 0:n.cvv,onChange:g}),e.default.createElement("i",{id:"cvc",className:"fa fa-question-circle"})),m.cvv&&e.default.createElement("span",{id:"cvv-error",style:{color:"red"}},m.cvv),e.default.createElement("div",{className:"cvc-preview-container two-card hide"},e.default.createElement("div",{className:"amex-cvc-preview"}),e.default.createElement("div",{className:"visa-mc-dis-cvc-preview"}))),e.default.createElement("div",{className:"zip-code-group form-group"},e.default.createElement("label",{htmlFor:"ZIPCode"},"Postal code"),e.default.createElement("div",{className:"input-container"},e.default.createElement("input",{id:"ZIPCode","data-token":"zip",className:"form-control required",type:"text",maxLength:7,placeholder:"000000",value:n==null?void 0:n.zip,onChange:g}),e.default.createElement("a",{tabIndex:0,role:"button","data-toggle":"popover","data-trigger":"focus","data-placement":"left","data-content":"Enter the ZIP/Postal code for your credit card billing address."},e.default.createElement("i",{className:"fa fa-question-circle"})),e.default.createElement("span",{id:"ZIPCode-error",style:{color:"red",display:"none"}},"This field is required"))),e.default.createElement("button",{id:"PayButton",className:"btn btn-block btn-success submit-button",type:"submit"},e.default.createElement("span",{className:"submit-button-lock"}),e.default.createElement("span",{className:"align-middle"},"Pay $",t||1))),e.default.createElement("div",{className:"powerd-by-part",style:{display:"flex",fontSize:"12px",textAlign:"center",alignItems:"center",justifyContent:"center",margin:"8px 0 20px 0"}},e.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,viewBox:"0 0 26 26"},e.default.createElement("path",{fill:"currentColor",d:"M23.633 5.028a1.074 1.074 0 0 0-.777-.366c-2.295-.06-5.199-2.514-7.119-3.477C14.551.592 13.768.201 13.18.098a1.225 1.225 0 0 0-.36.001c-.588.103-1.371.494-2.556 1.087c-1.92.962-4.824 3.416-7.119 3.476a1.08 1.08 0 0 0-.778.366a1.167 1.167 0 0 0-.291.834c.493 10.023 4.088 16.226 10.396 19.831c.164.093.346.141.527.141s.363-.048.528-.141c6.308-3.605 9.902-9.808 10.396-19.831a1.161 1.161 0 0 0-.29-.834zM18.617 8.97l-5.323 7.855c-.191.282-.491.469-.788.469c-.298 0-.629-.163-.838-.372l-3.752-3.753a.656.656 0 0 1 0-.926l.927-.929a.658.658 0 0 1 .926 0l2.44 2.44l4.239-6.257a.657.657 0 0 1 .91-.173l1.085.736a.657.657 0 0 1 .174.91z"})),"Secure payments powered by Fractal",e.default.createElement("img",{src:"https://ui.fractalpay.com/favicon.ico",alt:"Fractal logo",className:"powered-logo",style:{width:"18px",height:"18px",float:"right",padding:"2px",background:"#000",borderRadius:"4px",marginLeft:"5px"}}))))))))))))))}0&&(module.exports={PaywithFractal});
|
1
|
+
"use strict";var ae=Object.create;var y=Object.defineProperty,oe=Object.defineProperties,te=Object.getOwnPropertyDescriptor,ie=Object.getOwnPropertyDescriptors,re=Object.getOwnPropertyNames,E=Object.getOwnPropertySymbols,ne=Object.getPrototypeOf,C=Object.prototype.hasOwnProperty,le=Object.prototype.propertyIsEnumerable;var M=(i,t,l)=>t in i?y(i,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):i[t]=l,d=(i,t)=>{for(var l in t||(t={}))C.call(t,l)&&M(i,l,t[l]);if(E)for(var l of E(t))le.call(t,l)&&M(i,l,t[l]);return i},c=(i,t)=>oe(i,ie(t));var pe=(i,t)=>{for(var l in t)y(i,l,{get:t[l],enumerable:!0})},X=(i,t,l,q)=>{if(t&&typeof t=="object"||typeof t=="function")for(let h of re(t))!C.call(i,h)&&h!==l&&y(i,h,{get:()=>t[h],enumerable:!(q=te(t,h))||q.enumerable});return i};var N=(i,t,l)=>(l=i!=null?ae(ne(i)):{},X(t||!i||!i.__esModule?y(l,"default",{value:i,enumerable:!0}):l,i)),de=i=>X(y({},"__esModule",{value:!0}),i);var me={};pe(me,{PaywithFractal:()=>ce});module.exports=de(me);var U=N(require("axios"),1),e=N(require("react"),1),b=require("react-bootstrap");var be=require("bootstrap/dist/css/bootstrap.min.css");function ce({name:i,amount:t,orderId:l,fractalPayClientKey:q}){let h="http://192.168.1.52:8082/",Q="http://192.168.1.52:8081/";console.log(i,"name",window==null?void 0:window.DatacapWebToken);let[G,Y]=(0,e.useState)(""),[m,p]=(0,e.useState)({}),[V,j]=(0,e.useState)(!1),[n,K]=(0,e.useState)({name:"John Doe",card_number:"4761 7310 0000 0043",exp_month:"12",exp_year:"2024",cvv:"201",zip:""}),[xe,u]=(0,e.useState)(!1),[T,v]=(0,e.useState)(!1),z=async o=>{var r,f,J,W,S,F,w;o.preventDefault();let a={description:"widget payment",amount:t||"1.00",phone_number:"1234567908",zip:n.zip,orderId:l||"",fractalpayPublicKey:q};if(Object.keys(m).length<1)try{u(!0);let x=await U.default.post(`${h}create-widget-order`,a,{headers:{"Content-Type":"application/json"}});if(x.data&&((r=x.data)!=null&&r.result)){console.log("token",(f=x.data)==null?void 0:f.data),Y((W=(J=x.data)==null?void 0:J.data)==null?void 0:W.dctoken);let _=async k=>{var A,P,Z;if(console.log("response for token call back",k),k.Error)alert("if"),console.log("Error: ",k),u(!1);else{let $={"Content-Type":"application/x-www-form-urlencoded"},ee=d({name:n.name,postal_code:n.zip},k);try{let s=await U.default.post(`${Q}quick-pay/${(P=(A=x.data)==null?void 0:A.data)==null?void 0:P.posSalesIdEncode}`,ee,{headers:$});u(!1),console.log("quick response",s),(Z=s==null?void 0:s.data)!=null&&Z.result&&(s==null?void 0:s.status)===200?(console.log("Payment success!",s==null?void 0:s.data),K({name:"John Doe",card_number:"4761 7310 0000 0043",exp_month:"12",exp_year:"2024",cvv:"201",zip:""})):console.log("Payment failed!",s==null?void 0:s.data)}catch(s){console.log("Error: ",s),u(!1)}}};window==null||window.DatacapWebToken.requestToken((F=(S=x.data)==null?void 0:S.data)==null?void 0:F.dctoken,"PaymentForm",_)}else u(!1),console.log("res",(w=x.data)==null?void 0:w.data)}catch(x){u(!1),console.log(x)}},R=o=>{let r=(""+o).replace(/\D/g,"").match(/^(\d{4})(\d{4})(\d{4})(\d{4})$/);return r?`${r[1]} ${r[2]} ${r[3]} ${r[4]}`:o},D=o=>{p(a=>c(d({},a),{card_number:""})),o&&o.match(/[a-zA-Z]/)?p(a=>c(d({},a),{card_number:"Invalid input. Please enter only numbers."})):o.length>12&&!(window!=null&&window.DatacapWebToken.validateCardNumber(o==null?void 0:o.replaceAll(" ","")))?p(a=>c(d({},a),{card_number:"Invalid Card Number"})):o.length?p({}):p(a=>c(d({},a),{card_number:"Card Number required"}))},I=o=>{p(a=>c(d({},a),{exp_month:""})),/^\d{0,2}$/.test(o)&&(o===""||parseInt(o,10)>=1&&parseInt(o,10)<=12)?p({}):o.length?p(a=>c(d({},a),{exp_month:"Value should be between 1 and 12"})):p(a=>c(d({},a),{exp_month:"Month is required"}))},O=o=>{p(a=>c(d({},a),{exp_year:""})),window!=null&&window.DatacapWebToken.validateExpirationDate(n.exp_month,o)?p({}):o.length?p(a=>c(d({},a),{exp_year:"Invalid Expiration Date."})):p(a=>c(d({},a),{exp_year:"Year is required"}))},B=o=>{p(a=>c(d({},a),{cvv:""})),window!=null&&window.DatacapWebToken.validateCVV(o)?p({}):o.length?p(a=>c(d({},a),{cvv:"Invalid CVV."})):p(a=>c(d({},a),{cvv:"CVV is required"}))},g=o=>{let a=o.target.getAttribute("data-token")||"",r=o.target.value;K(f=>c(d({},f),{[a]:r})),a==="card_number"&&D(r),a==="exp_month"&&I(r),a==="exp_year"&&O(r),a==="cvv"&&B(r)};(0,e.useEffect)(()=>{let o="my-script";if(!document.getElementById(o)){let r=document.createElement("script");r.src="https://token-cert.dcap.com/v1/client",r.id=o,r.async=!0,r.onload=()=>{typeof window!="undefined"&&window.DatacapWebToken?console.log("DatacapWebToken",window.DatacapWebToken):console.log("DatacapWebToken is not loaded yet.")},document.head.appendChild(r)}return()=>{let r=document.getElementById(o);r&&document.head.removeChild(r)}},[]);let L=()=>{v(!1)},H=()=>{console.log("open"),v(!0)};return console.log(T,"open"),e.default.createElement(e.default.Fragment,null,e.default.createElement("div",{style:{width:"100%",textAlign:"center"}},e.default.createElement(b.Button,{onClick:H},"Show")),e.default.createElement(b.Modal,{show:T,onHide:L,backdrop:"static",keyboard:!1,size:"lg"},e.default.createElement(b.Modal.Body,null,e.default.createElement("div",{className:"bg-black"},e.default.createElement("div",{className:"container bg-black"},e.default.createElement("div",{className:"row bg-light no-gutters"},e.default.createElement("div",{className:"col-sm-12"},e.default.createElement("div",{className:"bd-example bd-example-tabs right-tabs mttabs m-3 "},e.default.createElement("div",{className:"payment-popup"},e.default.createElement("button",{className:"close-pop",onClick:()=>{v(!1)}},e.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:37,height:37,viewBox:"0 0 21 21"},e.default.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"m7.5 7.5l6 6m0-6l-6 6"}))),e.default.createElement("div",{className:"row"},e.default.createElement("div",{className:"comp-name"},e.default.createElement("img",{src:"https://invoicestaging.skysystemz.com/assets/products/65c49a2740ff1.png",alt:"",className:"client-logo"})),e.default.createElement("div",{className:""},e.default.createElement("div",{id:"Checkout",className:"inline"},e.default.createElement("div",{className:"header"},e.default.createElement("h1",null,"Pay"),e.default.createElement("i",{className:"fa fa-qrcode fa-2x",id:"qrIcon",title:"Show QR Code",onClick:()=>j(!V)})),e.default.createElement("div",{id:"qrCode",style:{display:V?"block":"none"}},e.default.createElement("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARQAAAEUCAYAAADqcMl5AAAAAklEQVR4AewaftIAABJaSURBVO3BQY7gRhLAQFLo/3+ZO8c8FSCoemwvMsL+YK21LnhYa61LHtZa65KHtda65GGttS55WGutSx7WWuuSh7XWuuRhrbUueVhrrUse1lrrkoe11rrkYa21LnlYa61LHtZa65KHtda65IePVP6miknlpGJSualiUjmpOFGZKk5UpopJ5YuKE5WpYlI5qZhU3qiYVKaKSeWkYlI5qXhD5aRiUvmbKr54WGutSx7WWuuSh7XWuuSHyypuUvlNFW+oTCpTxRsqU8UXKlPFicqJylRxonJScVLxhspU8UbFGxX/pIqbVG56WGutSx7WWuuSh7XWuuSHX6byRsVNKlPFpPJGxW9SmSreqJhUTiomlROVk4ovVL5QOak4UTlR+TdReaPiNz2stdYlD2utdcnDWmtd8sN/XMWkMlVMKlPFpHKiMlWcqJxUTCqTyk0Vk8pJxaQyVUwqN1WcqEwVk8qk8kXFpPJGxaTy/+RhrbUueVhrrUse1lrrkh/+z6lMFScVN1VMKpPKVDGpTBWTyknFFyonKlPFpDJVTConKjdVnKhMFZPKScWkMqlMFf9PHtZa65KHtda65GGttS754ZdV/CaVqWJS+UJlqjhROamYVCaVE5WpYlKZKt6oeEPlpGJSmSreUJkq3lCZKt6omFTeqLip4t/kYa21LnlYa61LHtZa65IfLlP5L1GZKt5QmSomlTcqJpWpYlKZKiaVqeINlaniDZWpYlKZKiaVqWJSmSpOKiaVqWJSmSpuUpkqTlT+zR7WWuuSh7XWuuRhrbUu+eGjin+zipOKSeWNikllqjipmFS+UJkqJpU3Kr6omFROVN6omFSmikllqphUpopJZaqYVKaKSeWNiv+Sh7XWuuRhrbUueVhrrUvsD36RyhsVk8pUMamcVJyofFHxhcpJxaQyVUwqU8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D2utdcnDWmtd8rDWWpfYH/yHqUwVv0llqjhRmSpOVKaKSWWqmFSmihOVqeINlaliUpkqJpWTikllqjhROak4UfmbKt5QOan4mx7WWuuSh7XWuuRhrbUu+eEjlb+pYqqYVE4q3lCZKiaVL1SmikllqphUpooTlTdUporfVHFSMam8UTGpTBUnFTepnKhMFW+onFTc9LDWWpc8rLXWJQ9rrXXJD5dV3KTyRsWk8obKP0llqnhD5aaKN1SmipOKSWWqOKmYVKaKN1Smiknlb6p4o2JS+Zse1lrrkoe11rrkYa21Lvnhl6m8UfGGym+qmFROKiaVSWWqOFE5qZhUvlD5omJS+UJlqphUpopJ5aRiUnmjYlKZKiaVE5UvVN5QmSq+eFhrrUse1lrrkoe11rrkh/9zFZPKScVJxYnKVPGbVKaKSWWqmFROKiaVqeKkYlKZKk5UTiomlZOKk4qTikllqphUTipOVKaKm1RuelhrrUse1lrrkoe11rrkh/8zFZPKVDGpTConFZPKVDGpnFRMKlPFpDJVfFExqZxUnKi8oXJSMalMFVPFFyonFVPFpDJVnKhMFVPFpPJFxW96WGutSx7WWuuSh7XWuuSHX1bxmyomlaliUnmj4qRiUpkqJpWTipOKSWWqOFF5Q+WkYqqYVKaKSeVE5QuVqWJSmSreUJkqJpWTikllqpgq/s0e1lrrkoe11rrkYa21LvnhMpV/UsWkMlVMKicqJxVTxRcqU8VJxRsVJypTxRsqX1S8oTJVnKhMFZPKScVUMalMFScqU8WkclIxqfyTHtZa65KHtda65GGttS6xP1hrrQse1lrrkoe11rrkYa21LnlYa61LHtZa65KHtda65GGttS55WGutSx7WWuuSh7XWuuRhrbUueVhrrUse1lrrkoe11rrkYa21Lvkf/C+HzIiJCzEAAAAASUVORK5CYII=",alt:"QRCode",srcSet:""})),e.default.createElement("form",{id:"PaymentForm",className:"payment-form",onSubmit:z},e.default.createElement("input",{type:"hidden",id:"dctoken",defaultValue:G,name:"dctoken"}),e.default.createElement("div",{className:"form-group top-amnt"},e.default.createElement("div",{className:"amtleft"},e.default.createElement("label",{htmlFor:"Amount"},"Payment amount"),e.default.createElement("div",{className:"amount-placeholder"},e.default.createElement("span",null,"$"),e.default.createElement("span",null," ",t||1," "))),e.default.createElement("div",{className:"card-row"},e.default.createElement("span",{className:"visa"}),e.default.createElement("span",{className:"mastercard"}),e.default.createElement("span",{className:"amex"}),e.default.createElement("span",{className:"discover"}))),e.default.createElement("div",{className:"form-group"},e.default.createElement("label",{htmlFor:"NameOnCard"},"Name on card"),e.default.createElement("input",{"data-token":"name",id:"NameOnCard",className:"form-control required",type:"text",maxLength:100,placeholder:"name",value:n==null?void 0:n.name,onChange:g}),e.default.createElement("span",{id:"NameOnCard-error",style:{color:"red"}})),e.default.createElement("div",{className:"form-group"},e.default.createElement("input",{"data-token":"card_number",className:"null card-image form-control required",type:"text",maxLength:19,placeholder:"0000 0000 0000 0000",value:R(n==null?void 0:n.card_number),onChange:g}),m.card_number&&e.default.createElement("span",{id:"card_number-error",style:{color:"red"}},m.card_number)),e.default.createElement("div",{className:"expiry-date-group form-group"},e.default.createElement("input",{"data-token":"exp_month",className:"form-control required",type:"text",placeholder:"MM",maxLength:2,value:n==null?void 0:n.exp_month,onChange:g}),m.exp_month&&e.default.createElement("span",{id:"exp_month-error",style:{color:"red"}},m.exp_month)),e.default.createElement("div",{className:"expiry-date-group form-group"},e.default.createElement("input",{"data-token":"exp_year",className:"form-control required",type:"text",placeholder:"YYYY",maxLength:4,value:n==null?void 0:n.exp_year,onChange:g}),m.exp_year&&e.default.createElement("span",{id:"exp_year-error",style:{color:"red"}},m.exp_year)),e.default.createElement("div",{className:"security-code-group form-group"},e.default.createElement("div",{className:"input-container"},e.default.createElement("input",{"data-token":"cvv",className:"form-control required",type:"text",maxLength:4,placeholder:"CVC",value:n==null?void 0:n.cvv,onChange:g}),e.default.createElement("i",{id:"cvc",className:"fa fa-question-circle"})),m.cvv&&e.default.createElement("span",{id:"cvv-error",style:{color:"red"}},m.cvv),e.default.createElement("div",{className:"cvc-preview-container two-card hide"},e.default.createElement("div",{className:"amex-cvc-preview"}),e.default.createElement("div",{className:"visa-mc-dis-cvc-preview"}))),e.default.createElement("div",{className:"zip-code-group form-group"},e.default.createElement("label",{htmlFor:"ZIPCode"},"Postal code"),e.default.createElement("div",{className:"input-container"},e.default.createElement("input",{id:"ZIPCode","data-token":"zip",className:"form-control required",type:"text",maxLength:7,placeholder:"000000",value:n==null?void 0:n.zip,onChange:g}),e.default.createElement("a",{tabIndex:0,role:"button","data-toggle":"popover","data-trigger":"focus","data-placement":"left","data-content":"Enter the ZIP/Postal code for your credit card billing address."},e.default.createElement("i",{className:"fa fa-question-circle"})),e.default.createElement("span",{id:"ZIPCode-error",style:{color:"red",display:"none"}},"This field is required"))),e.default.createElement("button",{id:"PayButton",className:"btn btn-block btn-success submit-button",type:"submit"},e.default.createElement("span",{className:"submit-button-lock"}),e.default.createElement("span",{className:"align-middle"},"Pay $",t||1))),e.default.createElement("div",{className:"powerd-by-part",style:{display:"flex",fontSize:"12px",textAlign:"center",alignItems:"center",justifyContent:"center",margin:"8px 0 20px 0"}},e.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,viewBox:"0 0 26 26"},e.default.createElement("path",{fill:"currentColor",d:"M23.633 5.028a1.074 1.074 0 0 0-.777-.366c-2.295-.06-5.199-2.514-7.119-3.477C14.551.592 13.768.201 13.18.098a1.225 1.225 0 0 0-.36.001c-.588.103-1.371.494-2.556 1.087c-1.92.962-4.824 3.416-7.119 3.476a1.08 1.08 0 0 0-.778.366a1.167 1.167 0 0 0-.291.834c.493 10.023 4.088 16.226 10.396 19.831c.164.093.346.141.527.141s.363-.048.528-.141c6.308-3.605 9.902-9.808 10.396-19.831a1.161 1.161 0 0 0-.29-.834zM18.617 8.97l-5.323 7.855c-.191.282-.491.469-.788.469c-.298 0-.629-.163-.838-.372l-3.752-3.753a.656.656 0 0 1 0-.926l.927-.929a.658.658 0 0 1 .926 0l2.44 2.44l4.239-6.257a.657.657 0 0 1 .91-.173l1.085.736a.657.657 0 0 1 .174.91z"})),"Secure payments powered by Fractal",e.default.createElement("img",{src:"https://ui.fractalpay.com/favicon.ico",alt:"Fractal logo",className:"powered-logo",style:{width:"18px",height:"18px",float:"right",padding:"2px",background:"#000",borderRadius:"4px",marginLeft:"5px"}}))))))))))))))}0&&(module.exports={PaywithFractal});
|
package/dist/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
var _=Object.defineProperty,$=Object.defineProperties;var ee=Object.getOwnPropertyDescriptors;var w=Object.getOwnPropertySymbols;var ae=Object.prototype.hasOwnProperty,oe=Object.prototype.propertyIsEnumerable;var A=(c,n,s)=>n in c?_(c,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):c[n]=s,l=(c,n)=>{for(var s in n||(n={}))ae.call(n,s)&&A(c,s,n[s]);if(w)for(var s of w(n))oe.call(n,s)&&A(c,s,n[s]);return c},d=(c,n)=>$(c,ee(n));import"bootstrap/dist/css/bootstrap.min.css";import P from"axios";import e,{useEffect as re,useState as g}from"react";import{Button as ne,Modal as Z}from"react-bootstrap";function he({name:c,amount:n,orderId:s,fractalPayClientKey:E}){let M="http://192.168.1.52:8082/",C="http://192.168.1.52:8081/";console.log(c,"name",window==null?void 0:window.DatacapWebToken);let[X,N]=g(""),[m,r]=g({}),[f,Q]=g(!1),[i,k]=g({name:"John Doe",card_number:"4761 7310 0000 0043",exp_month:"12",exp_year:"2024",cvv:"201",zip:""}),[le,h]=g(!1),[v,q]=g(!1),G=async o=>{var t,y,U,V,K,T,J;o.preventDefault();let a={description:"widget payment",amount:n||"1.00",phone_number:"1234567908",zip:i.zip,orderId:s||"",fractalpayPublicKey:E};if(Object.keys(m).length<1)try{h(!0);let x=await P.post(`${M}create-widget-order`,a,{headers:{"Content-Type":"application/json"}});if(x.data&&((t=x.data)!=null&&t.result)){console.log("token",(y=x.data)==null?void 0:y.data),N((V=(U=x.data)==null?void 0:U.data)==null?void 0:V.dctoken);let B=async b=>{var W,S,F;if(console.log("response for token call back",b),b.Error)alert("if"),console.log("Error: ",b),h(!1);else{let L={"Content-Type":"application/x-www-form-urlencoded"},H=l({name:i.name,postal_code:i.zip},b);try{let p=await P.post(`${C}quick-pay/${(S=(W=x.data)==null?void 0:W.data)==null?void 0:S.posSalesIdEncode}`,H,{headers:L});h(!1),console.log("quick response",p),(F=p==null?void 0:p.data)!=null&&F.result&&(p==null?void 0:p.status)===200?(console.log("Payment success!",p==null?void 0:p.data),k({name:"John Doe",card_number:"4761 7310 0000 0043",exp_month:"12",exp_year:"2024",cvv:"201",zip:""})):console.log("Payment failed!",p==null?void 0:p.data)}catch(p){console.log("Error: ",p),h(!1)}}};window==null||window.DatacapWebToken.requestToken((T=(K=x.data)==null?void 0:K.data)==null?void 0:T.dctoken,"PaymentForm",B)}else h(!1),console.log("res",(J=x.data)==null?void 0:J.data)}catch(x){h(!1),console.log(x)}},Y=o=>{let t=(""+o).replace(/\D/g,"").match(/^(\d{4})(\d{4})(\d{4})(\d{4})$/);return t?`${t[1]} ${t[2]} ${t[3]} ${t[4]}`:o},j=o=>{r(a=>d(l({},a),{card_number:""})),o&&o.match(/[a-zA-Z]/)?r(a=>d(l({},a),{card_number:"Invalid input. Please enter only numbers."})):o.length>12&&!(window!=null&&window.DatacapWebToken.validateCardNumber(o==null?void 0:o.replaceAll(" ","")))?r(a=>d(l({},a),{card_number:"Invalid Card Number"})):o.length?r({}):r(a=>d(l({},a),{card_number:"Card Number required"}))},z=o=>{r(a=>d(l({},a),{exp_month:""})),/^\d{0,2}$/.test(o)&&(o===""||parseInt(o,10)>=1&&parseInt(o,10)<=12)?r({}):o.length?r(a=>d(l({},a),{exp_month:"Value should be between 1 and 12"})):r(a=>d(l({},a),{exp_month:"Month is required"}))},R=o=>{r(a=>d(l({},a),{exp_year:""})),window!=null&&window.DatacapWebToken.validateExpirationDate(i.exp_month,o)?r({}):o.length?r(a=>d(l({},a),{exp_year:"Invalid Expiration Date."})):r(a=>d(l({},a),{exp_year:"Year is required"}))},D=o=>{r(a=>d(l({},a),{cvv:""})),window!=null&&window.DatacapWebToken.validateCVV(o)?r({}):o.length?r(a=>d(l({},a),{cvv:"Invalid CVV."})):r(a=>d(l({},a),{cvv:"CVV is required"}))},u=o=>{let a=o.target.getAttribute("data-token")||"",t=o.target.value;k(y=>d(l({},y),{[a]:t})),a==="card_number"&&j(t),a==="exp_month"&&z(t),a==="exp_year"&&R(t),a==="cvv"&&D(t)};re(()=>{let o="my-script";if(!document.getElementById(o)){let t=document.createElement("script");t.src="https://token-cert.dcap.com/v1/client",t.id=o,t.async=!0,t.onload=()=>{typeof window!="undefined"&&window.DatacapWebToken?console.log("DatacapWebToken",window.DatacapWebToken):console.log("DatacapWebToken is not loaded yet.")},document.head.appendChild(t)}return()=>{let t=document.getElementById(o);t&&document.head.removeChild(t)}},[]);let I=()=>{q(!1)},O=()=>{console.log("open"),q(!0)};return console.log(v,"open"),e.createElement(e.Fragment,null,e.createElement("div",{style:{width:"100%",textAlign:"center"}},e.createElement(ne,{onClick:O},"Show")),e.createElement(Z,{show:v,onHide:I,backdrop:"static",keyboard:!1,size:"lg"},e.createElement(Z.Body,null,e.createElement("div",{className:"bg-black"},e.createElement("div",{className:"container bg-black"},e.createElement("div",{className:"row bg-light no-gutters"},e.createElement("div",{className:"col-sm-12"},e.createElement("div",{className:"bd-example bd-example-tabs right-tabs mttabs m-3 "},e.createElement("div",{className:"payment-popup"},e.createElement("button",{className:"close-pop",onClick:()=>{q(!1)}},e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:37,height:37,viewBox:"0 0 21 21"},e.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"m7.5 7.5l6 6m0-6l-6 6"}))),e.createElement("div",{className:"row"},e.createElement("div",{className:"comp-name"},e.createElement("img",{src:"https://invoicestaging.skysystemz.com/assets/products/65c49a2740ff1.png",alt:"",className:"client-logo"})),e.createElement("div",{className:""},e.createElement("div",{id:"Checkout",className:"inline"},e.createElement("div",{className:"header"},e.createElement("h1",null,"Pay"),e.createElement("i",{className:"fa fa-qrcode fa-2x",id:"qrIcon",title:"Show QR Code",onClick:()=>Q(!f)})),e.createElement("div",{id:"qrCode",style:{display:f?"block":"none"}},e.createElement("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARQAAAEUCAYAAADqcMl5AAAAAklEQVR4AewaftIAABJaSURBVO3BQY7gRhLAQFLo/3+ZO8c8FSCoemwvMsL+YK21LnhYa61LHtZa65KHtda65GGttS55WGutSx7WWuuSh7XWuuRhrbUueVhrrUse1lrrkoe11rrkYa21LnlYa61LHtZa65KHtda65IePVP6miknlpGJSualiUjmpOFGZKk5UpopJ5YuKE5WpYlI5qZhU3qiYVKaKSeWkYlI5qXhD5aRiUvmbKr54WGutSx7WWuuSh7XWuuSHyypuUvlNFW+oTCpTxRsqU8UXKlPFicqJylRxonJScVLxhspU8UbFGxX/pIqbVG56WGutSx7WWuuSh7XWuuSHX6byRsVNKlPFpPJGxW9SmSreqJhUTiomlROVk4ovVL5QOak4UTlR+TdReaPiNz2stdYlD2utdcnDWmtd8sN/XMWkMlVMKlPFpHKiMlWcqJxUTCqTyk0Vk8pJxaQyVUwqN1WcqEwVk8qk8kXFpPJGxaTy/+RhrbUueVhrrUse1lrrkh/+z6lMFScVN1VMKpPKVDGpTBWTyknFFyonKlPFpDJVTConKjdVnKhMFZPKScWkMqlMFf9PHtZa65KHtda65GGttS754ZdV/CaVqWJS+UJlqjhROamYVCaVE5WpYlKZKt6oeEPlpGJSmSreUJkq3lCZKt6omFTeqLip4t/kYa21LnlYa61LHtZa65IfLlP5L1GZKt5QmSomlTcqJpWpYlKZKiaVqeINlaniDZWpYlKZKiaVqWJSmSpOKiaVqWJSmSpuUpkqTlT+zR7WWuuSh7XWuuRhrbUu+eGjin+zipOKSeWNikllqjipmFS+UJkqJpU3Kr6omFROVN6omFSmikllqphUpopJZaqYVKaKSeWNiv+Sh7XWuuRhrbUueVhrrUvsD36RyhsVk8pUMamcVJyofFHxhcpJxaQyVU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obKv8lD2utdcnDWmtd8rDWWpfYH/yHqUwVv0llqjhRmSpOVKaKSWWqmFSmihOVqeINlaliUpkqJpWTikllqjhROak4UfmbKt5QOan4mx7WWuuSh7XWuuRhrbUu+eEjlb+pYqqYVE4q3lCZKiaVL1SmikllqphUpooTlTdUporfVHFSMam8UTGpTBUnFTepnKhMFW+onFTc9LDWWpc8rLXWJQ9rrXXJD5dV3KTyRsWk8obKP0llqnhD5aaKN1SmipOKSWWqOKmYVKaKN1Smiknlb6p4o2JS+Zse1lrrkoe11rrkYa21Lvnhl6m8UfGGym+qmFROKiaVSWWqOFE5qZhUvlD5omJS+UJlqphUpopJ5aRiUnmjYlKZKiaVE5UvVN5QmSq+eFhrrUse1lrrkoe11rrkh/9zFZPKScVJxYnKVPGbVKaKSWWqmFROKiaVqeKkYlKZKk5UTiomlZOKk4qTikllqphUTipOVKaKm1RuelhrrUse1lrrkoe11rrkh/8zFZPKVDGpTConFZPKVDGpnFRMKlPFpDJVfFExqZxUnKi8oXJSMalMFVPFFyonFVPFpDJVnKhMFVPFpPJFxW96WGutSx7WWuuSh7XWuuSHX1bxmyomlaliUnmj4qRiUpkqJpWTipOKSWWqOFF5Q+WkYqqYVKaKSeVE5QuVqWJSmSreUJkqJpWTikllqpgq/s0e1lrrkoe11rrkYa21LvnhMpV/UsWkMlVMKicqJxVTxRcqU8VJxRsVJypTxRsqX1S8oTJVnKhMFZPKScVUMalMFScqU8WkclIxqfyTHtZa65KHtda65GGttS6xP1hrrQse1lrrkoe11rrkYa21LnlYa61LHtZa65KHtda65GGttS55WGutSx7WWuuSh7XWuuRhrbUueVhrrUse1lrrkoe11rrkYa21Lvkf/C+HzIiJCzEAAAAASUVORK5CYII=",alt:"QRCode",srcSet:""})),e.createElement("form",{id:"PaymentForm",className:"payment-form",onSubmit:G},e.createElement("input",{type:"hidden",id:"dctoken",defaultValue:X,name:"dctoken"}),e.createElement("div",{className:"form-group top-amnt"},e.createElement("div",{className:"amtleft"},e.createElement("label",{htmlFor:"Amount"},"Payment amount"),e.createElement("div",{className:"amount-placeholder"},e.createElement("span",null,"$"),e.createElement("span",null," ",n||1," "))),e.createElement("div",{className:"card-row"},e.createElement("span",{className:"visa"}),e.createElement("span",{className:"mastercard"}),e.createElement("span",{className:"amex"}),e.createElement("span",{className:"discover"}))),e.createElement("div",{className:"form-group"},e.createElement("label",{htmlFor:"NameOnCard"},"Name on card"),e.createElement("input",{"data-token":"name",id:"NameOnCard",className:"form-control required",type:"text",maxLength:100,placeholder:"name",value:i==null?void 0:i.name,onChange:u}),e.createElement("span",{id:"NameOnCard-error",style:{color:"red"}})),e.createElement("div",{className:"form-group"},e.createElement("input",{"data-token":"card_number",className:"null card-image form-control required",type:"text",maxLength:19,placeholder:"0000 0000 0000 0000",value:Y(i==null?void 0:i.card_number),onChange:u}),m.card_number&&e.createElement("span",{id:"card_number-error",style:{color:"red"}},m.card_number)),e.createElement("div",{className:"expiry-date-group form-group"},e.createElement("input",{"data-token":"exp_month",className:"form-control required",type:"text",placeholder:"MM",maxLength:2,value:i==null?void 0:i.exp_month,onChange:u}),m.exp_month&&e.createElement("span",{id:"exp_month-error",style:{color:"red"}},m.exp_month)),e.createElement("div",{className:"expiry-date-group form-group"},e.createElement("input",{"data-token":"exp_year",className:"form-control required",type:"text",placeholder:"YYYY",maxLength:4,value:i==null?void 0:i.exp_year,onChange:u}),m.exp_year&&e.createElement("span",{id:"exp_year-error",style:{color:"red"}},m.exp_year)),e.createElement("div",{className:"security-code-group form-group"},e.createElement("div",{className:"input-container"},e.createElement("input",{"data-token":"cvv",className:"form-control required",type:"text",maxLength:4,placeholder:"CVC",value:i==null?void 0:i.cvv,onChange:u}),e.createElement("i",{id:"cvc",className:"fa fa-question-circle"})),m.cvv&&e.createElement("span",{id:"cvv-error",style:{color:"red"}},m.cvv),e.createElement("div",{className:"cvc-preview-container two-card hide"},e.createElement("div",{className:"amex-cvc-preview"}),e.createElement("div",{className:"visa-mc-dis-cvc-preview"}))),e.createElement("div",{className:"zip-code-group form-group"},e.createElement("label",{htmlFor:"ZIPCode"},"Postal code"),e.createElement("div",{className:"input-container"},e.createElement("input",{id:"ZIPCode","data-token":"zip",className:"form-control required",type:"text",maxLength:7,placeholder:"000000",value:i==null?void 0:i.zip,onChange:u}),e.createElement("a",{tabIndex:0,role:"button","data-toggle":"popover","data-trigger":"focus","data-placement":"left","data-content":"Enter the ZIP/Postal code for your credit card billing address."},e.createElement("i",{className:"fa fa-question-circle"})),e.createElement("span",{id:"ZIPCode-error",style:{color:"red",display:"none"}},"This field is required"))),e.createElement("button",{id:"PayButton",className:"btn btn-block btn-success submit-button",type:"submit"},e.createElement("span",{className:"submit-button-lock"}),e.createElement("span",{className:"align-middle"},"Pay $",n||1))),e.createElement("div",{className:"powerd-by-part",style:{display:"flex",fontSize:"12px",textAlign:"center",alignItems:"center",justifyContent:"center",margin:"8px 0 20px 0"}},e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,viewBox:"0 0 26 26"},e.createElement("path",{fill:"currentColor",d:"M23.633 5.028a1.074 1.074 0 0 0-.777-.366c-2.295-.06-5.199-2.514-7.119-3.477C14.551.592 13.768.201 13.18.098a1.225 1.225 0 0 0-.36.001c-.588.103-1.371.494-2.556 1.087c-1.92.962-4.824 3.416-7.119 3.476a1.08 1.08 0 0 0-.778.366a1.167 1.167 0 0 0-.291.834c.493 10.023 4.088 16.226 10.396 19.831c.164.093.346.141.527.141s.363-.048.528-.141c6.308-3.605 9.902-9.808 10.396-19.831a1.161 1.161 0 0 0-.29-.834zM18.617 8.97l-5.323 7.855c-.191.282-.491.469-.788.469c-.298 0-.629-.163-.838-.372l-3.752-3.753a.656.656 0 0 1 0-.926l.927-.929a.658.658 0 0 1 .926 0l2.44 2.44l4.239-6.257a.657.657 0 0 1 .91-.173l1.085.736a.657.657 0 0 1 .174.91z"})),"Secure payments powered by Fractal",e.createElement("img",{src:"https://ui.fractalpay.com/favicon.ico",alt:"Fractal logo",className:"powered-logo",style:{width:"18px",height:"18px",float:"right",padding:"2px",background:"#000",borderRadius:"4px",marginLeft:"5px"}}))))))))))))))}export{he as PaywithFractal};
|
1
|
+
var _=Object.defineProperty,$=Object.defineProperties;var ee=Object.getOwnPropertyDescriptors;var w=Object.getOwnPropertySymbols;var ae=Object.prototype.hasOwnProperty,oe=Object.prototype.propertyIsEnumerable;var A=(c,n,s)=>n in c?_(c,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):c[n]=s,l=(c,n)=>{for(var s in n||(n={}))ae.call(n,s)&&A(c,s,n[s]);if(w)for(var s of w(n))oe.call(n,s)&&A(c,s,n[s]);return c},d=(c,n)=>$(c,ee(n));import P from"axios";import e,{useEffect as re,useState as g}from"react";import{Button as ne,Modal as Z}from"react-bootstrap";import"bootstrap/dist/css/bootstrap.min.css";function ge({name:c,amount:n,orderId:s,fractalPayClientKey:E}){let M="http://192.168.1.52:8082/",C="http://192.168.1.52:8081/";console.log(c,"name",window==null?void 0:window.DatacapWebToken);let[X,N]=g(""),[m,r]=g({}),[f,Q]=g(!1),[i,k]=g({name:"John Doe",card_number:"4761 7310 0000 0043",exp_month:"12",exp_year:"2024",cvv:"201",zip:""}),[le,h]=g(!1),[v,q]=g(!1),G=async o=>{var t,y,U,V,K,T,J;o.preventDefault();let a={description:"widget payment",amount:n||"1.00",phone_number:"1234567908",zip:i.zip,orderId:s||"",fractalpayPublicKey:E};if(Object.keys(m).length<1)try{h(!0);let x=await P.post(`${M}create-widget-order`,a,{headers:{"Content-Type":"application/json"}});if(x.data&&((t=x.data)!=null&&t.result)){console.log("token",(y=x.data)==null?void 0:y.data),N((V=(U=x.data)==null?void 0:U.data)==null?void 0:V.dctoken);let B=async b=>{var W,S,F;if(console.log("response for token call back",b),b.Error)alert("if"),console.log("Error: ",b),h(!1);else{let L={"Content-Type":"application/x-www-form-urlencoded"},H=l({name:i.name,postal_code:i.zip},b);try{let p=await P.post(`${C}quick-pay/${(S=(W=x.data)==null?void 0:W.data)==null?void 0:S.posSalesIdEncode}`,H,{headers:L});h(!1),console.log("quick response",p),(F=p==null?void 0:p.data)!=null&&F.result&&(p==null?void 0:p.status)===200?(console.log("Payment success!",p==null?void 0:p.data),k({name:"John Doe",card_number:"4761 7310 0000 0043",exp_month:"12",exp_year:"2024",cvv:"201",zip:""})):console.log("Payment failed!",p==null?void 0:p.data)}catch(p){console.log("Error: ",p),h(!1)}}};window==null||window.DatacapWebToken.requestToken((T=(K=x.data)==null?void 0:K.data)==null?void 0:T.dctoken,"PaymentForm",B)}else h(!1),console.log("res",(J=x.data)==null?void 0:J.data)}catch(x){h(!1),console.log(x)}},Y=o=>{let t=(""+o).replace(/\D/g,"").match(/^(\d{4})(\d{4})(\d{4})(\d{4})$/);return t?`${t[1]} ${t[2]} ${t[3]} ${t[4]}`:o},j=o=>{r(a=>d(l({},a),{card_number:""})),o&&o.match(/[a-zA-Z]/)?r(a=>d(l({},a),{card_number:"Invalid input. Please enter only numbers."})):o.length>12&&!(window!=null&&window.DatacapWebToken.validateCardNumber(o==null?void 0:o.replaceAll(" ","")))?r(a=>d(l({},a),{card_number:"Invalid Card Number"})):o.length?r({}):r(a=>d(l({},a),{card_number:"Card Number required"}))},z=o=>{r(a=>d(l({},a),{exp_month:""})),/^\d{0,2}$/.test(o)&&(o===""||parseInt(o,10)>=1&&parseInt(o,10)<=12)?r({}):o.length?r(a=>d(l({},a),{exp_month:"Value should be between 1 and 12"})):r(a=>d(l({},a),{exp_month:"Month is required"}))},R=o=>{r(a=>d(l({},a),{exp_year:""})),window!=null&&window.DatacapWebToken.validateExpirationDate(i.exp_month,o)?r({}):o.length?r(a=>d(l({},a),{exp_year:"Invalid Expiration Date."})):r(a=>d(l({},a),{exp_year:"Year is required"}))},D=o=>{r(a=>d(l({},a),{cvv:""})),window!=null&&window.DatacapWebToken.validateCVV(o)?r({}):o.length?r(a=>d(l({},a),{cvv:"Invalid CVV."})):r(a=>d(l({},a),{cvv:"CVV is required"}))},u=o=>{let a=o.target.getAttribute("data-token")||"",t=o.target.value;k(y=>d(l({},y),{[a]:t})),a==="card_number"&&j(t),a==="exp_month"&&z(t),a==="exp_year"&&R(t),a==="cvv"&&D(t)};re(()=>{let o="my-script";if(!document.getElementById(o)){let t=document.createElement("script");t.src="https://token-cert.dcap.com/v1/client",t.id=o,t.async=!0,t.onload=()=>{typeof window!="undefined"&&window.DatacapWebToken?console.log("DatacapWebToken",window.DatacapWebToken):console.log("DatacapWebToken is not loaded yet.")},document.head.appendChild(t)}return()=>{let t=document.getElementById(o);t&&document.head.removeChild(t)}},[]);let I=()=>{q(!1)},O=()=>{console.log("open"),q(!0)};return console.log(v,"open"),e.createElement(e.Fragment,null,e.createElement("div",{style:{width:"100%",textAlign:"center"}},e.createElement(ne,{onClick:O},"Show")),e.createElement(Z,{show:v,onHide:I,backdrop:"static",keyboard:!1,size:"lg"},e.createElement(Z.Body,null,e.createElement("div",{className:"bg-black"},e.createElement("div",{className:"container bg-black"},e.createElement("div",{className:"row bg-light no-gutters"},e.createElement("div",{className:"col-sm-12"},e.createElement("div",{className:"bd-example bd-example-tabs right-tabs mttabs m-3 "},e.createElement("div",{className:"payment-popup"},e.createElement("button",{className:"close-pop",onClick:()=>{q(!1)}},e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:37,height:37,viewBox:"0 0 21 21"},e.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"m7.5 7.5l6 6m0-6l-6 6"}))),e.createElement("div",{className:"row"},e.createElement("div",{className:"comp-name"},e.createElement("img",{src:"https://invoicestaging.skysystemz.com/assets/products/65c49a2740ff1.png",alt:"",className:"client-logo"})),e.createElement("div",{className:""},e.createElement("div",{id:"Checkout",className:"inline"},e.createElement("div",{className:"header"},e.createElement("h1",null,"Pay"),e.createElement("i",{className:"fa fa-qrcode fa-2x",id:"qrIcon",title:"Show QR Code",onClick:()=>Q(!f)})),e.createElement("div",{id:"qrCode",style:{display:f?"block":"none"}},e.createElement("img",{src:"data:image/png;base64,iVBORw0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4q3lCZKiaVL1SmikllqphUpooTlTdUporfVHFSMam8UTGpTBUnFTepnKhMFW+onFTc9LDWWpc8rLXWJQ9rrXXJD5dV3KTyRsWk8obKP0llqnhD5aaKN1SmipOKSWWqOKmYVKaKN1Smiknlb6p4o2JS+Zse1lrrkoe11rrkYa21Lvnhl6m8UfGGym+qmFROKiaVSWWqOFE5qZhUvlD5omJS+UJlqphUpopJ5aRiUnmjYlKZKiaVE5UvVN5QmSq+eFhrrUse1lrrkoe11rrkh/9zFZPKScVJxYnKVPGbVKaKSWWqmFROKiaVqeKkYlKZKk5UTiomlZOKk4qTikllqphUTipOVKaKm1RuelhrrUse1lrrkoe11rrkh/8zFZPKVDGpTConFZPKVDGpnFRMKlPFpDJVfFExqZxUnKi8oXJSMalMFVPFFyonFVPFpDJVnKhMFVPFpPJFxW96WGutSx7WWuuSh7XWuuSHX1bxmyomlaliUnmj4qRiUpkqJpWTipOKSWWqOFF5Q+WkYqqYVKaKSeVE5QuVqWJSmSreUJkqJpWTikllqpgq/s0e1lrrkoe11rrkYa21LvnhMpV/UsWkMlVMKicqJxVTxRcqU8VJxRsVJypTxRsqX1S8oTJVnKhMFZPKScVUMalMFScqU8WkclIxqfyTHtZa65KHtda65GGttS6xP1hrrQse1lrrkoe11rrkYa21LnlYa61LHtZa65KHtda65GGttS55WGutSx7WWuuSh7XWuuRhrbUueVhrrUse1lrrkoe11rrkYa21Lvkf/C+HzIiJCzEAAAAASUVORK5CYII=",alt:"QRCode",srcSet:""})),e.createElement("form",{id:"PaymentForm",className:"payment-form",onSubmit:G},e.createElement("input",{type:"hidden",id:"dctoken",defaultValue:X,name:"dctoken"}),e.createElement("div",{className:"form-group top-amnt"},e.createElement("div",{className:"amtleft"},e.createElement("label",{htmlFor:"Amount"},"Payment amount"),e.createElement("div",{className:"amount-placeholder"},e.createElement("span",null,"$"),e.createElement("span",null," ",n||1," "))),e.createElement("div",{className:"card-row"},e.createElement("span",{className:"visa"}),e.createElement("span",{className:"mastercard"}),e.createElement("span",{className:"amex"}),e.createElement("span",{className:"discover"}))),e.createElement("div",{className:"form-group"},e.createElement("label",{htmlFor:"NameOnCard"},"Name on card"),e.createElement("input",{"data-token":"name",id:"NameOnCard",className:"form-control required",type:"text",maxLength:100,placeholder:"name",value:i==null?void 0:i.name,onChange:u}),e.createElement("span",{id:"NameOnCard-error",style:{color:"red"}})),e.createElement("div",{className:"form-group"},e.createElement("input",{"data-token":"card_number",className:"null card-image form-control required",type:"text",maxLength:19,placeholder:"0000 0000 0000 0000",value:Y(i==null?void 0:i.card_number),onChange:u}),m.card_number&&e.createElement("span",{id:"card_number-error",style:{color:"red"}},m.card_number)),e.createElement("div",{className:"expiry-date-group form-group"},e.createElement("input",{"data-token":"exp_month",className:"form-control required",type:"text",placeholder:"MM",maxLength:2,value:i==null?void 0:i.exp_month,onChange:u}),m.exp_month&&e.createElement("span",{id:"exp_month-error",style:{color:"red"}},m.exp_month)),e.createElement("div",{className:"expiry-date-group form-group"},e.createElement("input",{"data-token":"exp_year",className:"form-control required",type:"text",placeholder:"YYYY",maxLength:4,value:i==null?void 0:i.exp_year,onChange:u}),m.exp_year&&e.createElement("span",{id:"exp_year-error",style:{color:"red"}},m.exp_year)),e.createElement("div",{className:"security-code-group form-group"},e.createElement("div",{className:"input-container"},e.createElement("input",{"data-token":"cvv",className:"form-control required",type:"text",maxLength:4,placeholder:"CVC",value:i==null?void 0:i.cvv,onChange:u}),e.createElement("i",{id:"cvc",className:"fa fa-question-circle"})),m.cvv&&e.createElement("span",{id:"cvv-error",style:{color:"red"}},m.cvv),e.createElement("div",{className:"cvc-preview-container two-card hide"},e.createElement("div",{className:"amex-cvc-preview"}),e.createElement("div",{className:"visa-mc-dis-cvc-preview"}))),e.createElement("div",{className:"zip-code-group form-group"},e.createElement("label",{htmlFor:"ZIPCode"},"Postal code"),e.createElement("div",{className:"input-container"},e.createElement("input",{id:"ZIPCode","data-token":"zip",className:"form-control required",type:"text",maxLength:7,placeholder:"000000",value:i==null?void 0:i.zip,onChange:u}),e.createElement("a",{tabIndex:0,role:"button","data-toggle":"popover","data-trigger":"focus","data-placement":"left","data-content":"Enter the ZIP/Postal code for your credit card billing address."},e.createElement("i",{className:"fa fa-question-circle"})),e.createElement("span",{id:"ZIPCode-error",style:{color:"red",display:"none"}},"This field is required"))),e.createElement("button",{id:"PayButton",className:"btn btn-block btn-success submit-button",type:"submit"},e.createElement("span",{className:"submit-button-lock"}),e.createElement("span",{className:"align-middle"},"Pay $",n||1))),e.createElement("div",{className:"powerd-by-part",style:{display:"flex",fontSize:"12px",textAlign:"center",alignItems:"center",justifyContent:"center",margin:"8px 0 20px 0"}},e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,viewBox:"0 0 26 26"},e.createElement("path",{fill:"currentColor",d:"M23.633 5.028a1.074 1.074 0 0 0-.777-.366c-2.295-.06-5.199-2.514-7.119-3.477C14.551.592 13.768.201 13.18.098a1.225 1.225 0 0 0-.36.001c-.588.103-1.371.494-2.556 1.087c-1.92.962-4.824 3.416-7.119 3.476a1.08 1.08 0 0 0-.778.366a1.167 1.167 0 0 0-.291.834c.493 10.023 4.088 16.226 10.396 19.831c.164.093.346.141.527.141s.363-.048.528-.141c6.308-3.605 9.902-9.808 10.396-19.831a1.161 1.161 0 0 0-.29-.834zM18.617 8.97l-5.323 7.855c-.191.282-.491.469-.788.469c-.298 0-.629-.163-.838-.372l-3.752-3.753a.656.656 0 0 1 0-.926l.927-.929a.658.658 0 0 1 .926 0l2.44 2.44l4.239-6.257a.657.657 0 0 1 .91-.173l1.085.736a.657.657 0 0 1 .174.91z"})),"Secure payments powered by Fractal",e.createElement("img",{src:"https://ui.fractalpay.com/favicon.ico",alt:"Fractal logo",className:"powered-logo",style:{width:"18px",height:"18px",float:"right",padding:"2px",background:"#000",borderRadius:"4px",marginLeft:"5px"}}))))))))))))))}export{ge as PaywithFractal};
|