@fractalpay/fractalpay-next-dev 0.0.14 → 0.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1904,6 +1904,7 @@
1904
1904
  width:16px !important;
1905
1905
  padding: 10px 12px;
1906
1906
  font-size: .875rem;
1907
+ max-height: 16px !important;
1907
1908
  height: 16px !important;
1908
1909
  }
1909
1910
  // .checks-row input.is-valid:checked{
@@ -1960,4 +1961,4 @@
1960
1961
  color:#ffffff !important;
1961
1962
  }
1962
1963
 
1963
- `)}function cn({session_token:e,callback:x,isloading:F,onCancel:Z,showChecks:M,merchantName:ve}){var L;let[P,ze]=(0,b.useState)(!1),[de,o]=(0,b.useState)(!1),[s,v]=(0,b.useState)(),[y,m]=(0,b.useState)({}),[Ce,fe]=(0,b.useState)(""),c=()=>ze(!0),Se=()=>ze(!1),r=()=>{var q,G,Q,J,W,l,f,_;let i={},d=s,h=parseInt((d==null?void 0:d.expiryMonth)||"",10),I=(d==null?void 0:d.expiryYear)||"";return(q=d==null?void 0:d.firstName)!=null&&q.trim()||(i.firstName="Please enter a first name."),(G=d==null?void 0:d.lastName)!=null&&G.trim()||(i.lastName="Please enter a last name."),(Q=d==null?void 0:d.cardNumber)!=null&&Q.trim()||(i.cardNumber="Please enter a card number."),(J=d==null?void 0:d.expiryMonth)!=null&&J.trim()?(Number(d==null?void 0:d.expiryMonth)>12||Number(d==null?void 0:d.expiryMonth)<1)&&(i.expiryMonth="Invalid Expiration Month."):i.expiryMonth="Please enter an expiry month.",(W=d==null?void 0:d.expiryYear)!=null&&W.trim()?((l=d==null?void 0:d.expiryYear)==null?void 0:l.trim().length)!==4||Number(d==null?void 0:d.expiryYear)<2025?i.expiryYear="Invalid Expiration Year.":(isNaN(h)||h<1||h>12||I.length!==4)&&(i.expiryMonth="Invalid Expiration Date."):i.expiryYear="Please enter an expiry year.",(f=d==null?void 0:d.cvv)!=null&&f.trim()||(i.cvv="Please enter a CVV."),(_=d==null?void 0:d.zipCode)!=null&&_.trim()||(i.zipCode="Please enter a zip code."),M&&!(d!=null&&d.authHold)&&(i.authHold="You must authorize this before proceeding."),M&&!(d!=null&&d.authorise)&&(i.authorise="Please confirm your authorization to continue."),m(i),Object.keys(i).length>0},be=i=>{let h=i.target.value.replace(/\D/g,""),I="";/^3[47]/.test(h)?I=h.slice(0,15).replace(/^(\d{1,4})(\d{1,6})?(\d{1,5})?$/,(G,Q,J,W)=>[Q,J,W].filter(Boolean).join(" ")):I=h.slice(0,16).replace(/^(\d{1,4})(\d{1,4})?(\d{1,4})?(\d{1,4})?$/,(G,Q,J,W,l)=>[Q,J,W,l].filter(Boolean).join(" ")),m(q=>z(S({},q),{cardNumber:""})),v(q=>z(S({},q),{cardNumber:I}))},k=(i,d)=>{let h=i;if(["expiryMonth","expiryYear","zipCode","cvv"].includes(h)){(d===""||/^[0-9]+$/.test(d))&&(m(q=>z(S({},q),{[h]:""})),v(q=>z(S({},q),{[h]:d})));return}m(q=>z(S({},q),{[h]:""})),v(q=>z(S({},q),{[h]:d}))},we=()=>{let i=DatacapWebToken.validateCardNumber(s==null?void 0:s.cardNumber.replaceAll(" ","")),d=DatacapWebToken.validateExpirationDate(s==null?void 0:s.expiryMonth,s==null?void 0:s.expiryYear),h=DatacapWebToken.validateCVV(s==null?void 0:s.cvv),I={};return i||(I.cardNumber="Invalid card Number"),d||(I.expiryMonth="Invalid Expiration Date."),h||(I.cvv="Invalid CVV"),m(I),i&&h&&d},T=async i=>{var d,h;if(i.Error)fe(i.Error),Se();else{let I={token:i.Token,resp:i},q=await yt.default.post(`${Je}api/v1/gateway/update/token/${e}`,I);if((q==null?void 0:q.status)==200){let G=S(S({Token:(h=(d=q==null?void 0:q.data)==null?void 0:d.data)==null?void 0:h.gateway_token,Brand:i.Brand,ExpirationMonth:i.ExpirationMonth,ExpirationYear:i.ExpirationYear,Last4:i.Last4,Bin:i.Bin,CVV:i.CVV,postalCode:s==null?void 0:s.zipCode},M&&{authHold:s==null?void 0:s.authHold}),M&&{authorise:s==null?void 0:s.authorise});x(G)}}},Fe=async()=>{var i,d,h,I,q,G,Q,J,W,l;try{let f={method:"POST",redirect:"follow"},_=await yt.default.post(`${Je}api/v1/widget/generate-session`,f),D=Number(s==null?void 0:s.expiryYear)%100,tt=`${(i=s==null?void 0:s.cardNumber)==null?void 0:i.replace(/\s+/g,"")}=${D}${s==null?void 0:s.expiryMonth} ${s==null?void 0:s.cvv}`,Xe=forge.pki.publicKeyFromPem((h=(d=_==null?void 0:_.data)==null?void 0:d.data)==null?void 0:h.publicKeyPem).encrypt(tt,"RSA-OAEP",{md:forge.md.sha1.create(),mgf1:{md:forge.md.sha1.create()}}),Qe=forge.util.encode64(Xe),nt={"Content-Type":"application/json","x-app-session-key":(q=(I=_.data)==null?void 0:I.data)==null?void 0:q.session_key},it=JSON.stringify({enc_track2_data:Qe,algorithm:"RSAES_OAEP_SHA_1",session_key:(Q=(G=_==null?void 0:_.data)==null?void 0:G.data)==null?void 0:Q.session_key}),C=await yt.default.post(`${lt}tokenizer/tokenize`,it,{headers:nt});if((C==null?void 0:C.status)==200){let w=(W=(J=C==null?void 0:C.data)==null?void 0:J.data)==null?void 0:W.token;try{let $=await yt.default.post(`${Je}api/v1/gateway/verify-and-save/${e}`,{token:w});if(($==null?void 0:$.status)==200){let V=(l=$==null?void 0:$.data)==null?void 0:l.data,O={Token:V.gateway_token,Brand:V.card_data.brand,ExpirationMonth:V.card_data.expire_mm,ExpirationYear:V.card_data.expire_yy,Last4:V.card_data.last4,Bin:V.card_data.bin,postalCode:s==null?void 0:s.zipCode};x(O)}}catch($){console.log($,"error")}}}catch(f){console.log(f,"eroror")}},N=async i=>{var I,q,G,Q,J,W,l;if(i.preventDefault(),!(r()||!we()))try{let f=await yt.default.get(`${Je}api/v1/gateway/token/${e}`);if((f==null?void 0:f.status)==200){let _=(q=(I=f==null?void 0:f.data)==null?void 0:I.data)==null?void 0:q.gateway_token;((Q=(G=f==null?void 0:f.data)==null?void 0:G.data)==null?void 0:Q.paymentGateway)==((J=dn)==null?void 0:J.FRACTALKEY)?await Fe():DatacapWebToken.requestToken(_,"creditCardForm",T)}}catch(f){fe(((l=(W=f==null?void 0:f.response)==null?void 0:W.data)==null?void 0:l.message)||"Something went wrong!")}},He=()=>{fe("")},K=()=>{fe(""),v({firstName:"",lastName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",zipCode:"",authHold:!1,authorise:!1}),Z()};return b.default.createElement(b.default.Fragment,null,b.default.createElement(rt,null),b.default.createElement(Yt,null),b.default.createElement(Oe,{loading:P||F}),Ce&&b.default.createElement("div",{style:{maxHeight:"606px",minHeight:"60vh",padding:"40px"}},b.default.createElement(mt,{error:Ce,onClose:He})),!Ce&&b.default.createElement("div",{className:"creditformbox"},b.default.createElement("form",{id:"creditCardForm",onSubmit:N},b.default.createElement("div",{className:"name-row"},b.default.createElement("div",{className:"form-group"},b.default.createElement("label",null," First Name ",b.default.createElement("span",{className:"text-danger"},"*")),b.default.createElement("input",{type:"text",name:"first_name",placeholder:"First Name",value:(s==null?void 0:s.firstName)||"",onChange:i=>k("firstName",i.target.value)}),(y==null?void 0:y.firstName)&&b.default.createElement("small",{className:"error"},y==null?void 0:y.firstName)),b.default.createElement("div",{className:"form-group"},b.default.createElement("label",null," Last Name ",b.default.createElement("span",{className:"text-danger"},"*")),b.default.createElement("input",{type:"text",name:"last_name",placeholder:"Last Name",value:(s==null?void 0:s.lastName)||"",onChange:i=>k("lastName",i.target.value)}),(y==null?void 0:y.lastName)&&b.default.createElement("small",{className:"error"},y==null?void 0:y.lastName))),b.default.createElement("div",{className:"form-pay-row"},b.default.createElement("div",{className:"form-group"},b.default.createElement("label",null," Card Number ",b.default.createElement("span",{className:"text-danger"},"*")),b.default.createElement("input",{type:"text","data-token":"card_number",placeholder:"Card Number",maxLength:19,inputMode:"numeric",value:(s==null?void 0:s.cardNumber)||"",onChange:i=>be(i)}),(y==null?void 0:y.cardNumber)&&b.default.createElement("small",{className:"error"},y==null?void 0:y.cardNumber))),b.default.createElement("div",{className:"card-pay-row"},b.default.createElement("div",{className:"form-group"},b.default.createElement("label",null," Exp Month ",b.default.createElement("span",{className:"text-danger"},"*")),b.default.createElement("input",{type:"text","data-token":"exp_month",placeholder:"MM",maxLength:2,value:(s==null?void 0:s.expiryMonth)||"",onChange:i=>k("expiryMonth",i.target.value)}),(y==null?void 0:y.expiryMonth)&&b.default.createElement("small",{className:"error"},y==null?void 0:y.expiryMonth)),b.default.createElement("div",{className:"form-group"},b.default.createElement("label",null," Exp Year ",b.default.createElement("span",{className:"text-danger"},"*")),b.default.createElement("input",{type:"text","data-token":"exp_year",placeholder:"YYYY",maxLength:4,value:(s==null?void 0:s.expiryYear)||"",onChange:i=>k("expiryYear",i.target.value)}),(y==null?void 0:y.expiryYear)&&b.default.createElement("small",{className:"error"},y==null?void 0:y.expiryYear)),b.default.createElement("div",{className:"form-group"},b.default.createElement("label",null," CVV ",b.default.createElement("span",{className:"text-danger"},"*")),b.default.createElement("input",{type:"text","data-token":"cvv",placeholder:"CVV",maxLength:4,value:(s==null?void 0:s.cvv)||"",onChange:i=>k("cvv",i.target.value)}),(y==null?void 0:y.cvv)&&b.default.createElement("small",{className:"error"},y==null?void 0:y.cvv)),b.default.createElement("div",{className:"form-group"},b.default.createElement("label",null," Zip ",b.default.createElement("span",{className:"text-danger"},"*")),b.default.createElement("input",{type:"text",name:"zipcode",placeholder:"Zip Code",value:(L=s==null?void 0:s.zipCode)!=null?L:"",onChange:i=>k("zipCode",i.target.value)}),(y==null?void 0:y.zipCode)&&b.default.createElement("small",{className:"error"},y==null?void 0:y.zipCode))),M&&b.default.createElement(b.default.Fragment,null,b.default.createElement("div",{className:"checks-row"},b.default.createElement("input",{name:"authHold",type:"checkbox",id:"authHold",className:"form-check-input",checked:!!(s!=null&&s.authHold),onChange:i=>k("authHold",i.target.checked)}),b.default.createElement("label",{htmlFor:"authHold",className:"form-check-label"},"To securely save your card on file, we will place a temporary authorization hold of $1.00. This is not a charge and will be released by your card issuer shortly after verification.")),(y==null?void 0:y.authHold)&&b.default.createElement("small",{className:"check-error"},y==null?void 0:y.authHold),b.default.createElement("div",{className:"checks-row "},b.default.createElement("input",{name:"authorise",type:"checkbox",id:"authorise",className:"form-check-input",checked:!!(s!=null&&s.authorise),onChange:i=>k("authorise",i.target.checked)}),b.default.createElement("label",{htmlFor:"authorise",className:"form-check-label see-more"},de?b.default.createElement(b.default.Fragment,null,b.default.createElement("span",null,"By providing your payment information, you authorize"," ",b.default.createElement("strong",null,ve),", a Sky Systemz merchant, to securely store your card on file for future payments. Your card information will be encrypted and stored in compliance with PCI-DSS (Payment Card Industry Data Security Standard) regulations using Sky Systemz\u2019s secure payment technology. This information will be used solely for transactions you authorize with"," ",b.default.createElement("strong",null,ve),". You may request the removal of your stored payment information at any time by contacting"," ",b.default.createElement("strong",null,ve)," directly. By signing or proceeding with this transaction, you acknowledge and agree to this card on file authorization.",b.default.createElement("a",{href:"#",onClick:i=>{i.preventDefault(),o(!1)}},"See less ..."))):b.default.createElement(b.default.Fragment,null,b.default.createElement("span",null,"By providing your payment information, you authorize ",ve,", a Sky Systemz merchant, to securely store your card on file for future pay..."," "),b.default.createElement("a",{href:"#",onClick:i=>{i.preventDefault(),o(!0)}},"See more ...")))),(y==null?void 0:y.authorise)&&b.default.createElement("small",{className:"check-error"},y==null?void 0:y.authorise)),b.default.createElement("div",{className:"button-row"},b.default.createElement("button",{className:"cancelbtn",type:"button",onClick:K},"Cancel"),b.default.createElement("button",{className:"savebtn",type:"submit"},"Save")))))}0&&(module.exports={AddCard,AddCardSky,GetPaymentPage,PreAuthPayment,RequestPayment,RequestPreAuthPayment});
1964
+ `)}function cn({session_token:e,callback:x,isloading:F,onCancel:Z,showChecks:M,merchantName:ve}){var L;let[P,ze]=(0,b.useState)(!1),[de,o]=(0,b.useState)(!1),[s,v]=(0,b.useState)(),[y,m]=(0,b.useState)({}),[Ce,fe]=(0,b.useState)(""),c=()=>ze(!0),Se=()=>ze(!1),r=()=>{var q,G,Q,J,W,l,f,_;let i={},d=s,h=parseInt((d==null?void 0:d.expiryMonth)||"",10),I=(d==null?void 0:d.expiryYear)||"";return(q=d==null?void 0:d.firstName)!=null&&q.trim()||(i.firstName="Please enter a first name."),(G=d==null?void 0:d.lastName)!=null&&G.trim()||(i.lastName="Please enter a last name."),(Q=d==null?void 0:d.cardNumber)!=null&&Q.trim()||(i.cardNumber="Please enter a card number."),(J=d==null?void 0:d.expiryMonth)!=null&&J.trim()?(Number(d==null?void 0:d.expiryMonth)>12||Number(d==null?void 0:d.expiryMonth)<1)&&(i.expiryMonth="Invalid Expiration Month."):i.expiryMonth="Please enter an expiry month.",(W=d==null?void 0:d.expiryYear)!=null&&W.trim()?((l=d==null?void 0:d.expiryYear)==null?void 0:l.trim().length)!==4||Number(d==null?void 0:d.expiryYear)<2025?i.expiryYear="Invalid Expiration Year.":(isNaN(h)||h<1||h>12||I.length!==4)&&(i.expiryMonth="Invalid Expiration Date."):i.expiryYear="Please enter an expiry year.",(f=d==null?void 0:d.cvv)!=null&&f.trim()||(i.cvv="Please enter a CVV."),(_=d==null?void 0:d.zipCode)!=null&&_.trim()||(i.zipCode="Please enter a zip code."),M&&!(d!=null&&d.authHold)&&(i.authHold="You must authorize this before proceeding."),M&&!(d!=null&&d.authorise)&&(i.authorise="Please confirm your authorization to continue."),m(i),Object.keys(i).length>0},be=i=>{let h=i.target.value.replace(/\D/g,""),I="";/^3[47]/.test(h)?I=h.slice(0,15).replace(/^(\d{1,4})(\d{1,6})?(\d{1,5})?$/,(G,Q,J,W)=>[Q,J,W].filter(Boolean).join(" ")):I=h.slice(0,16).replace(/^(\d{1,4})(\d{1,4})?(\d{1,4})?(\d{1,4})?$/,(G,Q,J,W,l)=>[Q,J,W,l].filter(Boolean).join(" ")),m(q=>z(S({},q),{cardNumber:""})),v(q=>z(S({},q),{cardNumber:I}))},k=(i,d)=>{let h=i;if(["expiryMonth","expiryYear","zipCode","cvv"].includes(h)){(d===""||/^[0-9]+$/.test(d))&&(m(q=>z(S({},q),{[h]:""})),v(q=>z(S({},q),{[h]:d})));return}m(q=>z(S({},q),{[h]:""})),v(q=>z(S({},q),{[h]:d}))},we=()=>{let i=DatacapWebToken.validateCardNumber(s==null?void 0:s.cardNumber.replaceAll(" ","")),d=DatacapWebToken.validateExpirationDate(s==null?void 0:s.expiryMonth,s==null?void 0:s.expiryYear),h=DatacapWebToken.validateCVV(s==null?void 0:s.cvv),I={};return i||(I.cardNumber="Invalid card Number"),d||(I.expiryMonth="Invalid Expiration Date."),h||(I.cvv="Invalid CVV"),m(I),i&&h&&d},T=async i=>{var d,h;if(i.Error)fe(i.Error),Se();else{let I={token:i.Token,resp:i},q=await yt.default.post(`${Je}api/v1/gateway/update/token/${e}`,I);if((q==null?void 0:q.status)==200){let G=S(S({Token:(h=(d=q==null?void 0:q.data)==null?void 0:d.data)==null?void 0:h.gateway_token,Brand:i.Brand,ExpirationMonth:i.ExpirationMonth,ExpirationYear:i.ExpirationYear,Last4:i.Last4,Bin:i.Bin,CVV:i.CVV,postalCode:s==null?void 0:s.zipCode},M&&{authHold:s==null?void 0:s.authHold}),M&&{authorise:s==null?void 0:s.authorise});x(G)}}},Fe=async()=>{var i,d,h,I,q,G,Q,J,W,l;try{let f={method:"POST",redirect:"follow"},_=await yt.default.post(`${Je}api/v1/widget/generate-session`,f),D=Number(s==null?void 0:s.expiryYear)%100,tt=`${(i=s==null?void 0:s.cardNumber)==null?void 0:i.replace(/\s+/g,"")}=${D}${s==null?void 0:s.expiryMonth} ${s==null?void 0:s.cvv}`,Xe=forge.pki.publicKeyFromPem((h=(d=_==null?void 0:_.data)==null?void 0:d.data)==null?void 0:h.publicKeyPem).encrypt(tt,"RSA-OAEP",{md:forge.md.sha1.create(),mgf1:{md:forge.md.sha1.create()}}),Qe=forge.util.encode64(Xe),nt={"Content-Type":"application/json","x-app-session-key":(q=(I=_.data)==null?void 0:I.data)==null?void 0:q.session_key},it=JSON.stringify({enc_track2_data:Qe,algorithm:"RSAES_OAEP_SHA_1",session_key:(Q=(G=_==null?void 0:_.data)==null?void 0:G.data)==null?void 0:Q.session_key}),C=await yt.default.post(`${lt}tokenizer/tokenize`,it,{headers:nt});if((C==null?void 0:C.status)==200){let w=(W=(J=C==null?void 0:C.data)==null?void 0:J.data)==null?void 0:W.token;try{let $=await yt.default.post(`${Je}api/v1/gateway/verify-and-save/${e}`,{token:w});if(($==null?void 0:$.status)==200){let V=(l=$==null?void 0:$.data)==null?void 0:l.data,O={Token:V.gateway_token,Brand:V.card_data.brand,ExpirationMonth:V.card_data.expire_mm,ExpirationYear:V.card_data.expire_yy,Last4:V.card_data.last4,Bin:V.card_data.bin,postalCode:s==null?void 0:s.zipCode};x(O)}}catch($){console.log($,"error")}}}catch(f){console.log(f,"eroror")}},N=async i=>{var I,q,G,Q,J,W,l;if(i.preventDefault(),!(r()||!we()))try{let f=await yt.default.get(`${Je}api/v1/gateway/token/${e}`);if((f==null?void 0:f.status)==200){let _=(q=(I=f==null?void 0:f.data)==null?void 0:I.data)==null?void 0:q.gateway_token;((Q=(G=f==null?void 0:f.data)==null?void 0:G.data)==null?void 0:Q.paymentGateway)==((J=dn)==null?void 0:J.FRACTALKEY)?await Fe():DatacapWebToken.requestToken(_,"creditCardForm",T)}}catch(f){fe(((l=(W=f==null?void 0:f.response)==null?void 0:W.data)==null?void 0:l.message)||"Something went wrong!")}},He=()=>{fe("")},K=()=>{fe(""),v({firstName:"",lastName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",zipCode:"",authHold:!1,authorise:!1}),Z()};return b.default.createElement(b.default.Fragment,null,b.default.createElement(rt,null),b.default.createElement(Yt,null),b.default.createElement(Oe,{loading:P||F}),Ce&&b.default.createElement("div",{style:{maxHeight:"606px",minHeight:"60vh",padding:"40px"}},b.default.createElement(mt,{error:Ce,onClose:He})),!Ce&&b.default.createElement("div",{className:"creditformbox"},b.default.createElement("form",{id:"creditCardForm",onSubmit:N},b.default.createElement("div",{className:"name-row"},b.default.createElement("div",{className:"form-group"},b.default.createElement("label",null," First Name ",b.default.createElement("span",{className:"text-danger"},"*")),b.default.createElement("input",{type:"text",name:"first_name",placeholder:"First Name",value:(s==null?void 0:s.firstName)||"",onChange:i=>k("firstName",i.target.value)}),(y==null?void 0:y.firstName)&&b.default.createElement("small",{className:"error"},y==null?void 0:y.firstName)),b.default.createElement("div",{className:"form-group"},b.default.createElement("label",null," Last Name ",b.default.createElement("span",{className:"text-danger"},"*")),b.default.createElement("input",{type:"text",name:"last_name",placeholder:"Last Name",value:(s==null?void 0:s.lastName)||"",onChange:i=>k("lastName",i.target.value)}),(y==null?void 0:y.lastName)&&b.default.createElement("small",{className:"error"},y==null?void 0:y.lastName))),b.default.createElement("div",{className:"form-pay-row"},b.default.createElement("div",{className:"form-group"},b.default.createElement("label",null," Card Number ",b.default.createElement("span",{className:"text-danger"},"*")),b.default.createElement("input",{type:"text","data-token":"card_number",placeholder:"Card Number",maxLength:19,inputMode:"numeric",value:(s==null?void 0:s.cardNumber)||"",onChange:i=>be(i)}),(y==null?void 0:y.cardNumber)&&b.default.createElement("small",{className:"error"},y==null?void 0:y.cardNumber))),b.default.createElement("div",{className:"card-pay-row"},b.default.createElement("div",{className:"form-group"},b.default.createElement("label",null," Exp Month ",b.default.createElement("span",{className:"text-danger"},"*")),b.default.createElement("input",{type:"text","data-token":"exp_month",placeholder:"MM",maxLength:2,value:(s==null?void 0:s.expiryMonth)||"",onChange:i=>k("expiryMonth",i.target.value)}),(y==null?void 0:y.expiryMonth)&&b.default.createElement("small",{className:"error"},y==null?void 0:y.expiryMonth)),b.default.createElement("div",{className:"form-group"},b.default.createElement("label",null," Exp Year ",b.default.createElement("span",{className:"text-danger"},"*")),b.default.createElement("input",{type:"text","data-token":"exp_year",placeholder:"YYYY",maxLength:4,value:(s==null?void 0:s.expiryYear)||"",onChange:i=>k("expiryYear",i.target.value)}),(y==null?void 0:y.expiryYear)&&b.default.createElement("small",{className:"error"},y==null?void 0:y.expiryYear)),b.default.createElement("div",{className:"form-group"},b.default.createElement("label",null," CVV ",b.default.createElement("span",{className:"text-danger"},"*")),b.default.createElement("input",{type:"text","data-token":"cvv",placeholder:"CVV",maxLength:4,value:(s==null?void 0:s.cvv)||"",onChange:i=>k("cvv",i.target.value)}),(y==null?void 0:y.cvv)&&b.default.createElement("small",{className:"error"},y==null?void 0:y.cvv)),b.default.createElement("div",{className:"form-group"},b.default.createElement("label",null," Zip ",b.default.createElement("span",{className:"text-danger"},"*")),b.default.createElement("input",{type:"text",name:"zipcode",placeholder:"Zip Code",value:(L=s==null?void 0:s.zipCode)!=null?L:"",onChange:i=>k("zipCode",i.target.value)}),(y==null?void 0:y.zipCode)&&b.default.createElement("small",{className:"error"},y==null?void 0:y.zipCode))),M&&b.default.createElement(b.default.Fragment,null,b.default.createElement("div",{className:"checks-row"},b.default.createElement("input",{name:"authHold",type:"checkbox",id:"authHold",checked:!!(s!=null&&s.authHold),onChange:i=>k("authHold",i.target.checked)}),b.default.createElement("label",{htmlFor:"authHold",className:"form-check-label"},"To securely save your card on file, we will place a temporary authorization hold of $1.00. This is not a charge and will be released by your card issuer shortly after verification.")),(y==null?void 0:y.authHold)&&b.default.createElement("small",{className:"check-error"},y==null?void 0:y.authHold),b.default.createElement("div",{className:"checks-row "},b.default.createElement("input",{name:"authorise",type:"checkbox",id:"authorise",checked:!!(s!=null&&s.authorise),onChange:i=>k("authorise",i.target.checked)}),b.default.createElement("label",{htmlFor:"authorise",className:"form-check-label see-more"},de?b.default.createElement(b.default.Fragment,null,b.default.createElement("span",null,"By providing your payment information, you authorize"," ",b.default.createElement("strong",null,ve),", a Sky Systemz merchant, to securely store your card on file for future payments. Your card information will be encrypted and stored in compliance with PCI-DSS (Payment Card Industry Data Security Standard) regulations using Sky Systemz\u2019s secure payment technology. This information will be used solely for transactions you authorize with"," ",b.default.createElement("strong",null,ve),". You may request the removal of your stored payment information at any time by contacting"," ",b.default.createElement("strong",null,ve)," directly. By signing or proceeding with this transaction, you acknowledge and agree to this card on file authorization.",b.default.createElement("a",{href:"#",onClick:i=>{i.preventDefault(),o(!1)}},"See less ..."))):b.default.createElement(b.default.Fragment,null,b.default.createElement("span",null,"By providing your payment information, you authorize ",ve,", a Sky Systemz merchant, to securely store your card on file for future pay..."," "),b.default.createElement("a",{href:"#",onClick:i=>{i.preventDefault(),o(!0)}},"See more ...")))),(y==null?void 0:y.authorise)&&b.default.createElement("small",{className:"check-error"},y==null?void 0:y.authorise)),b.default.createElement("div",{className:"button-row"},b.default.createElement("button",{className:"cancelbtn",type:"button",onClick:K},"Cancel"),b.default.createElement("button",{className:"savebtn",type:"submit"},"Save")))))}0&&(module.exports={AddCard,AddCardSky,GetPaymentPage,PreAuthPayment,RequestPayment,RequestPreAuthPayment});
package/dist/index.mjs CHANGED
@@ -1904,6 +1904,7 @@ var tn=Object.defineProperty,nn=Object.defineProperties;var an=Object.getOwnProp
1904
1904
  width:16px !important;
1905
1905
  padding: 10px 12px;
1906
1906
  font-size: .875rem;
1907
+ max-height: 16px !important;
1907
1908
  height: 16px !important;
1908
1909
  }
1909
1910
  // .checks-row input.is-valid:checked{
@@ -1960,4 +1961,4 @@ var tn=Object.defineProperty,nn=Object.defineProperties;var an=Object.getOwnProp
1960
1961
  color:#ffffff !important;
1961
1962
  }
1962
1963
 
1963
- `)}function Hn({session_token:e,callback:w,isloading:$,onCancel:E,showChecks:I,merchantName:ve}){var F;let[S,ze]=kt(!1),[de,o]=kt(!1),[s,h]=kt(),[f,m]=kt({}),[Ce,fe]=kt(""),c=()=>ze(!0),Se=()=>ze(!1),r=()=>{var z,G,Q,J,W,l,g,_;let i={},d=s,u=parseInt((d==null?void 0:d.expiryMonth)||"",10),L=(d==null?void 0:d.expiryYear)||"";return(z=d==null?void 0:d.firstName)!=null&&z.trim()||(i.firstName="Please enter a first name."),(G=d==null?void 0:d.lastName)!=null&&G.trim()||(i.lastName="Please enter a last name."),(Q=d==null?void 0:d.cardNumber)!=null&&Q.trim()||(i.cardNumber="Please enter a card number."),(J=d==null?void 0:d.expiryMonth)!=null&&J.trim()?(Number(d==null?void 0:d.expiryMonth)>12||Number(d==null?void 0:d.expiryMonth)<1)&&(i.expiryMonth="Invalid Expiration Month."):i.expiryMonth="Please enter an expiry month.",(W=d==null?void 0:d.expiryYear)!=null&&W.trim()?((l=d==null?void 0:d.expiryYear)==null?void 0:l.trim().length)!==4||Number(d==null?void 0:d.expiryYear)<2025?i.expiryYear="Invalid Expiration Year.":(isNaN(u)||u<1||u>12||L.length!==4)&&(i.expiryMonth="Invalid Expiration Date."):i.expiryYear="Please enter an expiry year.",(g=d==null?void 0:d.cvv)!=null&&g.trim()||(i.cvv="Please enter a CVV."),(_=d==null?void 0:d.zipCode)!=null&&_.trim()||(i.zipCode="Please enter a zip code."),I&&!(d!=null&&d.authHold)&&(i.authHold="You must authorize this before proceeding."),I&&!(d!=null&&d.authorise)&&(i.authorise="Please confirm your authorization to continue."),m(i),Object.keys(i).length>0},be=i=>{let u=i.target.value.replace(/\D/g,""),L="";/^3[47]/.test(u)?L=u.slice(0,15).replace(/^(\d{1,4})(\d{1,6})?(\d{1,5})?$/,(G,Q,J,W)=>[Q,J,W].filter(Boolean).join(" ")):L=u.slice(0,16).replace(/^(\d{1,4})(\d{1,4})?(\d{1,4})?(\d{1,4})?$/,(G,Q,J,W,l)=>[Q,J,W,l].filter(Boolean).join(" ")),m(z=>P(M({},z),{cardNumber:""})),h(z=>P(M({},z),{cardNumber:L}))},k=(i,d)=>{let u=i;if(["expiryMonth","expiryYear","zipCode","cvv"].includes(u)){(d===""||/^[0-9]+$/.test(d))&&(m(z=>P(M({},z),{[u]:""})),h(z=>P(M({},z),{[u]:d})));return}m(z=>P(M({},z),{[u]:""})),h(z=>P(M({},z),{[u]:d}))},we=()=>{let i=DatacapWebToken.validateCardNumber(s==null?void 0:s.cardNumber.replaceAll(" ","")),d=DatacapWebToken.validateExpirationDate(s==null?void 0:s.expiryMonth,s==null?void 0:s.expiryYear),u=DatacapWebToken.validateCVV(s==null?void 0:s.cvv),L={};return i||(L.cardNumber="Invalid card Number"),d||(L.expiryMonth="Invalid Expiration Date."),u||(L.cvv="Invalid CVV"),m(L),i&&u&&d},Y=async i=>{var d,u;if(i.Error)fe(i.Error),Se();else{let L={token:i.Token,resp:i},z=await _t.post(`${Xe}api/v1/gateway/update/token/${e}`,L);if((z==null?void 0:z.status)==200){let G=M(M({Token:(u=(d=z==null?void 0:z.data)==null?void 0:d.data)==null?void 0:u.gateway_token,Brand:i.Brand,ExpirationMonth:i.ExpirationMonth,ExpirationYear:i.ExpirationYear,Last4:i.Last4,Bin:i.Bin,CVV:i.CVV,postalCode:s==null?void 0:s.zipCode},I&&{authHold:s==null?void 0:s.authHold}),I&&{authorise:s==null?void 0:s.authorise});w(G)}}},Fe=async()=>{var i,d,u,L,z,G,Q,J,W,l;try{let g={method:"POST",redirect:"follow"},_=await _t.post(`${Xe}api/v1/widget/generate-session`,g),D=Number(s==null?void 0:s.expiryYear)%100,nt=`${(i=s==null?void 0:s.cardNumber)==null?void 0:i.replace(/\s+/g,"")}=${D}${s==null?void 0:s.expiryMonth} ${s==null?void 0:s.cvv}`,De=forge.pki.publicKeyFromPem((u=(d=_==null?void 0:_.data)==null?void 0:d.data)==null?void 0:u.publicKeyPem).encrypt(nt,"RSA-OAEP",{md:forge.md.sha1.create(),mgf1:{md:forge.md.sha1.create()}}),Re=forge.util.encode64(De),it={"Content-Type":"application/json","x-app-session-key":(z=(L=_.data)==null?void 0:L.data)==null?void 0:z.session_key},at=JSON.stringify({enc_track2_data:Re,algorithm:"RSAES_OAEP_SHA_1",session_key:(Q=(G=_==null?void 0:_.data)==null?void 0:G.data)==null?void 0:Q.session_key}),b=await _t.post(`${mt}tokenizer/tokenize`,at,{headers:it});if((b==null?void 0:b.status)==200){let C=(W=(J=b==null?void 0:b.data)==null?void 0:J.data)==null?void 0:W.token;try{let T=await _t.post(`${Xe}api/v1/gateway/verify-and-save/${e}`,{token:C});if((T==null?void 0:T.status)==200){let j=(l=T==null?void 0:T.data)==null?void 0:l.data,O={Token:j.gateway_token,Brand:j.card_data.brand,ExpirationMonth:j.card_data.expire_mm,ExpirationYear:j.card_data.expire_yy,Last4:j.card_data.last4,Bin:j.card_data.bin,postalCode:s==null?void 0:s.zipCode};w(O)}}catch(T){console.log(T,"error")}}}catch(g){console.log(g,"eroror")}},N=async i=>{var L,z,G,Q,J,W,l;if(i.preventDefault(),!(r()||!we()))try{let g=await _t.get(`${Xe}api/v1/gateway/token/${e}`);if((g==null?void 0:g.status)==200){let _=(z=(L=g==null?void 0:g.data)==null?void 0:L.data)==null?void 0:z.gateway_token;((Q=(G=g==null?void 0:g.data)==null?void 0:G.data)==null?void 0:Q.paymentGateway)==((J=Gt)==null?void 0:J.FRACTALKEY)?await Fe():DatacapWebToken.requestToken(_,"creditCardForm",Y)}}catch(g){fe(((l=(W=g==null?void 0:g.response)==null?void 0:W.data)==null?void 0:l.message)||"Something went wrong!")}},$e=()=>{fe("")},V=()=>{fe(""),h({firstName:"",lastName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",zipCode:"",authHold:!1,authorise:!1}),E()};return v.createElement(v.Fragment,null,v.createElement(lt,null),v.createElement(Bt,null),v.createElement(Ge,{loading:S||$}),Ce&&v.createElement("div",{style:{maxHeight:"606px",minHeight:"60vh",padding:"40px"}},v.createElement(ut,{error:Ce,onClose:$e})),!Ce&&v.createElement("div",{className:"creditformbox"},v.createElement("form",{id:"creditCardForm",onSubmit:N},v.createElement("div",{className:"name-row"},v.createElement("div",{className:"form-group"},v.createElement("label",null," First Name ",v.createElement("span",{className:"text-danger"},"*")),v.createElement("input",{type:"text",name:"first_name",placeholder:"First Name",value:(s==null?void 0:s.firstName)||"",onChange:i=>k("firstName",i.target.value)}),(f==null?void 0:f.firstName)&&v.createElement("small",{className:"error"},f==null?void 0:f.firstName)),v.createElement("div",{className:"form-group"},v.createElement("label",null," Last Name ",v.createElement("span",{className:"text-danger"},"*")),v.createElement("input",{type:"text",name:"last_name",placeholder:"Last Name",value:(s==null?void 0:s.lastName)||"",onChange:i=>k("lastName",i.target.value)}),(f==null?void 0:f.lastName)&&v.createElement("small",{className:"error"},f==null?void 0:f.lastName))),v.createElement("div",{className:"form-pay-row"},v.createElement("div",{className:"form-group"},v.createElement("label",null," Card Number ",v.createElement("span",{className:"text-danger"},"*")),v.createElement("input",{type:"text","data-token":"card_number",placeholder:"Card Number",maxLength:19,inputMode:"numeric",value:(s==null?void 0:s.cardNumber)||"",onChange:i=>be(i)}),(f==null?void 0:f.cardNumber)&&v.createElement("small",{className:"error"},f==null?void 0:f.cardNumber))),v.createElement("div",{className:"card-pay-row"},v.createElement("div",{className:"form-group"},v.createElement("label",null," Exp Month ",v.createElement("span",{className:"text-danger"},"*")),v.createElement("input",{type:"text","data-token":"exp_month",placeholder:"MM",maxLength:2,value:(s==null?void 0:s.expiryMonth)||"",onChange:i=>k("expiryMonth",i.target.value)}),(f==null?void 0:f.expiryMonth)&&v.createElement("small",{className:"error"},f==null?void 0:f.expiryMonth)),v.createElement("div",{className:"form-group"},v.createElement("label",null," Exp Year ",v.createElement("span",{className:"text-danger"},"*")),v.createElement("input",{type:"text","data-token":"exp_year",placeholder:"YYYY",maxLength:4,value:(s==null?void 0:s.expiryYear)||"",onChange:i=>k("expiryYear",i.target.value)}),(f==null?void 0:f.expiryYear)&&v.createElement("small",{className:"error"},f==null?void 0:f.expiryYear)),v.createElement("div",{className:"form-group"},v.createElement("label",null," CVV ",v.createElement("span",{className:"text-danger"},"*")),v.createElement("input",{type:"text","data-token":"cvv",placeholder:"CVV",maxLength:4,value:(s==null?void 0:s.cvv)||"",onChange:i=>k("cvv",i.target.value)}),(f==null?void 0:f.cvv)&&v.createElement("small",{className:"error"},f==null?void 0:f.cvv)),v.createElement("div",{className:"form-group"},v.createElement("label",null," Zip ",v.createElement("span",{className:"text-danger"},"*")),v.createElement("input",{type:"text",name:"zipcode",placeholder:"Zip Code",value:(F=s==null?void 0:s.zipCode)!=null?F:"",onChange:i=>k("zipCode",i.target.value)}),(f==null?void 0:f.zipCode)&&v.createElement("small",{className:"error"},f==null?void 0:f.zipCode))),I&&v.createElement(v.Fragment,null,v.createElement("div",{className:"checks-row"},v.createElement("input",{name:"authHold",type:"checkbox",id:"authHold",className:"form-check-input",checked:!!(s!=null&&s.authHold),onChange:i=>k("authHold",i.target.checked)}),v.createElement("label",{htmlFor:"authHold",className:"form-check-label"},"To securely save your card on file, we will place a temporary authorization hold of $1.00. This is not a charge and will be released by your card issuer shortly after verification.")),(f==null?void 0:f.authHold)&&v.createElement("small",{className:"check-error"},f==null?void 0:f.authHold),v.createElement("div",{className:"checks-row "},v.createElement("input",{name:"authorise",type:"checkbox",id:"authorise",className:"form-check-input",checked:!!(s!=null&&s.authorise),onChange:i=>k("authorise",i.target.checked)}),v.createElement("label",{htmlFor:"authorise",className:"form-check-label see-more"},de?v.createElement(v.Fragment,null,v.createElement("span",null,"By providing your payment information, you authorize"," ",v.createElement("strong",null,ve),", a Sky Systemz merchant, to securely store your card on file for future payments. Your card information will be encrypted and stored in compliance with PCI-DSS (Payment Card Industry Data Security Standard) regulations using Sky Systemz\u2019s secure payment technology. This information will be used solely for transactions you authorize with"," ",v.createElement("strong",null,ve),". You may request the removal of your stored payment information at any time by contacting"," ",v.createElement("strong",null,ve)," directly. By signing or proceeding with this transaction, you acknowledge and agree to this card on file authorization.",v.createElement("a",{href:"#",onClick:i=>{i.preventDefault(),o(!1)}},"See less ..."))):v.createElement(v.Fragment,null,v.createElement("span",null,"By providing your payment information, you authorize ",ve,", a Sky Systemz merchant, to securely store your card on file for future pay..."," "),v.createElement("a",{href:"#",onClick:i=>{i.preventDefault(),o(!0)}},"See more ...")))),(f==null?void 0:f.authorise)&&v.createElement("small",{className:"check-error"},f==null?void 0:f.authorise)),v.createElement("div",{className:"button-row"},v.createElement("button",{className:"cancelbtn",type:"button",onClick:V},"Cancel"),v.createElement("button",{className:"savebtn",type:"submit"},"Save")))))}export{Bn as AddCard,Hn as AddCardSky,Fn as GetPaymentPage,Ln as PreAuthPayment,hn as RequestPayment,vn as RequestPreAuthPayment};
1964
+ `)}function Hn({session_token:e,callback:w,isloading:$,onCancel:E,showChecks:I,merchantName:ve}){var F;let[S,ze]=kt(!1),[de,o]=kt(!1),[s,h]=kt(),[f,m]=kt({}),[Ce,fe]=kt(""),c=()=>ze(!0),Se=()=>ze(!1),r=()=>{var z,G,Q,J,W,l,g,_;let i={},d=s,u=parseInt((d==null?void 0:d.expiryMonth)||"",10),L=(d==null?void 0:d.expiryYear)||"";return(z=d==null?void 0:d.firstName)!=null&&z.trim()||(i.firstName="Please enter a first name."),(G=d==null?void 0:d.lastName)!=null&&G.trim()||(i.lastName="Please enter a last name."),(Q=d==null?void 0:d.cardNumber)!=null&&Q.trim()||(i.cardNumber="Please enter a card number."),(J=d==null?void 0:d.expiryMonth)!=null&&J.trim()?(Number(d==null?void 0:d.expiryMonth)>12||Number(d==null?void 0:d.expiryMonth)<1)&&(i.expiryMonth="Invalid Expiration Month."):i.expiryMonth="Please enter an expiry month.",(W=d==null?void 0:d.expiryYear)!=null&&W.trim()?((l=d==null?void 0:d.expiryYear)==null?void 0:l.trim().length)!==4||Number(d==null?void 0:d.expiryYear)<2025?i.expiryYear="Invalid Expiration Year.":(isNaN(u)||u<1||u>12||L.length!==4)&&(i.expiryMonth="Invalid Expiration Date."):i.expiryYear="Please enter an expiry year.",(g=d==null?void 0:d.cvv)!=null&&g.trim()||(i.cvv="Please enter a CVV."),(_=d==null?void 0:d.zipCode)!=null&&_.trim()||(i.zipCode="Please enter a zip code."),I&&!(d!=null&&d.authHold)&&(i.authHold="You must authorize this before proceeding."),I&&!(d!=null&&d.authorise)&&(i.authorise="Please confirm your authorization to continue."),m(i),Object.keys(i).length>0},be=i=>{let u=i.target.value.replace(/\D/g,""),L="";/^3[47]/.test(u)?L=u.slice(0,15).replace(/^(\d{1,4})(\d{1,6})?(\d{1,5})?$/,(G,Q,J,W)=>[Q,J,W].filter(Boolean).join(" ")):L=u.slice(0,16).replace(/^(\d{1,4})(\d{1,4})?(\d{1,4})?(\d{1,4})?$/,(G,Q,J,W,l)=>[Q,J,W,l].filter(Boolean).join(" ")),m(z=>P(M({},z),{cardNumber:""})),h(z=>P(M({},z),{cardNumber:L}))},k=(i,d)=>{let u=i;if(["expiryMonth","expiryYear","zipCode","cvv"].includes(u)){(d===""||/^[0-9]+$/.test(d))&&(m(z=>P(M({},z),{[u]:""})),h(z=>P(M({},z),{[u]:d})));return}m(z=>P(M({},z),{[u]:""})),h(z=>P(M({},z),{[u]:d}))},we=()=>{let i=DatacapWebToken.validateCardNumber(s==null?void 0:s.cardNumber.replaceAll(" ","")),d=DatacapWebToken.validateExpirationDate(s==null?void 0:s.expiryMonth,s==null?void 0:s.expiryYear),u=DatacapWebToken.validateCVV(s==null?void 0:s.cvv),L={};return i||(L.cardNumber="Invalid card Number"),d||(L.expiryMonth="Invalid Expiration Date."),u||(L.cvv="Invalid CVV"),m(L),i&&u&&d},Y=async i=>{var d,u;if(i.Error)fe(i.Error),Se();else{let L={token:i.Token,resp:i},z=await _t.post(`${Xe}api/v1/gateway/update/token/${e}`,L);if((z==null?void 0:z.status)==200){let G=M(M({Token:(u=(d=z==null?void 0:z.data)==null?void 0:d.data)==null?void 0:u.gateway_token,Brand:i.Brand,ExpirationMonth:i.ExpirationMonth,ExpirationYear:i.ExpirationYear,Last4:i.Last4,Bin:i.Bin,CVV:i.CVV,postalCode:s==null?void 0:s.zipCode},I&&{authHold:s==null?void 0:s.authHold}),I&&{authorise:s==null?void 0:s.authorise});w(G)}}},Fe=async()=>{var i,d,u,L,z,G,Q,J,W,l;try{let g={method:"POST",redirect:"follow"},_=await _t.post(`${Xe}api/v1/widget/generate-session`,g),D=Number(s==null?void 0:s.expiryYear)%100,nt=`${(i=s==null?void 0:s.cardNumber)==null?void 0:i.replace(/\s+/g,"")}=${D}${s==null?void 0:s.expiryMonth} ${s==null?void 0:s.cvv}`,De=forge.pki.publicKeyFromPem((u=(d=_==null?void 0:_.data)==null?void 0:d.data)==null?void 0:u.publicKeyPem).encrypt(nt,"RSA-OAEP",{md:forge.md.sha1.create(),mgf1:{md:forge.md.sha1.create()}}),Re=forge.util.encode64(De),it={"Content-Type":"application/json","x-app-session-key":(z=(L=_.data)==null?void 0:L.data)==null?void 0:z.session_key},at=JSON.stringify({enc_track2_data:Re,algorithm:"RSAES_OAEP_SHA_1",session_key:(Q=(G=_==null?void 0:_.data)==null?void 0:G.data)==null?void 0:Q.session_key}),b=await _t.post(`${mt}tokenizer/tokenize`,at,{headers:it});if((b==null?void 0:b.status)==200){let C=(W=(J=b==null?void 0:b.data)==null?void 0:J.data)==null?void 0:W.token;try{let T=await _t.post(`${Xe}api/v1/gateway/verify-and-save/${e}`,{token:C});if((T==null?void 0:T.status)==200){let j=(l=T==null?void 0:T.data)==null?void 0:l.data,O={Token:j.gateway_token,Brand:j.card_data.brand,ExpirationMonth:j.card_data.expire_mm,ExpirationYear:j.card_data.expire_yy,Last4:j.card_data.last4,Bin:j.card_data.bin,postalCode:s==null?void 0:s.zipCode};w(O)}}catch(T){console.log(T,"error")}}}catch(g){console.log(g,"eroror")}},N=async i=>{var L,z,G,Q,J,W,l;if(i.preventDefault(),!(r()||!we()))try{let g=await _t.get(`${Xe}api/v1/gateway/token/${e}`);if((g==null?void 0:g.status)==200){let _=(z=(L=g==null?void 0:g.data)==null?void 0:L.data)==null?void 0:z.gateway_token;((Q=(G=g==null?void 0:g.data)==null?void 0:G.data)==null?void 0:Q.paymentGateway)==((J=Gt)==null?void 0:J.FRACTALKEY)?await Fe():DatacapWebToken.requestToken(_,"creditCardForm",Y)}}catch(g){fe(((l=(W=g==null?void 0:g.response)==null?void 0:W.data)==null?void 0:l.message)||"Something went wrong!")}},$e=()=>{fe("")},V=()=>{fe(""),h({firstName:"",lastName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",zipCode:"",authHold:!1,authorise:!1}),E()};return v.createElement(v.Fragment,null,v.createElement(lt,null),v.createElement(Bt,null),v.createElement(Ge,{loading:S||$}),Ce&&v.createElement("div",{style:{maxHeight:"606px",minHeight:"60vh",padding:"40px"}},v.createElement(ut,{error:Ce,onClose:$e})),!Ce&&v.createElement("div",{className:"creditformbox"},v.createElement("form",{id:"creditCardForm",onSubmit:N},v.createElement("div",{className:"name-row"},v.createElement("div",{className:"form-group"},v.createElement("label",null," First Name ",v.createElement("span",{className:"text-danger"},"*")),v.createElement("input",{type:"text",name:"first_name",placeholder:"First Name",value:(s==null?void 0:s.firstName)||"",onChange:i=>k("firstName",i.target.value)}),(f==null?void 0:f.firstName)&&v.createElement("small",{className:"error"},f==null?void 0:f.firstName)),v.createElement("div",{className:"form-group"},v.createElement("label",null," Last Name ",v.createElement("span",{className:"text-danger"},"*")),v.createElement("input",{type:"text",name:"last_name",placeholder:"Last Name",value:(s==null?void 0:s.lastName)||"",onChange:i=>k("lastName",i.target.value)}),(f==null?void 0:f.lastName)&&v.createElement("small",{className:"error"},f==null?void 0:f.lastName))),v.createElement("div",{className:"form-pay-row"},v.createElement("div",{className:"form-group"},v.createElement("label",null," Card Number ",v.createElement("span",{className:"text-danger"},"*")),v.createElement("input",{type:"text","data-token":"card_number",placeholder:"Card Number",maxLength:19,inputMode:"numeric",value:(s==null?void 0:s.cardNumber)||"",onChange:i=>be(i)}),(f==null?void 0:f.cardNumber)&&v.createElement("small",{className:"error"},f==null?void 0:f.cardNumber))),v.createElement("div",{className:"card-pay-row"},v.createElement("div",{className:"form-group"},v.createElement("label",null," Exp Month ",v.createElement("span",{className:"text-danger"},"*")),v.createElement("input",{type:"text","data-token":"exp_month",placeholder:"MM",maxLength:2,value:(s==null?void 0:s.expiryMonth)||"",onChange:i=>k("expiryMonth",i.target.value)}),(f==null?void 0:f.expiryMonth)&&v.createElement("small",{className:"error"},f==null?void 0:f.expiryMonth)),v.createElement("div",{className:"form-group"},v.createElement("label",null," Exp Year ",v.createElement("span",{className:"text-danger"},"*")),v.createElement("input",{type:"text","data-token":"exp_year",placeholder:"YYYY",maxLength:4,value:(s==null?void 0:s.expiryYear)||"",onChange:i=>k("expiryYear",i.target.value)}),(f==null?void 0:f.expiryYear)&&v.createElement("small",{className:"error"},f==null?void 0:f.expiryYear)),v.createElement("div",{className:"form-group"},v.createElement("label",null," CVV ",v.createElement("span",{className:"text-danger"},"*")),v.createElement("input",{type:"text","data-token":"cvv",placeholder:"CVV",maxLength:4,value:(s==null?void 0:s.cvv)||"",onChange:i=>k("cvv",i.target.value)}),(f==null?void 0:f.cvv)&&v.createElement("small",{className:"error"},f==null?void 0:f.cvv)),v.createElement("div",{className:"form-group"},v.createElement("label",null," Zip ",v.createElement("span",{className:"text-danger"},"*")),v.createElement("input",{type:"text",name:"zipcode",placeholder:"Zip Code",value:(F=s==null?void 0:s.zipCode)!=null?F:"",onChange:i=>k("zipCode",i.target.value)}),(f==null?void 0:f.zipCode)&&v.createElement("small",{className:"error"},f==null?void 0:f.zipCode))),I&&v.createElement(v.Fragment,null,v.createElement("div",{className:"checks-row"},v.createElement("input",{name:"authHold",type:"checkbox",id:"authHold",checked:!!(s!=null&&s.authHold),onChange:i=>k("authHold",i.target.checked)}),v.createElement("label",{htmlFor:"authHold",className:"form-check-label"},"To securely save your card on file, we will place a temporary authorization hold of $1.00. This is not a charge and will be released by your card issuer shortly after verification.")),(f==null?void 0:f.authHold)&&v.createElement("small",{className:"check-error"},f==null?void 0:f.authHold),v.createElement("div",{className:"checks-row "},v.createElement("input",{name:"authorise",type:"checkbox",id:"authorise",checked:!!(s!=null&&s.authorise),onChange:i=>k("authorise",i.target.checked)}),v.createElement("label",{htmlFor:"authorise",className:"form-check-label see-more"},de?v.createElement(v.Fragment,null,v.createElement("span",null,"By providing your payment information, you authorize"," ",v.createElement("strong",null,ve),", a Sky Systemz merchant, to securely store your card on file for future payments. Your card information will be encrypted and stored in compliance with PCI-DSS (Payment Card Industry Data Security Standard) regulations using Sky Systemz\u2019s secure payment technology. This information will be used solely for transactions you authorize with"," ",v.createElement("strong",null,ve),". You may request the removal of your stored payment information at any time by contacting"," ",v.createElement("strong",null,ve)," directly. By signing or proceeding with this transaction, you acknowledge and agree to this card on file authorization.",v.createElement("a",{href:"#",onClick:i=>{i.preventDefault(),o(!1)}},"See less ..."))):v.createElement(v.Fragment,null,v.createElement("span",null,"By providing your payment information, you authorize ",ve,", a Sky Systemz merchant, to securely store your card on file for future pay..."," "),v.createElement("a",{href:"#",onClick:i=>{i.preventDefault(),o(!0)}},"See more ...")))),(f==null?void 0:f.authorise)&&v.createElement("small",{className:"check-error"},f==null?void 0:f.authorise)),v.createElement("div",{className:"button-row"},v.createElement("button",{className:"cancelbtn",type:"button",onClick:V},"Cancel"),v.createElement("button",{className:"savebtn",type:"submit"},"Save")))))}export{Bn as AddCard,Hn as AddCardSky,Fn as GetPaymentPage,Ln as PreAuthPayment,hn as RequestPayment,vn as RequestPreAuthPayment};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fractalpay/fractalpay-next-dev",
3
- "version": "0.0.14",
3
+ "version": "0.0.15",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "next dev -p 4001",