@fractalpay/fractalpay-next-dev 0.0.8 → 0.0.10

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
@@ -1819,7 +1819,7 @@
1819
1819
  @import url("https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700;800;900&display=swap");
1820
1820
 
1821
1821
  .creditformbox {
1822
- max-width: 550px;
1822
+ // max-width: 550px;
1823
1823
  margin: 0 auto;
1824
1824
  font-family: Poppins !important;
1825
1825
  }
@@ -1901,34 +1901,34 @@
1901
1901
  margin-top:20px;
1902
1902
  }
1903
1903
 
1904
- .btn.btn-dark {
1904
+ .cancelbtn {
1905
1905
  font-size:15px;
1906
- color: #000000;
1907
- background-color: transparent;
1908
- border:1px solid #000000;
1906
+ color: #000000 !important;
1907
+ background-color: transparent !important;
1908
+ border:1px solid #000000 !important;
1909
1909
  border-radius: 10px !important;
1910
1910
  padding: 14px 25px !important;
1911
1911
  cursor:pointer;
1912
1912
  font-size: 16px;
1913
1913
  }
1914
- .btn.btn-dark:hover {
1915
- background:#000000;
1916
- color:#ffffff;
1914
+ .cancelbtn:hover {
1915
+ background:#000000 !important;
1916
+ color:#ffffff !important;
1917
1917
  }
1918
1918
 
1919
- .btn.btn-blue {
1919
+ .savebtn {
1920
1920
  font-size:15px;
1921
- color: #2979FF;
1922
- background-color: transparent;
1923
- border:1px solid #2979FF;
1921
+ color: #2979FF !important;
1922
+ background-color: transparent !important;
1923
+ border:1px solid #2979FF !important;
1924
1924
  border-radius: 10px !important;
1925
1925
  padding: 14px 25px !important;
1926
1926
  cursor:pointer;
1927
1927
  font-size: 16px;
1928
1928
  }
1929
- .btn.btn-blue:hover {
1930
- background:#2979FF;
1931
- color:#ffffff;
1929
+ .savebtn:hover {
1930
+ background:#2979FF !important;
1931
+ color:#ffffff !important;
1932
1932
  }
1933
1933
 
1934
- `)}function cn({session_token:e,callback:f,isloading:M,onCancel:K}){var Me;let[S,Pe]=(0,_.useState)(!1),[l,ke]=(0,_.useState)(),[N,o]=(0,_.useState)({}),[V,h]=(0,_.useState)(""),D=()=>Pe(!0),g=()=>Pe(!1),Se=()=>{var s,T,y,$,W,Q,H,J;let i={},v=l,k=parseInt((v==null?void 0:v.expiryMonth)||"",10),x=(v==null?void 0:v.expiryYear)||"";return(s=v==null?void 0:v.firstName)!=null&&s.trim()||(i.firstName="Please enter a first name."),(T=v==null?void 0:v.lastName)!=null&&T.trim()||(i.lastName="Please enter a last name."),(y=v==null?void 0:v.cardNumber)!=null&&y.trim()||(i.cardNumber="Please enter a card number."),($=v==null?void 0:v.expiryMonth)!=null&&$.trim()?(Number(v==null?void 0:v.expiryMonth)>12||Number(v==null?void 0:v.expiryMonth)<1)&&(i.expiryMonth="Invalid Expiration Month."):i.expiryMonth="Please enter an expiry month.",(W=v==null?void 0:v.expiryYear)!=null&&W.trim()?((Q=v==null?void 0:v.expiryYear)==null?void 0:Q.trim().length)!==4||Number(v==null?void 0:v.expiryYear)<2025?i.expiryYear="Invalid Expiration Year.":(isNaN(k)||k<1||k>12||x.length!==4)&&(i.expiryMonth="Invalid Expiration Date."):i.expiryYear="Please enter an expiry year.",(H=v==null?void 0:v.cvv)!=null&&H.trim()||(i.cvv="Please enter a CVV."),(J=v==null?void 0:v.zipCode)!=null&&J.trim()||(i.zipCode="Please enter a zip code."),o(i),Object.keys(i).length>0},_e=i=>{let k=i.target.value.replace(/\D/g,""),x="";/^3[47]/.test(k)?x=k.slice(0,15).replace(/^(\d{1,4})(\d{1,6})?(\d{1,5})?$/,(T,y,$,W)=>[y,$,W].filter(Boolean).join(" ")):x=k.slice(0,16).replace(/^(\d{1,4})(\d{1,4})?(\d{1,4})?(\d{1,4})?$/,(T,y,$,W,Q)=>[y,$,W,Q].filter(Boolean).join(" ")),o(s=>P(F({},s),{cardNumber:""})),ke(s=>P(F({},s),{cardNumber:x}))},d=(i,v)=>{let k=i;if(["expiryMonth","expiryYear","zipCode","cvv"].includes(k)){(v===""||/^[0-9]+$/.test(v))&&(o(s=>P(F({},s),{[k]:""})),ke(s=>P(F({},s),{[k]:v})));return}o(s=>P(F({},s),{[k]:""})),console.log(v,k),ke(s=>P(F({},s),{[k]:v}))},Le=()=>{let i=DatacapWebToken.validateCardNumber(l==null?void 0:l.cardNumber.replaceAll(" ","")),v=DatacapWebToken.validateExpirationDate(l==null?void 0:l.expiryMonth,l==null?void 0:l.expiryYear),k=DatacapWebToken.validateCVV(l==null?void 0:l.cvv),x={};return i||(x.cardNumber="Invalid card Number"),v||(x.expiryMonth="Invalid Expiration Date."),k||(x.cvv="Invalid CVV"),o(x),i&&k&&v},r=async i=>{var v,k;if(i.Error)console.log(i==null?void 0:i.Error),h(i.Error),g();else{let x={token:i.Token,resp:i},s=await yt.default.post(`${De}api/v1/gateway/update/token/${e}`,x);if(console.log(s,"jkdvfhsdjkhf"),(s==null?void 0:s.status)==200){let T={Token:(k=(v=s==null?void 0:s.data)==null?void 0:v.data)==null?void 0:k.gateway_token,Brand:i.Brand,ExpirationMonth:i.ExpirationMonth,ExpirationYear:i.ExpirationYear,Last4:i.Last4,Bin:i.Bin,CVV:i.CVV};console.log(T,"respspsp"),f(T)}}},be=async()=>{var i,v,k,x,s,T,y,$,W,Q;try{let H={method:"POST",redirect:"follow"},J=await yt.default.post(`${De}api/v1/widget/generate-session`,H),me=Number(l==null?void 0:l.expiryYear)%100,C=`${(i=l==null?void 0:l.cardNumber)==null?void 0:i.replace(/\s+/g,"")}=${me}${l==null?void 0:l.expiryMonth} ${l==null?void 0:l.cvv}`,R=forge.pki.publicKeyFromPem((k=(v=J==null?void 0:J.data)==null?void 0:v.data)==null?void 0:k.publicKeyPem).encrypt(C,"RSA-OAEP",{md:forge.md.sha1.create(),mgf1:{md:forge.md.sha1.create()}}),ve=forge.util.encode64(R),it={"Content-Type":"application/json","x-app-session-key":(s=(x=J.data)==null?void 0:x.data)==null?void 0:s.session_key},at=JSON.stringify({enc_track2_data:ve,algorithm:"RSAES_OAEP_SHA_1",session_key:(y=(T=J==null?void 0:J.data)==null?void 0:T.data)==null?void 0:y.session_key}),Be=await yt.default.post(`${lt}tokenizer/tokenize`,at,{headers:it});if(console.log(Be,"tokeni"),(Be==null?void 0:Be.status)==200){let Re=(W=($=Be==null?void 0:Be.data)==null?void 0:$.data)==null?void 0:W.token;try{let qe=await yt.default.post(`${De}api/v1/gateway/verify-and-save/${e}`,{token:Re});if(console.log(qe,"verifyandsaveresp"),(qe==null?void 0:qe.status)==200){let He=(Q=qe==null?void 0:qe.data)==null?void 0:Q.data,b={Token:He.gateway_token,Brand:He.card_data.brand,ExpirationMonth:He.card_data.expire_mm,ExpirationYear:He.card_data.expire_yy,Last4:He.card_data.last4,Bin:He.card_data.bin};f(b)}}catch(qe){console.log(qe,"error")}}}catch(H){console.log(H,"eroror")}},z=async i=>{var x,s,T,y,$,W,Q;if(i.preventDefault(),!(Se()||!Le()))try{let H=await yt.default.get(`${De}api/v1/gateway/token/${e}`);if((H==null?void 0:H.status)==200){let J=(s=(x=H==null?void 0:H.data)==null?void 0:x.data)==null?void 0:s.gateway_token;((y=(T=H==null?void 0:H.data)==null?void 0:T.data)==null?void 0:y.paymentGateway)==(($=dn)==null?void 0:$.FRACTALKEY)?await be():DatacapWebToken.requestToken(J,"creditCardForm",r)}}catch(H){console.log(H,"svuiuhd"),h(((Q=(W=H==null?void 0:H.response)==null?void 0:W.data)==null?void 0:Q.message)||"Something went wrong!")}};console.log(l,"uifgudasgf",N);let Ce=()=>{h("")},A=()=>{h(""),ke({firstName:"",lastName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",zipCode:""}),K()};return _.default.createElement(_.default.Fragment,null,_.default.createElement(st,null),_.default.createElement(Yt,null),_.default.createElement(Ue,{loading:S}),V&&_.default.createElement("div",{style:{maxHeight:"606px",minHeight:"60vh",padding:"40px"}},_.default.createElement(mt,{error:V,onClose:Ce})),!V&&_.default.createElement("div",{className:"creditformbox"},_.default.createElement("form",{id:"creditCardForm",onSubmit:z},_.default.createElement("div",{className:"name-row"},_.default.createElement("div",{className:"form-group"},_.default.createElement("label",null," First Name ",_.default.createElement("span",{className:"text-danger"},"*")),_.default.createElement("input",{type:"text",name:"first_name",placeholder:"First Name",value:(l==null?void 0:l.firstName)||"",onChange:i=>d("firstName",i.target.value)}),(N==null?void 0:N.firstName)&&_.default.createElement("small",{className:"error"},N==null?void 0:N.firstName)),_.default.createElement("div",{className:"form-group"},_.default.createElement("label",null," Last Name ",_.default.createElement("span",{className:"text-danger"},"*")),_.default.createElement("input",{type:"text",name:"last_name",placeholder:"Last Name",value:(l==null?void 0:l.lastName)||"",onChange:i=>d("lastName",i.target.value)}),(N==null?void 0:N.lastName)&&_.default.createElement("small",{className:"error"},N==null?void 0:N.lastName))),_.default.createElement("div",{className:"form-pay-row"},_.default.createElement("div",{className:"form-group"},_.default.createElement("label",null," Card Number ",_.default.createElement("span",{className:"text-danger"},"*")),_.default.createElement("input",{type:"text","data-token":"card_number",placeholder:"Card Number",maxLength:19,inputMode:"numeric",value:(l==null?void 0:l.cardNumber)||"",onChange:i=>_e(i)}),(N==null?void 0:N.cardNumber)&&_.default.createElement("small",{className:"error"},N==null?void 0:N.cardNumber))),_.default.createElement("div",{className:"card-pay-row"},_.default.createElement("div",{className:"form-group"},_.default.createElement("label",null," Exp Month ",_.default.createElement("span",{className:"text-danger"},"*")),_.default.createElement("input",{type:"text","data-token":"exp_month",placeholder:"MM",maxLength:2,value:(l==null?void 0:l.expiryMonth)||"",onChange:i=>d("expiryMonth",i.target.value)}),(N==null?void 0:N.expiryMonth)&&_.default.createElement("small",{className:"error"},N==null?void 0:N.expiryMonth)),_.default.createElement("div",{className:"form-group"},_.default.createElement("label",null," Exp Year ",_.default.createElement("span",{className:"text-danger"},"*")),_.default.createElement("input",{type:"text","data-token":"exp_year",placeholder:"YYYY",maxLength:4,value:(l==null?void 0:l.expiryYear)||"",onChange:i=>d("expiryYear",i.target.value)}),(N==null?void 0:N.expiryYear)&&_.default.createElement("small",{className:"error"},N==null?void 0:N.expiryYear)),_.default.createElement("div",{className:"form-group"},_.default.createElement("label",null," CVV ",_.default.createElement("span",{className:"text-danger"},"*")),_.default.createElement("input",{type:"text","data-token":"cvv",placeholder:"CVV",maxLength:4,value:(l==null?void 0:l.cvv)||"",onChange:i=>d("cvv",i.target.value)}),(N==null?void 0:N.cvv)&&_.default.createElement("small",{className:"error"},N==null?void 0:N.cvv)),_.default.createElement("div",{className:"form-group"},_.default.createElement("label",null," Zip ",_.default.createElement("span",{className:"text-danger"},"*")),_.default.createElement("input",{type:"text",name:"zipcode",placeholder:"Zip Code",value:(Me=l==null?void 0:l.zipCode)!=null?Me:"",onChange:i=>d("zipCode",i.target.value)}),(N==null?void 0:N.zipCode)&&_.default.createElement("small",{className:"error"},N==null?void 0:N.zipCode))),_.default.createElement("div",{className:"button-row"},_.default.createElement("button",{className:"btn btn-dark",onClick:A},"Cancel"),_.default.createElement("button",{className:"btn btn-blue",type:"submit"},"Save")))))}0&&(module.exports={AddCard,AddCardSky,GetPaymentPage,PreAuthPayment,RequestPayment,RequestPreAuthPayment});
1934
+ `)}function cn({session_token:e,callback:f,isloading:M,onCancel:K}){var Me;let[S,Pe]=(0,_.useState)(!1),[l,ke]=(0,_.useState)(),[N,o]=(0,_.useState)({}),[V,h]=(0,_.useState)(""),D=()=>Pe(!0),g=()=>Pe(!1),Se=()=>{var s,T,y,$,W,Q,H,J;let i={},v=l,k=parseInt((v==null?void 0:v.expiryMonth)||"",10),x=(v==null?void 0:v.expiryYear)||"";return(s=v==null?void 0:v.firstName)!=null&&s.trim()||(i.firstName="Please enter a first name."),(T=v==null?void 0:v.lastName)!=null&&T.trim()||(i.lastName="Please enter a last name."),(y=v==null?void 0:v.cardNumber)!=null&&y.trim()||(i.cardNumber="Please enter a card number."),($=v==null?void 0:v.expiryMonth)!=null&&$.trim()?(Number(v==null?void 0:v.expiryMonth)>12||Number(v==null?void 0:v.expiryMonth)<1)&&(i.expiryMonth="Invalid Expiration Month."):i.expiryMonth="Please enter an expiry month.",(W=v==null?void 0:v.expiryYear)!=null&&W.trim()?((Q=v==null?void 0:v.expiryYear)==null?void 0:Q.trim().length)!==4||Number(v==null?void 0:v.expiryYear)<2025?i.expiryYear="Invalid Expiration Year.":(isNaN(k)||k<1||k>12||x.length!==4)&&(i.expiryMonth="Invalid Expiration Date."):i.expiryYear="Please enter an expiry year.",(H=v==null?void 0:v.cvv)!=null&&H.trim()||(i.cvv="Please enter a CVV."),(J=v==null?void 0:v.zipCode)!=null&&J.trim()||(i.zipCode="Please enter a zip code."),o(i),Object.keys(i).length>0},_e=i=>{let k=i.target.value.replace(/\D/g,""),x="";/^3[47]/.test(k)?x=k.slice(0,15).replace(/^(\d{1,4})(\d{1,6})?(\d{1,5})?$/,(T,y,$,W)=>[y,$,W].filter(Boolean).join(" ")):x=k.slice(0,16).replace(/^(\d{1,4})(\d{1,4})?(\d{1,4})?(\d{1,4})?$/,(T,y,$,W,Q)=>[y,$,W,Q].filter(Boolean).join(" ")),o(s=>P(F({},s),{cardNumber:""})),ke(s=>P(F({},s),{cardNumber:x}))},d=(i,v)=>{let k=i;if(["expiryMonth","expiryYear","zipCode","cvv"].includes(k)){(v===""||/^[0-9]+$/.test(v))&&(o(s=>P(F({},s),{[k]:""})),ke(s=>P(F({},s),{[k]:v})));return}o(s=>P(F({},s),{[k]:""})),console.log(v,k),ke(s=>P(F({},s),{[k]:v}))},Le=()=>{let i=DatacapWebToken.validateCardNumber(l==null?void 0:l.cardNumber.replaceAll(" ","")),v=DatacapWebToken.validateExpirationDate(l==null?void 0:l.expiryMonth,l==null?void 0:l.expiryYear),k=DatacapWebToken.validateCVV(l==null?void 0:l.cvv),x={};return i||(x.cardNumber="Invalid card Number"),v||(x.expiryMonth="Invalid Expiration Date."),k||(x.cvv="Invalid CVV"),o(x),i&&k&&v},r=async i=>{var v,k;if(i.Error)console.log(i==null?void 0:i.Error),h(i.Error),g();else{let x={token:i.Token,resp:i},s=await yt.default.post(`${De}api/v1/gateway/update/token/${e}`,x);if(console.log(s,"jkdvfhsdjkhf"),(s==null?void 0:s.status)==200){let T={Token:(k=(v=s==null?void 0:s.data)==null?void 0:v.data)==null?void 0:k.gateway_token,Brand:i.Brand,ExpirationMonth:i.ExpirationMonth,ExpirationYear:i.ExpirationYear,Last4:i.Last4,Bin:i.Bin,CVV:i.CVV};console.log(T,"respspsp"),f(T)}}},be=async()=>{var i,v,k,x,s,T,y,$,W,Q;try{let H={method:"POST",redirect:"follow"},J=await yt.default.post(`${De}api/v1/widget/generate-session`,H),me=Number(l==null?void 0:l.expiryYear)%100,C=`${(i=l==null?void 0:l.cardNumber)==null?void 0:i.replace(/\s+/g,"")}=${me}${l==null?void 0:l.expiryMonth} ${l==null?void 0:l.cvv}`,R=forge.pki.publicKeyFromPem((k=(v=J==null?void 0:J.data)==null?void 0:v.data)==null?void 0:k.publicKeyPem).encrypt(C,"RSA-OAEP",{md:forge.md.sha1.create(),mgf1:{md:forge.md.sha1.create()}}),ve=forge.util.encode64(R),it={"Content-Type":"application/json","x-app-session-key":(s=(x=J.data)==null?void 0:x.data)==null?void 0:s.session_key},at=JSON.stringify({enc_track2_data:ve,algorithm:"RSAES_OAEP_SHA_1",session_key:(y=(T=J==null?void 0:J.data)==null?void 0:T.data)==null?void 0:y.session_key}),Be=await yt.default.post(`${lt}tokenizer/tokenize`,at,{headers:it});if(console.log(Be,"tokeni"),(Be==null?void 0:Be.status)==200){let Re=(W=($=Be==null?void 0:Be.data)==null?void 0:$.data)==null?void 0:W.token;try{let qe=await yt.default.post(`${De}api/v1/gateway/verify-and-save/${e}`,{token:Re});if(console.log(qe,"verifyandsaveresp"),(qe==null?void 0:qe.status)==200){let He=(Q=qe==null?void 0:qe.data)==null?void 0:Q.data,b={Token:He.gateway_token,Brand:He.card_data.brand,ExpirationMonth:He.card_data.expire_mm,ExpirationYear:He.card_data.expire_yy,Last4:He.card_data.last4,Bin:He.card_data.bin};f(b)}}catch(qe){console.log(qe,"error")}}}catch(H){console.log(H,"eroror")}},z=async i=>{var x,s,T,y,$,W,Q;if(i.preventDefault(),!(Se()||!Le()))try{let H=await yt.default.get(`${De}api/v1/gateway/token/${e}`);if((H==null?void 0:H.status)==200){let J=(s=(x=H==null?void 0:H.data)==null?void 0:x.data)==null?void 0:s.gateway_token;((y=(T=H==null?void 0:H.data)==null?void 0:T.data)==null?void 0:y.paymentGateway)==(($=dn)==null?void 0:$.FRACTALKEY)?await be():DatacapWebToken.requestToken(J,"creditCardForm",r)}}catch(H){console.log(H,"svuiuhd"),h(((Q=(W=H==null?void 0:H.response)==null?void 0:W.data)==null?void 0:Q.message)||"Something went wrong!")}};console.log(l,"uifgudasgf",N);let Ce=()=>{h("")},A=()=>{h(""),ke({firstName:"",lastName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",zipCode:""}),K()};return _.default.createElement(_.default.Fragment,null,_.default.createElement(st,null),_.default.createElement(Yt,null),_.default.createElement(Ue,{loading:S}),V&&_.default.createElement("div",{style:{maxHeight:"606px",minHeight:"60vh",padding:"40px"}},_.default.createElement(mt,{error:V,onClose:Ce})),!V&&_.default.createElement("div",{className:"creditformbox"},_.default.createElement("form",{id:"creditCardForm",onSubmit:z},_.default.createElement("div",{className:"name-row"},_.default.createElement("div",{className:"form-group"},_.default.createElement("label",null," First Name ",_.default.createElement("span",{className:"text-danger"},"*")),_.default.createElement("input",{type:"text",name:"first_name",placeholder:"First Name",value:(l==null?void 0:l.firstName)||"",onChange:i=>d("firstName",i.target.value)}),(N==null?void 0:N.firstName)&&_.default.createElement("small",{className:"error"},N==null?void 0:N.firstName)),_.default.createElement("div",{className:"form-group"},_.default.createElement("label",null," Last Name ",_.default.createElement("span",{className:"text-danger"},"*")),_.default.createElement("input",{type:"text",name:"last_name",placeholder:"Last Name",value:(l==null?void 0:l.lastName)||"",onChange:i=>d("lastName",i.target.value)}),(N==null?void 0:N.lastName)&&_.default.createElement("small",{className:"error"},N==null?void 0:N.lastName))),_.default.createElement("div",{className:"form-pay-row"},_.default.createElement("div",{className:"form-group"},_.default.createElement("label",null," Card Number ",_.default.createElement("span",{className:"text-danger"},"*")),_.default.createElement("input",{type:"text","data-token":"card_number",placeholder:"Card Number",maxLength:19,inputMode:"numeric",value:(l==null?void 0:l.cardNumber)||"",onChange:i=>_e(i)}),(N==null?void 0:N.cardNumber)&&_.default.createElement("small",{className:"error"},N==null?void 0:N.cardNumber))),_.default.createElement("div",{className:"card-pay-row"},_.default.createElement("div",{className:"form-group"},_.default.createElement("label",null," Exp Month ",_.default.createElement("span",{className:"text-danger"},"*")),_.default.createElement("input",{type:"text","data-token":"exp_month",placeholder:"MM",maxLength:2,value:(l==null?void 0:l.expiryMonth)||"",onChange:i=>d("expiryMonth",i.target.value)}),(N==null?void 0:N.expiryMonth)&&_.default.createElement("small",{className:"error"},N==null?void 0:N.expiryMonth)),_.default.createElement("div",{className:"form-group"},_.default.createElement("label",null," Exp Year ",_.default.createElement("span",{className:"text-danger"},"*")),_.default.createElement("input",{type:"text","data-token":"exp_year",placeholder:"YYYY",maxLength:4,value:(l==null?void 0:l.expiryYear)||"",onChange:i=>d("expiryYear",i.target.value)}),(N==null?void 0:N.expiryYear)&&_.default.createElement("small",{className:"error"},N==null?void 0:N.expiryYear)),_.default.createElement("div",{className:"form-group"},_.default.createElement("label",null," CVV ",_.default.createElement("span",{className:"text-danger"},"*")),_.default.createElement("input",{type:"text","data-token":"cvv",placeholder:"CVV",maxLength:4,value:(l==null?void 0:l.cvv)||"",onChange:i=>d("cvv",i.target.value)}),(N==null?void 0:N.cvv)&&_.default.createElement("small",{className:"error"},N==null?void 0:N.cvv)),_.default.createElement("div",{className:"form-group"},_.default.createElement("label",null," Zip ",_.default.createElement("span",{className:"text-danger"},"*")),_.default.createElement("input",{type:"text",name:"zipcode",placeholder:"Zip Code",value:(Me=l==null?void 0:l.zipCode)!=null?Me:"",onChange:i=>d("zipCode",i.target.value)}),(N==null?void 0:N.zipCode)&&_.default.createElement("small",{className:"error"},N==null?void 0:N.zipCode))),_.default.createElement("div",{className:"button-row"},_.default.createElement("button",{className:"cancelbtn",onClick:A},"Cancel"),_.default.createElement("button",{className:"savebtn",type:"submit"},"Save")))))}0&&(module.exports={AddCard,AddCardSky,GetPaymentPage,PreAuthPayment,RequestPayment,RequestPreAuthPayment});
package/dist/index.mjs CHANGED
@@ -1819,7 +1819,7 @@ var tn=Object.defineProperty,nn=Object.defineProperties;var an=Object.getOwnProp
1819
1819
  @import url("https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700;800;900&display=swap");
1820
1820
 
1821
1821
  .creditformbox {
1822
- max-width: 550px;
1822
+ // max-width: 550px;
1823
1823
  margin: 0 auto;
1824
1824
  font-family: Poppins !important;
1825
1825
  }
@@ -1901,34 +1901,34 @@ var tn=Object.defineProperty,nn=Object.defineProperties;var an=Object.getOwnProp
1901
1901
  margin-top:20px;
1902
1902
  }
1903
1903
 
1904
- .btn.btn-dark {
1904
+ .cancelbtn {
1905
1905
  font-size:15px;
1906
- color: #000000;
1907
- background-color: transparent;
1908
- border:1px solid #000000;
1906
+ color: #000000 !important;
1907
+ background-color: transparent !important;
1908
+ border:1px solid #000000 !important;
1909
1909
  border-radius: 10px !important;
1910
1910
  padding: 14px 25px !important;
1911
1911
  cursor:pointer;
1912
1912
  font-size: 16px;
1913
1913
  }
1914
- .btn.btn-dark:hover {
1915
- background:#000000;
1916
- color:#ffffff;
1914
+ .cancelbtn:hover {
1915
+ background:#000000 !important;
1916
+ color:#ffffff !important;
1917
1917
  }
1918
1918
 
1919
- .btn.btn-blue {
1919
+ .savebtn {
1920
1920
  font-size:15px;
1921
- color: #2979FF;
1922
- background-color: transparent;
1923
- border:1px solid #2979FF;
1921
+ color: #2979FF !important;
1922
+ background-color: transparent !important;
1923
+ border:1px solid #2979FF !important;
1924
1924
  border-radius: 10px !important;
1925
1925
  padding: 14px 25px !important;
1926
1926
  cursor:pointer;
1927
1927
  font-size: 16px;
1928
1928
  }
1929
- .btn.btn-blue:hover {
1930
- background:#2979FF;
1931
- color:#ffffff;
1929
+ .savebtn:hover {
1930
+ background:#2979FF !important;
1931
+ color:#ffffff !important;
1932
1932
  }
1933
1933
 
1934
- `)}function $n({session_token:e,callback:v,isloading:T,onCancel:O}){var Me;let[A,Pe]=Pt(!1),[l,ke]=Pt(),[N,o]=Pt({}),[V,g]=Pt(""),D=()=>Pe(!0),c=()=>Pe(!1),Se=()=>{var s,Y,h,B,W,Q,H,J;let i={},b=l,k=parseInt((b==null?void 0:b.expiryMonth)||"",10),y=(b==null?void 0:b.expiryYear)||"";return(s=b==null?void 0:b.firstName)!=null&&s.trim()||(i.firstName="Please enter a first name."),(Y=b==null?void 0:b.lastName)!=null&&Y.trim()||(i.lastName="Please enter a last name."),(h=b==null?void 0:b.cardNumber)!=null&&h.trim()||(i.cardNumber="Please enter a card number."),(B=b==null?void 0:b.expiryMonth)!=null&&B.trim()?(Number(b==null?void 0:b.expiryMonth)>12||Number(b==null?void 0:b.expiryMonth)<1)&&(i.expiryMonth="Invalid Expiration Month."):i.expiryMonth="Please enter an expiry month.",(W=b==null?void 0:b.expiryYear)!=null&&W.trim()?((Q=b==null?void 0:b.expiryYear)==null?void 0:Q.trim().length)!==4||Number(b==null?void 0:b.expiryYear)<2025?i.expiryYear="Invalid Expiration Year.":(isNaN(k)||k<1||k>12||y.length!==4)&&(i.expiryMonth="Invalid Expiration Date."):i.expiryYear="Please enter an expiry year.",(H=b==null?void 0:b.cvv)!=null&&H.trim()||(i.cvv="Please enter a CVV."),(J=b==null?void 0:b.zipCode)!=null&&J.trim()||(i.zipCode="Please enter a zip code."),o(i),Object.keys(i).length>0},_e=i=>{let k=i.target.value.replace(/\D/g,""),y="";/^3[47]/.test(k)?y=k.slice(0,15).replace(/^(\d{1,4})(\d{1,6})?(\d{1,5})?$/,(Y,h,B,W)=>[h,B,W].filter(Boolean).join(" ")):y=k.slice(0,16).replace(/^(\d{1,4})(\d{1,4})?(\d{1,4})?(\d{1,4})?$/,(Y,h,B,W,Q)=>[h,B,W,Q].filter(Boolean).join(" ")),o(s=>M(_({},s),{cardNumber:""})),ke(s=>M(_({},s),{cardNumber:y}))},d=(i,b)=>{let k=i;if(["expiryMonth","expiryYear","zipCode","cvv"].includes(k)){(b===""||/^[0-9]+$/.test(b))&&(o(s=>M(_({},s),{[k]:""})),ke(s=>M(_({},s),{[k]:b})));return}o(s=>M(_({},s),{[k]:""})),console.log(b,k),ke(s=>M(_({},s),{[k]:b}))},Le=()=>{let i=DatacapWebToken.validateCardNumber(l==null?void 0:l.cardNumber.replaceAll(" ","")),b=DatacapWebToken.validateExpirationDate(l==null?void 0:l.expiryMonth,l==null?void 0:l.expiryYear),k=DatacapWebToken.validateCVV(l==null?void 0:l.cvv),y={};return i||(y.cardNumber="Invalid card Number"),b||(y.expiryMonth="Invalid Expiration Date."),k||(y.cvv="Invalid CVV"),o(y),i&&k&&b},r=async i=>{var b,k;if(i.Error)console.log(i==null?void 0:i.Error),g(i.Error),c();else{let y={token:i.Token,resp:i},s=await kt.post(`${Re}api/v1/gateway/update/token/${e}`,y);if(console.log(s,"jkdvfhsdjkhf"),(s==null?void 0:s.status)==200){let Y={Token:(k=(b=s==null?void 0:s.data)==null?void 0:b.data)==null?void 0:k.gateway_token,Brand:i.Brand,ExpirationMonth:i.ExpirationMonth,ExpirationYear:i.ExpirationYear,Last4:i.Last4,Bin:i.Bin,CVV:i.CVV};console.log(Y,"respspsp"),v(Y)}}},be=async()=>{var i,b,k,y,s,Y,h,B,W,Q;try{let H={method:"POST",redirect:"follow"},J=await kt.post(`${Re}api/v1/widget/generate-session`,H),me=Number(l==null?void 0:l.expiryYear)%100,C=`${(i=l==null?void 0:l.cardNumber)==null?void 0:i.replace(/\s+/g,"")}=${me}${l==null?void 0:l.expiryMonth} ${l==null?void 0:l.cvv}`,R=forge.pki.publicKeyFromPem((k=(b=J==null?void 0:J.data)==null?void 0:b.data)==null?void 0:k.publicKeyPem).encrypt(C,"RSA-OAEP",{md:forge.md.sha1.create(),mgf1:{md:forge.md.sha1.create()}}),ve=forge.util.encode64(R),at={"Content-Type":"application/json","x-app-session-key":(s=(y=J.data)==null?void 0:y.data)==null?void 0:s.session_key},ot=JSON.stringify({enc_track2_data:ve,algorithm:"RSAES_OAEP_SHA_1",session_key:(h=(Y=J==null?void 0:J.data)==null?void 0:Y.data)==null?void 0:h.session_key}),Be=await kt.post(`${mt}tokenizer/tokenize`,ot,{headers:at});if(console.log(Be,"tokeni"),(Be==null?void 0:Be.status)==200){let tt=(W=(B=Be==null?void 0:Be.data)==null?void 0:B.data)==null?void 0:W.token;try{let qe=await kt.post(`${Re}api/v1/gateway/verify-and-save/${e}`,{token:tt});if(console.log(qe,"verifyandsaveresp"),(qe==null?void 0:qe.status)==200){let Ke=(Q=qe==null?void 0:qe.data)==null?void 0:Q.data,x={Token:Ke.gateway_token,Brand:Ke.card_data.brand,ExpirationMonth:Ke.card_data.expire_mm,ExpirationYear:Ke.card_data.expire_yy,Last4:Ke.card_data.last4,Bin:Ke.card_data.bin};v(x)}}catch(qe){console.log(qe,"error")}}}catch(H){console.log(H,"eroror")}},F=async i=>{var y,s,Y,h,B,W,Q;if(i.preventDefault(),!(Se()||!Le()))try{let H=await kt.get(`${Re}api/v1/gateway/token/${e}`);if((H==null?void 0:H.status)==200){let J=(s=(y=H==null?void 0:H.data)==null?void 0:y.data)==null?void 0:s.gateway_token;((h=(Y=H==null?void 0:H.data)==null?void 0:Y.data)==null?void 0:h.paymentGateway)==((B=Gt)==null?void 0:B.FRACTALKEY)?await be():DatacapWebToken.requestToken(J,"creditCardForm",r)}}catch(H){console.log(H,"svuiuhd"),g(((Q=(W=H==null?void 0:H.response)==null?void 0:W.data)==null?void 0:Q.message)||"Something went wrong!")}};console.log(l,"uifgudasgf",N);let Ce=()=>{g("")},z=()=>{g(""),ke({firstName:"",lastName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",zipCode:""}),O()};return S.createElement(S.Fragment,null,S.createElement(dt,null),S.createElement(Bt,null),S.createElement(Xe,{loading:A}),V&&S.createElement("div",{style:{maxHeight:"606px",minHeight:"60vh",padding:"40px"}},S.createElement(ut,{error:V,onClose:Ce})),!V&&S.createElement("div",{className:"creditformbox"},S.createElement("form",{id:"creditCardForm",onSubmit:F},S.createElement("div",{className:"name-row"},S.createElement("div",{className:"form-group"},S.createElement("label",null," First Name ",S.createElement("span",{className:"text-danger"},"*")),S.createElement("input",{type:"text",name:"first_name",placeholder:"First Name",value:(l==null?void 0:l.firstName)||"",onChange:i=>d("firstName",i.target.value)}),(N==null?void 0:N.firstName)&&S.createElement("small",{className:"error"},N==null?void 0:N.firstName)),S.createElement("div",{className:"form-group"},S.createElement("label",null," Last Name ",S.createElement("span",{className:"text-danger"},"*")),S.createElement("input",{type:"text",name:"last_name",placeholder:"Last Name",value:(l==null?void 0:l.lastName)||"",onChange:i=>d("lastName",i.target.value)}),(N==null?void 0:N.lastName)&&S.createElement("small",{className:"error"},N==null?void 0:N.lastName))),S.createElement("div",{className:"form-pay-row"},S.createElement("div",{className:"form-group"},S.createElement("label",null," Card Number ",S.createElement("span",{className:"text-danger"},"*")),S.createElement("input",{type:"text","data-token":"card_number",placeholder:"Card Number",maxLength:19,inputMode:"numeric",value:(l==null?void 0:l.cardNumber)||"",onChange:i=>_e(i)}),(N==null?void 0:N.cardNumber)&&S.createElement("small",{className:"error"},N==null?void 0:N.cardNumber))),S.createElement("div",{className:"card-pay-row"},S.createElement("div",{className:"form-group"},S.createElement("label",null," Exp Month ",S.createElement("span",{className:"text-danger"},"*")),S.createElement("input",{type:"text","data-token":"exp_month",placeholder:"MM",maxLength:2,value:(l==null?void 0:l.expiryMonth)||"",onChange:i=>d("expiryMonth",i.target.value)}),(N==null?void 0:N.expiryMonth)&&S.createElement("small",{className:"error"},N==null?void 0:N.expiryMonth)),S.createElement("div",{className:"form-group"},S.createElement("label",null," Exp Year ",S.createElement("span",{className:"text-danger"},"*")),S.createElement("input",{type:"text","data-token":"exp_year",placeholder:"YYYY",maxLength:4,value:(l==null?void 0:l.expiryYear)||"",onChange:i=>d("expiryYear",i.target.value)}),(N==null?void 0:N.expiryYear)&&S.createElement("small",{className:"error"},N==null?void 0:N.expiryYear)),S.createElement("div",{className:"form-group"},S.createElement("label",null," CVV ",S.createElement("span",{className:"text-danger"},"*")),S.createElement("input",{type:"text","data-token":"cvv",placeholder:"CVV",maxLength:4,value:(l==null?void 0:l.cvv)||"",onChange:i=>d("cvv",i.target.value)}),(N==null?void 0:N.cvv)&&S.createElement("small",{className:"error"},N==null?void 0:N.cvv)),S.createElement("div",{className:"form-group"},S.createElement("label",null," Zip ",S.createElement("span",{className:"text-danger"},"*")),S.createElement("input",{type:"text",name:"zipcode",placeholder:"Zip Code",value:(Me=l==null?void 0:l.zipCode)!=null?Me:"",onChange:i=>d("zipCode",i.target.value)}),(N==null?void 0:N.zipCode)&&S.createElement("small",{className:"error"},N==null?void 0:N.zipCode))),S.createElement("div",{className:"button-row"},S.createElement("button",{className:"btn btn-dark",onClick:z},"Cancel"),S.createElement("button",{className:"btn btn-blue",type:"submit"},"Save")))))}export{Bn as AddCard,$n as AddCardSky,Pn as GetPaymentPage,Ln as PreAuthPayment,hn as RequestPayment,vn as RequestPreAuthPayment};
1934
+ `)}function $n({session_token:e,callback:v,isloading:T,onCancel:O}){var Me;let[A,Pe]=Pt(!1),[l,ke]=Pt(),[N,o]=Pt({}),[V,g]=Pt(""),D=()=>Pe(!0),c=()=>Pe(!1),Se=()=>{var s,Y,h,B,W,Q,H,J;let i={},b=l,k=parseInt((b==null?void 0:b.expiryMonth)||"",10),y=(b==null?void 0:b.expiryYear)||"";return(s=b==null?void 0:b.firstName)!=null&&s.trim()||(i.firstName="Please enter a first name."),(Y=b==null?void 0:b.lastName)!=null&&Y.trim()||(i.lastName="Please enter a last name."),(h=b==null?void 0:b.cardNumber)!=null&&h.trim()||(i.cardNumber="Please enter a card number."),(B=b==null?void 0:b.expiryMonth)!=null&&B.trim()?(Number(b==null?void 0:b.expiryMonth)>12||Number(b==null?void 0:b.expiryMonth)<1)&&(i.expiryMonth="Invalid Expiration Month."):i.expiryMonth="Please enter an expiry month.",(W=b==null?void 0:b.expiryYear)!=null&&W.trim()?((Q=b==null?void 0:b.expiryYear)==null?void 0:Q.trim().length)!==4||Number(b==null?void 0:b.expiryYear)<2025?i.expiryYear="Invalid Expiration Year.":(isNaN(k)||k<1||k>12||y.length!==4)&&(i.expiryMonth="Invalid Expiration Date."):i.expiryYear="Please enter an expiry year.",(H=b==null?void 0:b.cvv)!=null&&H.trim()||(i.cvv="Please enter a CVV."),(J=b==null?void 0:b.zipCode)!=null&&J.trim()||(i.zipCode="Please enter a zip code."),o(i),Object.keys(i).length>0},_e=i=>{let k=i.target.value.replace(/\D/g,""),y="";/^3[47]/.test(k)?y=k.slice(0,15).replace(/^(\d{1,4})(\d{1,6})?(\d{1,5})?$/,(Y,h,B,W)=>[h,B,W].filter(Boolean).join(" ")):y=k.slice(0,16).replace(/^(\d{1,4})(\d{1,4})?(\d{1,4})?(\d{1,4})?$/,(Y,h,B,W,Q)=>[h,B,W,Q].filter(Boolean).join(" ")),o(s=>M(_({},s),{cardNumber:""})),ke(s=>M(_({},s),{cardNumber:y}))},d=(i,b)=>{let k=i;if(["expiryMonth","expiryYear","zipCode","cvv"].includes(k)){(b===""||/^[0-9]+$/.test(b))&&(o(s=>M(_({},s),{[k]:""})),ke(s=>M(_({},s),{[k]:b})));return}o(s=>M(_({},s),{[k]:""})),console.log(b,k),ke(s=>M(_({},s),{[k]:b}))},Le=()=>{let i=DatacapWebToken.validateCardNumber(l==null?void 0:l.cardNumber.replaceAll(" ","")),b=DatacapWebToken.validateExpirationDate(l==null?void 0:l.expiryMonth,l==null?void 0:l.expiryYear),k=DatacapWebToken.validateCVV(l==null?void 0:l.cvv),y={};return i||(y.cardNumber="Invalid card Number"),b||(y.expiryMonth="Invalid Expiration Date."),k||(y.cvv="Invalid CVV"),o(y),i&&k&&b},r=async i=>{var b,k;if(i.Error)console.log(i==null?void 0:i.Error),g(i.Error),c();else{let y={token:i.Token,resp:i},s=await kt.post(`${Re}api/v1/gateway/update/token/${e}`,y);if(console.log(s,"jkdvfhsdjkhf"),(s==null?void 0:s.status)==200){let Y={Token:(k=(b=s==null?void 0:s.data)==null?void 0:b.data)==null?void 0:k.gateway_token,Brand:i.Brand,ExpirationMonth:i.ExpirationMonth,ExpirationYear:i.ExpirationYear,Last4:i.Last4,Bin:i.Bin,CVV:i.CVV};console.log(Y,"respspsp"),v(Y)}}},be=async()=>{var i,b,k,y,s,Y,h,B,W,Q;try{let H={method:"POST",redirect:"follow"},J=await kt.post(`${Re}api/v1/widget/generate-session`,H),me=Number(l==null?void 0:l.expiryYear)%100,C=`${(i=l==null?void 0:l.cardNumber)==null?void 0:i.replace(/\s+/g,"")}=${me}${l==null?void 0:l.expiryMonth} ${l==null?void 0:l.cvv}`,R=forge.pki.publicKeyFromPem((k=(b=J==null?void 0:J.data)==null?void 0:b.data)==null?void 0:k.publicKeyPem).encrypt(C,"RSA-OAEP",{md:forge.md.sha1.create(),mgf1:{md:forge.md.sha1.create()}}),ve=forge.util.encode64(R),at={"Content-Type":"application/json","x-app-session-key":(s=(y=J.data)==null?void 0:y.data)==null?void 0:s.session_key},ot=JSON.stringify({enc_track2_data:ve,algorithm:"RSAES_OAEP_SHA_1",session_key:(h=(Y=J==null?void 0:J.data)==null?void 0:Y.data)==null?void 0:h.session_key}),Be=await kt.post(`${mt}tokenizer/tokenize`,ot,{headers:at});if(console.log(Be,"tokeni"),(Be==null?void 0:Be.status)==200){let tt=(W=(B=Be==null?void 0:Be.data)==null?void 0:B.data)==null?void 0:W.token;try{let qe=await kt.post(`${Re}api/v1/gateway/verify-and-save/${e}`,{token:tt});if(console.log(qe,"verifyandsaveresp"),(qe==null?void 0:qe.status)==200){let Ke=(Q=qe==null?void 0:qe.data)==null?void 0:Q.data,x={Token:Ke.gateway_token,Brand:Ke.card_data.brand,ExpirationMonth:Ke.card_data.expire_mm,ExpirationYear:Ke.card_data.expire_yy,Last4:Ke.card_data.last4,Bin:Ke.card_data.bin};v(x)}}catch(qe){console.log(qe,"error")}}}catch(H){console.log(H,"eroror")}},F=async i=>{var y,s,Y,h,B,W,Q;if(i.preventDefault(),!(Se()||!Le()))try{let H=await kt.get(`${Re}api/v1/gateway/token/${e}`);if((H==null?void 0:H.status)==200){let J=(s=(y=H==null?void 0:H.data)==null?void 0:y.data)==null?void 0:s.gateway_token;((h=(Y=H==null?void 0:H.data)==null?void 0:Y.data)==null?void 0:h.paymentGateway)==((B=Gt)==null?void 0:B.FRACTALKEY)?await be():DatacapWebToken.requestToken(J,"creditCardForm",r)}}catch(H){console.log(H,"svuiuhd"),g(((Q=(W=H==null?void 0:H.response)==null?void 0:W.data)==null?void 0:Q.message)||"Something went wrong!")}};console.log(l,"uifgudasgf",N);let Ce=()=>{g("")},z=()=>{g(""),ke({firstName:"",lastName:"",cardNumber:"",expiryMonth:"",expiryYear:"",cvv:"",zipCode:""}),O()};return S.createElement(S.Fragment,null,S.createElement(dt,null),S.createElement(Bt,null),S.createElement(Xe,{loading:A}),V&&S.createElement("div",{style:{maxHeight:"606px",minHeight:"60vh",padding:"40px"}},S.createElement(ut,{error:V,onClose:Ce})),!V&&S.createElement("div",{className:"creditformbox"},S.createElement("form",{id:"creditCardForm",onSubmit:F},S.createElement("div",{className:"name-row"},S.createElement("div",{className:"form-group"},S.createElement("label",null," First Name ",S.createElement("span",{className:"text-danger"},"*")),S.createElement("input",{type:"text",name:"first_name",placeholder:"First Name",value:(l==null?void 0:l.firstName)||"",onChange:i=>d("firstName",i.target.value)}),(N==null?void 0:N.firstName)&&S.createElement("small",{className:"error"},N==null?void 0:N.firstName)),S.createElement("div",{className:"form-group"},S.createElement("label",null," Last Name ",S.createElement("span",{className:"text-danger"},"*")),S.createElement("input",{type:"text",name:"last_name",placeholder:"Last Name",value:(l==null?void 0:l.lastName)||"",onChange:i=>d("lastName",i.target.value)}),(N==null?void 0:N.lastName)&&S.createElement("small",{className:"error"},N==null?void 0:N.lastName))),S.createElement("div",{className:"form-pay-row"},S.createElement("div",{className:"form-group"},S.createElement("label",null," Card Number ",S.createElement("span",{className:"text-danger"},"*")),S.createElement("input",{type:"text","data-token":"card_number",placeholder:"Card Number",maxLength:19,inputMode:"numeric",value:(l==null?void 0:l.cardNumber)||"",onChange:i=>_e(i)}),(N==null?void 0:N.cardNumber)&&S.createElement("small",{className:"error"},N==null?void 0:N.cardNumber))),S.createElement("div",{className:"card-pay-row"},S.createElement("div",{className:"form-group"},S.createElement("label",null," Exp Month ",S.createElement("span",{className:"text-danger"},"*")),S.createElement("input",{type:"text","data-token":"exp_month",placeholder:"MM",maxLength:2,value:(l==null?void 0:l.expiryMonth)||"",onChange:i=>d("expiryMonth",i.target.value)}),(N==null?void 0:N.expiryMonth)&&S.createElement("small",{className:"error"},N==null?void 0:N.expiryMonth)),S.createElement("div",{className:"form-group"},S.createElement("label",null," Exp Year ",S.createElement("span",{className:"text-danger"},"*")),S.createElement("input",{type:"text","data-token":"exp_year",placeholder:"YYYY",maxLength:4,value:(l==null?void 0:l.expiryYear)||"",onChange:i=>d("expiryYear",i.target.value)}),(N==null?void 0:N.expiryYear)&&S.createElement("small",{className:"error"},N==null?void 0:N.expiryYear)),S.createElement("div",{className:"form-group"},S.createElement("label",null," CVV ",S.createElement("span",{className:"text-danger"},"*")),S.createElement("input",{type:"text","data-token":"cvv",placeholder:"CVV",maxLength:4,value:(l==null?void 0:l.cvv)||"",onChange:i=>d("cvv",i.target.value)}),(N==null?void 0:N.cvv)&&S.createElement("small",{className:"error"},N==null?void 0:N.cvv)),S.createElement("div",{className:"form-group"},S.createElement("label",null," Zip ",S.createElement("span",{className:"text-danger"},"*")),S.createElement("input",{type:"text",name:"zipcode",placeholder:"Zip Code",value:(Me=l==null?void 0:l.zipCode)!=null?Me:"",onChange:i=>d("zipCode",i.target.value)}),(N==null?void 0:N.zipCode)&&S.createElement("small",{className:"error"},N==null?void 0:N.zipCode))),S.createElement("div",{className:"button-row"},S.createElement("button",{className:"cancelbtn",onClick:z},"Cancel"),S.createElement("button",{className:"savebtn",type:"submit"},"Save")))))}export{Bn as AddCard,$n as AddCardSky,Pn as GetPaymentPage,Ln as PreAuthPayment,hn as RequestPayment,vn as RequestPreAuthPayment};
package/next-env.d.ts CHANGED
@@ -2,4 +2,4 @@
2
2
  /// <reference types="next/image-types/global" />
3
3
 
4
4
  // NOTE: This file should not be edited
5
- // see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.
5
+ // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fractalpay/fractalpay-next-dev",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "next dev -p 4001",
@@ -15,13 +15,10 @@
15
15
  "bootstrap": "^5.3.3",
16
16
  "credit-card-type": "^10.0.1",
17
17
  "formik": "^2.4.6",
18
- "next": "15.0.3",
19
18
  "node-forge": "^1.3.1",
20
- "react": "18.3.1",
21
19
  "react-bootstrap": "^2.10.5",
22
20
  "react-bs-datatable": "^3.15.0",
23
21
  "react-datepicker": "^7.5.0",
24
- "react-dom": "18.3.1",
25
22
  "react-icons": "^5.5.0",
26
23
  "react-number-format": "^5.4.3",
27
24
  "react-toastify": "^10.0.6",
@@ -32,10 +29,11 @@
32
29
  },
33
30
  "peerdependencies": {
34
31
  "next": "15.0.3",
35
- "react": "18.3.1",
36
- "react-dom": "18.3.1"
32
+ "react": ">=18.0.0 <20.0.0",
33
+ "react-dom": ">=18.0.0 <20.0.0"
37
34
  },
38
35
  "devDependencies": {
36
+ "@types/estree": "^1.0.8",
39
37
  "@types/node": "^20",
40
38
  "@types/node-forge": "^1.3.11",
41
39
  "@types/react": "^18",
@@ -44,8 +42,11 @@
44
42
  "credit-card-type": "^10.0.1",
45
43
  "eslint": "^8",
46
44
  "eslint-config-next": "15.0.3",
45
+ "next": "^15.0.3",
46
+ "react": "^18.3.1",
47
47
  "react-bs-datatable": "^3.15.0",
48
48
  "react-datepicker": "^7.5.0",
49
+ "react-dom": "^18.3.1",
49
50
  "react-toastify": "^10.0.6",
50
51
  "tsup": "^8.4.0",
51
52
  "typescript": "^5"
@@ -62,4 +63,4 @@
62
63
  "publishConfig": {
63
64
  "access": "public"
64
65
  }
65
- }
66
+ }