@bcc-code/payment-client 1.2.1 → 1.2.3
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/components/index.js +1 -1
- package/dist/components/index.mjs +150 -195
- package/dist/styles/adyen.css +1 -1
- package/package.json +1 -1
package/dist/components/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var S=Object.create;var P=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames;var B=Object.getPrototypeOf,K=Object.prototype.hasOwnProperty;var R=(l,m,i,t)=>{if(m&&typeof m=="object"||typeof m=="function")for(let o of V(m))!K.call(l,o)&&o!==i&&P(l,o,{get:()=>m[o],enumerable:!(t=w(m,o))||t.enumerable});return l};var C=(l,m,i)=>(i=l!=null?S(B(l)):{},R(m||!l||!l.__esModule?P(i,"default",{value:l,enumerable:!0}):i,l));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),A={class:"stripe-elements"},U={key:0,class:"elements-loading"},F={key:1,class:"elements-error"},I={key:2,class:"payment-button-container"},$=["disabled"],x=e.defineComponent({__name:"StripePayment",props:{paymentId:{},clientData:{default:void 0},clientKey:{default:void 0},amount:{},currency:{},publishableKey:{default:void 0},appearance:{default:void 0},showPayButton:{type:Boolean,default:!0},locale:{default:"en"},loader:{default:"auto"},returnUrl:{default:void 0}},emits:["submit","success","error","ready"],setup(l,{expose:m,emit:i}){const t=l,o=i,v=e.ref(),p=e.ref(!0),a=e.ref(!1),u=e.ref("");let y=null,b=null,f=null;const k=e.computed(()=>({EUR:"€",USD:"$",GBP:"£",CHF:"CHF",NOK:"kr",SEK:"kr",DKK:"kr",PLN:"zł",CZK:"Kč",HUF:"Ft"})[t.currency]||t.currency),E=e.computed(()=>t.amount.toFixed(2)),r=e.computed(()=>{if(t.clientData)try{const s=JSON.parse(t.clientData);return s.clientSecret||s.client_secret}catch{return}}),c=async()=>{if(!v.value)return;let s=t.publishableKey;if(!s&&t.clientData)try{const d=JSON.parse(t.clientData);s=d.publishableKey||d.publishable_key}catch{}if(!s){u.value="Publishable key is required",p.value=!1;return}try{p.value=!0,u.value="";const{loadStripe:d}=await import("@stripe/stripe-js");if(y=await d(s),!y)throw new Error("Failed to load Stripe");const n=r.value,D={appearance:t.appearance||{theme:"stripe",variables:{colorPrimary:"#0570de",colorBackground:"#ffffff",colorText:"#30313d",colorDanger:"#df1b41",fontFamily:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',spacingUnit:"4px",borderRadius:"4px"}},loader:t.loader,locale:t.locale};n&&(D.clientSecret=n),b=y.elements(D),f=b.create("payment",{layout:"tabs",defaultValues:{billingDetails:{name:"",email:"",phone:""}}}),f.mount(v.value),f.on("ready",()=>{p.value=!1,o("ready")}),f.on("change",N=>{N.error?(u.value=N.error.message,o("error",N.error)):u.value=""})}catch(d){u.value=d instanceof Error?d.message:"Failed to initialize payment form",p.value=!1,o("error",d)}},h=async()=>{if(!(!y||!f)){a.value=!0,u.value="";try{const s=t.returnUrl||`${window.location.origin}/payment/return`,{error:d,paymentIntent:n}=await y.confirmPayment({elements:b,confirmParams:{return_url:s},redirect:"if_required"});d?(u.value=d.message||"Payment failed",o("error",d)):n?n.status==="succeeded"?o("success",{paymentIntent:n,status:"succeeded",message:"Payment completed successfully!"}):n.status==="processing"?o("success",{paymentIntent:n,status:"processing",message:"Payment is being processed..."}):o("submit",{paymentIntent:n,status:n.status}):o("submit",f)}catch(s){u.value=s instanceof Error?s.message:"Payment failed",o("error",s)}finally{a.value=!1}}},g=()=>{f&&(f.destroy(),f=null),b&&(b=null),y&&(y=null)};return e.onMounted(()=>{c()}),e.onUnmounted(()=>{g()}),e.watch(()=>t.currency,()=>{g(),c()}),e.watch([()=>t.publishableKey,()=>t.clientData],()=>{(t.publishableKey||t.clientData)&&(g(),c())}),m({destroyElements:g}),(s,d)=>(e.openBlock(),e.createElementBlock("div",A,[e.createElementVNode("div",{ref_key:"elementsContainer",ref:v,class:"elements-container"},null,512),p.value?(e.openBlock(),e.createElementBlock("div",U,[...d[0]||(d[0]=[e.createElementVNode("div",{class:"loading-spinner"},null,-1),e.createElementVNode("p",null,"Loading payment form...",-1)])])):e.createCommentVNode("",!0),u.value?(e.openBlock(),e.createElementBlock("div",F,[d[1]||(d[1]=e.createElementVNode("div",{class:"error-icon"}," ⚠️ ",-1)),e.createElementVNode("p",null,e.toDisplayString(u.value),1),e.createElementVNode("button",{class:"retry-btn",onClick:c}," Retry ")])):e.createCommentVNode("",!0),l.showPayButton&&!p.value&&!u.value?(e.openBlock(),e.createElementBlock("div",I,[e.createElementVNode("button",{disabled:a.value,class:"payment-button",onClick:h},e.toDisplayString(a.value?"Processing...":`Pay ${k.value}${E.value}`),9,$)])):e.createCommentVNode("",!0)]))}}),_=(l,m)=>{const i=l.__vccOpts||l;for(const[t,o]of m)i[t]=o;return i},M=_(x,[["__scopeId","data-v-adbdf3c5"]]),O=e.defineComponent({__name:"AdyenPayment",props:{paymentId:{},clientData:{},clientKey:{},environment:{},amount:{},currency:{},paymentData:{},onCancel:{type:Function}},emits:["submit","additionalDetails","error","ready","success"],setup(l,{emit:m}){const i=l,t=m,o=e.ref(null),v=()=>{if(!i.clientData)return console.error("No clientData provided"),null;try{const a=JSON.parse(i.clientData);return console.log("Parsed Adyen session data:",a),{id:a.id,sessionData:a.sessionData,amount:a.amount,reference:a.reference,returnUrl:a.returnUrl,merchantAccount:a.merchantAccount}}catch(a){return console.error("Failed to parse clientData:",a),null}},p=async()=>{var u;if(!i.clientKey||!o.value){console.error("Initialization failed: Missing clientKey or container.");return}const a=v();if(!a){console.error("Failed to parse session data"),t("error",new Error("Failed to parse session data"));return}try{const{AdyenCheckout:y,Card:b,ApplePay:f,GooglePay:k,Klarna:E,Blik:r,Dropin:c}=await import("@adyen/adyen-web"),h={environment:i.environment||"test",clientKey:i.clientKey,session:a,onPaymentCompleted:(n,D)=>{console.info("Payment Completed:",n,D),t("submit",n),n.resultCode==="Authorised"||n.resultCode==="Received"?(console.info("Payment Successful:",n),t("success",{status:"succeeded",message:"Payment completed successfully",resultCode:n.resultCode,pspReference:n.pspReference,paymentData:n})):n.resultCode==="Pending"?(console.info("Payment Pending:",n),t("success",{status:"processing",message:"Payment is being processed",resultCode:n.resultCode,pspReference:n.pspReference,paymentData:n})):(n.resultCode==="Refused"||n.resultCode==="Error")&&(console.error("Payment Failed:",n),t("error",{message:n.refusalReason||"Payment was declined",resultCode:n.resultCode,paymentData:n}))},onError:(n,D)=>{console.error("Adyen Error:",n.name,n.message,n.stack,D),t("error",n)}},g={showPayButton:!0,paymentMethodComponents:[b,f,k,E,r],paymentMethodsConfiguration:{card:{hasHolderName:!0,holderNameRequired:!0,billingAddressRequired:!1,enableStoreDetails:!1},applePay:{showPayButton:!0},googlePay:{showPayButton:!0},klarna:{useKlarnaWidget:!0},blik:{}}},s=await y(h);console.log("Adyen Checkout created:",s),console.log("Available payment methods from session:",(u=s.paymentMethodsResponse)==null?void 0:u.paymentMethods);const d=new c(s,g);console.log("Adyen Drop-in created with session payment methods"),o.value&&(d.mount(o.value),console.log("Adyen Drop-in mounted successfully"),t("ready"))}catch(y){console.error("Error creating Adyen Drop-in:",y),t("error",y)}};return e.onMounted(()=>{p()}),e.watch(()=>i.clientData,()=>{o.value&&(o.value.innerHTML="",p())}),(a,u)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"dropinContainer",ref:o,class:"payment-dropin"},null,512))}}),H=_(O,[["__scopeId","data-v-ef2ec054"]]),T={class:"delayed-payment"},z={class:"payment-form"},L={class:"amount-display"},j={class:"amount-value"},q={key:0,class:"session-info"},J={key:0,class:"info-row"},G={class:"value"},W={key:1,class:"info-row"},X={class:"value"},Z={key:1,class:"error-message"},Q={class:"button-container"},Y=["disabled"],ee=e.defineComponent({__name:"DelayedPayment",props:{paymentId:{default:void 0},clientData:{default:void 0},amount:{},currency:{},tenantId:{default:void 0}},emits:["submit","success","error","ready"],setup(l,{expose:m,emit:i}){const t=l,o=i,v=e.ref(!1),p=e.ref(""),a=e.ref({}),u=e.computed(()=>({EUR:"€",USD:"$",GBP:"£",CHF:"CHF",NOK:"kr",SEK:"kr",DKK:"kr",PLN:"zł"})[t.currency]||t.currency),y=e.computed(()=>t.amount.toFixed(2)),b=e.computed(()=>a.value.transactionNumber&&a.value.confirmationUrl),f=()=>{if(!t.clientData){console.error("No clientData provided for delayed payment");return}try{const r=JSON.parse(t.clientData);console.log("Parsed delayed payment session data:",r),a.value={transactionNumber:r.transactionNumber,merchantReference:r.merchantReference,providerUid:r.providerUid,paymentId:r.paymentId,confirmationUrl:r.confirmationUrl},o("ready")}catch(r){console.error("Failed to parse clientData:",r),p.value="Invalid session data",o("error",r)}},k=async()=>{if(!(!b.value||v.value)){v.value=!0,p.value="";try{const r={provider:"delayed-payment",amount:t.amount,currency:t.currency,transactionNumber:a.value.transactionNumber,merchantReference:a.value.merchantReference,timestamp:new Date().toISOString()};if(o("submit",r),!a.value.confirmationUrl)throw new Error("Confirmation URL not provided");const c={"Content-Type":"application/json",Accept:"application/json"};t.tenantId&&(c["X-Tenant-ID"]=t.tenantId);const h=await fetch(a.value.confirmationUrl,{method:"POST",headers:c,credentials:"include"});if(!h.ok){const s=await h.json();throw new Error(s.message||"Failed to confirm payment")}const g=await h.json();o("success",{status:"succeeded",message:g.message,paymentId:g.paymentId,transactionNumber:a.value.transactionNumber})}catch(r){p.value=r instanceof Error?r.message:"Failed to confirm payment",o("error",r)}finally{v.value=!1}}},E=()=>{p.value=""};return e.onMounted(()=>{f()}),m({clearError:E}),(r,c)=>(e.openBlock(),e.createElementBlock("div",T,[e.createElementVNode("div",z,[c[4]||(c[4]=e.createElementVNode("div",{class:"info-section"},[e.createElementVNode("div",{class:"info-icon"}," 📄 "),e.createElementVNode("h3",{class:"info-title"}," Delayed Payment "),e.createElementVNode("p",{class:"info-description"}," Payment will be processed manually via invoice or bank transfer ")],-1)),e.createElementVNode("div",L,[c[0]||(c[0]=e.createElementVNode("span",{class:"amount-label"},"Amount to pay:",-1)),e.createElementVNode("span",j,e.toDisplayString(u.value)+e.toDisplayString(y.value),1)]),b.value?(e.openBlock(),e.createElementBlock("div",q,[a.value.transactionNumber?(e.openBlock(),e.createElementBlock("div",J,[c[1]||(c[1]=e.createElementVNode("span",{class:"label"},"Transaction Number:",-1)),e.createElementVNode("span",G,e.toDisplayString(a.value.transactionNumber),1)])):e.createCommentVNode("",!0),a.value.merchantReference?(e.openBlock(),e.createElementBlock("div",W,[c[2]||(c[2]=e.createElementVNode("span",{class:"label"},"Reference:",-1)),e.createElementVNode("span",X,e.toDisplayString(a.value.merchantReference),1)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("div",Z,[c[3]||(c[3]=e.createElementVNode("div",{class:"error-icon"}," ⚠️ ",-1)),e.createElementVNode("p",null,e.toDisplayString(p.value),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",Q,[e.createElementVNode("button",{disabled:v.value||!b.value,class:"submit-button",onClick:k},e.toDisplayString(v.value?"Processing...":`Confirm Payment ${u.value}${y.value}`),9,Y)])])]))}}),te=_(ee,[["__scopeId","data-v-ebc5d9c9"]]);exports.AdyenPayment=H;exports.DelayedPayment=te;exports.StripePayment=M;
|
|
1
|
+
"use strict";var N=Object.create;var S=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var K=Object.getPrototypeOf,U=Object.prototype.hasOwnProperty;var A=(o,d,s,t)=>{if(d&&typeof d=="object"||typeof d=="function")for(let a of B(d))!U.call(o,a)&&a!==s&&S(o,a,{get:()=>d[a],enumerable:!(t=w(d,a))||t.enumerable});return o};var E=(o,d,s)=>(s=o!=null?N(K(o)):{},A(d||!o||!o.__esModule?S(s,"default",{value:o,enumerable:!0}):s,o));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),R={class:"stripe-elements"},F={key:0,class:"elements-loading"},V={key:1,class:"elements-error"},x={key:2,class:"payment-button-container"},I=["disabled"],$=e.defineComponent({__name:"StripePayment",props:{paymentId:{},clientData:{default:void 0},clientKey:{default:void 0},amount:{},currency:{},publishableKey:{default:void 0},appearance:{default:void 0},showPayButton:{type:Boolean,default:!0},locale:{default:"en"},loader:{default:"auto"},returnUrl:{default:void 0}},emits:["submit","success","error","ready"],setup(o,{expose:d,emit:s}){const t=o,a=s,v=e.ref(),m=e.ref(!0),r=e.ref(!1),u=e.ref("");let p=null,b=null,y=null;const D=e.computed(()=>({EUR:"€",USD:"$",GBP:"£",CHF:"CHF",NOK:"kr",SEK:"kr",DKK:"kr",PLN:"zł",CZK:"Kč",HUF:"Ft"})[t.currency]||t.currency),P=e.computed(()=>t.amount.toFixed(2)),l=e.computed(()=>{if(t.clientData)try{const c=JSON.parse(t.clientData);return c.clientSecret||c.client_secret}catch{return}}),f=async()=>{if(!v.value)return;let c=t.publishableKey;if(!c&&t.clientData)try{const i=JSON.parse(t.clientData);c=i.publishableKey||i.publishable_key}catch{}if(!c){u.value="Publishable key is required",m.value=!1;return}try{m.value=!0,u.value="";const{loadStripe:i}=await import("@stripe/stripe-js");if(p=await i(c),!p)throw new Error("Failed to load Stripe");const n=l.value,h={appearance:t.appearance||{theme:"stripe",variables:{colorPrimary:"#0570de",colorBackground:"#ffffff",colorText:"#30313d",colorDanger:"#df1b41",fontFamily:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',spacingUnit:"4px",borderRadius:"4px"}},loader:t.loader,locale:t.locale};n&&(h.clientSecret=n),b=p.elements(h),y=b.create("payment",{layout:"tabs",defaultValues:{billingDetails:{name:"",email:"",phone:""}}}),y.mount(v.value),y.on("ready",()=>{m.value=!1,a("ready")}),y.on("change",C=>{C.error?(u.value=C.error.message,a("error",C.error)):u.value=""})}catch(i){u.value=i instanceof Error?i.message:"Failed to initialize payment form",m.value=!1,a("error",i)}},k=async()=>{if(!(!p||!y)){r.value=!0,u.value="";try{const c=t.returnUrl||`${window.location.origin}/payment/return`,{error:i,paymentIntent:n}=await p.confirmPayment({elements:b,confirmParams:{return_url:c},redirect:"if_required"});i?(u.value=i.message||"Payment failed",a("error",i)):n?n.status==="succeeded"?a("success",{paymentIntent:n,status:"succeeded",message:"Payment completed successfully!"}):n.status==="processing"?a("success",{paymentIntent:n,status:"processing",message:"Payment is being processed..."}):a("submit",{paymentIntent:n,status:n.status}):a("submit",y)}catch(c){u.value=c instanceof Error?c.message:"Payment failed",a("error",c)}finally{r.value=!1}}},g=()=>{y&&(y.destroy(),y=null),b&&(b=null),p&&(p=null)};return e.onMounted(()=>{f()}),e.onUnmounted(()=>{g()}),e.watch(()=>t.currency,()=>{g(),f()}),e.watch([()=>t.publishableKey,()=>t.clientData],()=>{(t.publishableKey||t.clientData)&&(g(),f())}),d({destroyElements:g}),(c,i)=>(e.openBlock(),e.createElementBlock("div",R,[e.createElementVNode("div",{ref_key:"elementsContainer",ref:v,class:"elements-container"},null,512),m.value?(e.openBlock(),e.createElementBlock("div",F,[...i[0]||(i[0]=[e.createElementVNode("div",{class:"loading-spinner"},null,-1),e.createElementVNode("p",null,"Loading payment form...",-1)])])):e.createCommentVNode("",!0),u.value?(e.openBlock(),e.createElementBlock("div",V,[i[1]||(i[1]=e.createElementVNode("div",{class:"error-icon"}," ⚠️ ",-1)),e.createElementVNode("p",null,e.toDisplayString(u.value),1),e.createElementVNode("button",{class:"retry-btn",onClick:f}," Retry ")])):e.createCommentVNode("",!0),o.showPayButton&&!m.value&&!u.value?(e.openBlock(),e.createElementBlock("div",x,[e.createElementVNode("button",{disabled:r.value,class:"payment-button",onClick:k},e.toDisplayString(r.value?"Processing...":`Pay ${D.value}${P.value}`),9,I)])):e.createCommentVNode("",!0)]))}}),_=(o,d)=>{const s=o.__vccOpts||o;for(const[t,a]of d)s[t]=a;return s},M=_($,[["__scopeId","data-v-adbdf3c5"]]),O=e.defineComponent({__name:"AdyenPayment",props:{paymentId:{},clientData:{},clientKey:{},environment:{},amount:{},currency:{},paymentData:{},onCancel:{type:Function}},emits:["submit","additionalDetails","error","ready","success"],setup(o,{emit:d}){const s=o,t=d,a=e.ref(null),v=()=>{if(!s.clientData)return console.error("No clientData provided"),null;try{const r=JSON.parse(s.clientData);return console.log("Parsed Adyen session data:",r),{id:r.id,sessionData:r.sessionData,amount:r.amount,reference:r.reference,returnUrl:r.returnUrl,merchantAccount:r.merchantAccount}}catch(r){return console.error("Failed to parse clientData:",r),null}},m=async()=>{var u;if(!s.clientKey||!a.value){console.error("Initialization failed: Missing clientKey or container.");return}const r=v();if(!r){console.error("Failed to parse session data"),t("error",new Error("Failed to parse session data"));return}try{const{AdyenCheckout:p,Card:b,ApplePay:y,GooglePay:D,Klarna:P,Blik:l,Dropin:f}=await import("@adyen/adyen-web"),k={environment:s.environment||"test",clientKey:s.clientKey,session:r,onPaymentCompleted:(n,h)=>{console.info("Payment Completed:",n,h),t("submit",n),n.resultCode==="Authorised"||n.resultCode==="Received"?(console.info("Payment Successful:",n),t("success",{status:"succeeded",message:"Payment completed successfully",resultCode:n.resultCode,pspReference:n.pspReference,paymentData:n})):n.resultCode==="Pending"?(console.info("Payment Pending:",n),t("success",{status:"processing",message:"Payment is being processed",resultCode:n.resultCode,pspReference:n.pspReference,paymentData:n})):(n.resultCode==="Refused"||n.resultCode==="Error")&&(console.error("Payment Failed:",n),t("error",{message:n.refusalReason||"Payment was declined",resultCode:n.resultCode,paymentData:n}))},onError:(n,h)=>{console.error("Adyen Error:",n.name,n.message,n.stack,h),t("error",n)}},g={showPayButton:!0,paymentMethodComponents:[b,y,D,P,l],paymentMethodsConfiguration:{card:{hasHolderName:!0,holderNameRequired:!0,billingAddressRequired:!1,enableStoreDetails:!1},applePay:{showPayButton:!0},googlePay:{showPayButton:!0},klarna:{useKlarnaWidget:!0},blik:{}}},c=await p(k);console.log("Adyen Checkout created:",c),console.log("Available payment methods from session:",(u=c.paymentMethodsResponse)==null?void 0:u.paymentMethods);const i=new f(c,g);console.log("Adyen Drop-in created with session payment methods"),a.value&&(i.mount(a.value),console.log("Adyen Drop-in mounted successfully"),t("ready"))}catch(p){console.error("Error creating Adyen Drop-in:",p),t("error",p)}};return e.onMounted(()=>{m()}),e.watch(()=>s.clientData,()=>{a.value&&(a.value.innerHTML="",m())}),(r,u)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"dropinContainer",ref:a,class:"payment-dropin"},null,512))}}),H=_(O,[["__scopeId","data-v-ef2ec054"]]),z={class:"delayed-payment-card"},q=["disabled"],L={key:0,class:"mt-2 text-sm text-red-600"},J=e.defineComponent({__name:"DelayedPayment",props:{amount:{},currency:{},clientData:{default:void 0},paymentId:{default:void 0},tenantId:{}},emits:["submit","success","error","ready"],setup(o,{expose:d,emit:s}){const t=o,a=s,v=e.ref(!1),m=e.ref(""),r=e.ref({}),u=e.computed(()=>({EUR:"€",USD:"$",GBP:"£",CHF:"CHF",NOK:"kr",SEK:"kr",DKK:"kr",PLN:"zł"})[t.currency]||t.currency),p=e.computed(()=>t.amount.toFixed(2)),b=e.computed(()=>r.value.transactionNumber&&r.value.providerUid),y=()=>{if(!t.clientData){console.error("No clientData provided for delayed payment");return}try{const l=JSON.parse(t.clientData);r.value={transactionNumber:l.transactionNumber,merchantReference:l.merchantReference,providerUid:l.providerUid,paymentUid:l.paymentUid},a("ready")}catch(l){m.value="Invalid session data",a("error",l)}},D=async()=>{if(!(!b.value||v.value)){v.value=!0,m.value="";try{const l={provider:"delayed-payment",amount:t.amount,currency:t.currency,transactionNumber:r.value.transactionNumber,merchantReference:r.value.merchantReference,providerUid:r.value.providerUid,timestamp:new Date().toISOString()};a("submit",l),await new Promise(f=>setTimeout(f,500)),a("success",{status:"succeeded",message:"Payment confirmed successfully. You will receive a receipt shortly.",resultCode:"Authorised",transactionNumber:r.value.transactionNumber,providerUid:r.value.providerUid,paymentData:l})}catch(l){m.value=l instanceof Error?l.message:"Failed to confirm payment",a("error",l)}finally{v.value=!1}}},P=()=>{m.value=""};return e.onMounted(()=>{y()}),d({clearError:P}),(l,f)=>(e.openBlock(),e.createElementBlock("div",z,[f[0]||(f[0]=e.createElementVNode("div",{class:"header-row"},[e.createElementVNode("span",{class:"header-icon"},"💳"),e.createElementVNode("span",{class:"header-title"},"Delayed payment")],-1)),f[1]||(f[1]=e.createElementVNode("div",{class:"header-description"}," Payment will be processed manually via invoice or bank transfer ",-1)),e.createElementVNode("button",{disabled:v.value||!b.value,class:"confirm-btn",onClick:D},e.toDisplayString(v.value?"Processing...":`Confirm payment ${p.value}${u.value}`),9,q),m.value?(e.openBlock(),e.createElementBlock("p",L,e.toDisplayString(m.value),1)):e.createCommentVNode("",!0)]))}}),T=_(J,[["__scopeId","data-v-1e02fd9c"]]);exports.AdyenPayment=H;exports.DelayedPayment=T;exports.StripePayment=M;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as A, ref as b, computed as C, onMounted as R, onUnmounted as x, watch as E, createElementBlock as g, openBlock as D, createElementVNode as y, createCommentVNode as w, toDisplayString as K } from "vue";
|
|
2
|
+
const B = { class: "stripe-elements" }, I = {
|
|
3
3
|
key: 0,
|
|
4
4
|
class: "elements-loading"
|
|
5
|
-
},
|
|
5
|
+
}, $ = {
|
|
6
6
|
key: 1,
|
|
7
7
|
class: "elements-error"
|
|
8
|
-
},
|
|
8
|
+
}, M = {
|
|
9
9
|
key: 2,
|
|
10
10
|
class: "payment-button-container"
|
|
11
|
-
},
|
|
11
|
+
}, O = ["disabled"], H = /* @__PURE__ */ A({
|
|
12
12
|
__name: "StripePayment",
|
|
13
13
|
props: {
|
|
14
14
|
paymentId: {},
|
|
@@ -24,10 +24,10 @@ const $ = { class: "stripe-elements" }, B = {
|
|
|
24
24
|
returnUrl: { default: void 0 }
|
|
25
25
|
},
|
|
26
26
|
emits: ["submit", "success", "error", "ready"],
|
|
27
|
-
setup(
|
|
28
|
-
const e =
|
|
29
|
-
let
|
|
30
|
-
const
|
|
27
|
+
setup(v, { expose: h, emit: u }) {
|
|
28
|
+
const e = v, a = u, p = b(), l = b(!0), n = b(!1), i = b("");
|
|
29
|
+
let c = null, f = null, d = null;
|
|
30
|
+
const S = C(() => ({
|
|
31
31
|
EUR: "€",
|
|
32
32
|
USD: "$",
|
|
33
33
|
GBP: "£",
|
|
@@ -38,33 +38,33 @@ const $ = { class: "stripe-elements" }, B = {
|
|
|
38
38
|
PLN: "zł",
|
|
39
39
|
CZK: "Kč",
|
|
40
40
|
HUF: "Ft"
|
|
41
|
-
})[e.currency] || e.currency),
|
|
41
|
+
})[e.currency] || e.currency), k = C(() => e.amount.toFixed(2)), r = C(() => {
|
|
42
42
|
if (e.clientData)
|
|
43
43
|
try {
|
|
44
|
-
const
|
|
45
|
-
return
|
|
44
|
+
const s = JSON.parse(e.clientData);
|
|
45
|
+
return s.clientSecret || s.client_secret;
|
|
46
46
|
} catch {
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
|
-
}),
|
|
49
|
+
}), m = async () => {
|
|
50
50
|
if (!p.value) return;
|
|
51
|
-
let
|
|
52
|
-
if (!
|
|
51
|
+
let s = e.publishableKey;
|
|
52
|
+
if (!s && e.clientData)
|
|
53
53
|
try {
|
|
54
|
-
const
|
|
55
|
-
|
|
54
|
+
const o = JSON.parse(e.clientData);
|
|
55
|
+
s = o.publishableKey || o.publishable_key;
|
|
56
56
|
} catch {
|
|
57
57
|
}
|
|
58
|
-
if (!
|
|
59
|
-
|
|
58
|
+
if (!s) {
|
|
59
|
+
i.value = "Publishable key is required", l.value = !1;
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
62
|
try {
|
|
63
|
-
|
|
64
|
-
const { loadStripe:
|
|
65
|
-
if (
|
|
63
|
+
l.value = !0, i.value = "";
|
|
64
|
+
const { loadStripe: o } = await import("@stripe/stripe-js");
|
|
65
|
+
if (c = await o(s), !c)
|
|
66
66
|
throw new Error("Failed to load Stripe");
|
|
67
|
-
const t =
|
|
67
|
+
const t = r.value, _ = {
|
|
68
68
|
appearance: e.appearance || {
|
|
69
69
|
theme: "stripe",
|
|
70
70
|
variables: {
|
|
@@ -80,7 +80,7 @@ const $ = { class: "stripe-elements" }, B = {
|
|
|
80
80
|
loader: e.loader,
|
|
81
81
|
locale: e.locale
|
|
82
82
|
};
|
|
83
|
-
t && (
|
|
83
|
+
t && (_.clientSecret = t), f = c.elements(_), d = f.create("payment", {
|
|
84
84
|
layout: "tabs",
|
|
85
85
|
defaultValues: {
|
|
86
86
|
billingDetails: {
|
|
@@ -89,26 +89,26 @@ const $ = { class: "stripe-elements" }, B = {
|
|
|
89
89
|
phone: ""
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
-
}),
|
|
93
|
-
|
|
94
|
-
}),
|
|
95
|
-
|
|
92
|
+
}), d.mount(p.value), d.on("ready", () => {
|
|
93
|
+
l.value = !1, a("ready");
|
|
94
|
+
}), d.on("change", (N) => {
|
|
95
|
+
N.error ? (i.value = N.error.message, a("error", N.error)) : i.value = "";
|
|
96
96
|
});
|
|
97
|
-
} catch (
|
|
98
|
-
|
|
97
|
+
} catch (o) {
|
|
98
|
+
i.value = o instanceof Error ? o.message : "Failed to initialize payment form", l.value = !1, a("error", o);
|
|
99
99
|
}
|
|
100
|
-
},
|
|
101
|
-
if (!(!
|
|
102
|
-
n.value = !0,
|
|
100
|
+
}, U = async () => {
|
|
101
|
+
if (!(!c || !d)) {
|
|
102
|
+
n.value = !0, i.value = "";
|
|
103
103
|
try {
|
|
104
|
-
const
|
|
104
|
+
const s = e.returnUrl || `${window.location.origin}/payment/return`, { error: o, paymentIntent: t } = await c.confirmPayment({
|
|
105
105
|
elements: f,
|
|
106
106
|
confirmParams: {
|
|
107
|
-
return_url:
|
|
107
|
+
return_url: s
|
|
108
108
|
},
|
|
109
109
|
redirect: "if_required"
|
|
110
110
|
});
|
|
111
|
-
|
|
111
|
+
o ? (i.value = o.message || "Payment failed", a("error", o)) : t ? t.status === "succeeded" ? a("success", {
|
|
112
112
|
paymentIntent: t,
|
|
113
113
|
status: "succeeded",
|
|
114
114
|
message: "Payment completed successfully!"
|
|
@@ -116,59 +116,59 @@ const $ = { class: "stripe-elements" }, B = {
|
|
|
116
116
|
paymentIntent: t,
|
|
117
117
|
status: "processing",
|
|
118
118
|
message: "Payment is being processed..."
|
|
119
|
-
}) : a("submit", { paymentIntent: t, status: t.status }) : a("submit",
|
|
120
|
-
} catch (
|
|
121
|
-
|
|
119
|
+
}) : a("submit", { paymentIntent: t, status: t.status }) : a("submit", d);
|
|
120
|
+
} catch (s) {
|
|
121
|
+
i.value = s instanceof Error ? s.message : "Payment failed", a("error", s);
|
|
122
122
|
} finally {
|
|
123
123
|
n.value = !1;
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
|
-
},
|
|
127
|
-
|
|
126
|
+
}, P = () => {
|
|
127
|
+
d && (d.destroy(), d = null), f && (f = null), c && (c = null);
|
|
128
128
|
};
|
|
129
|
-
return
|
|
130
|
-
|
|
131
|
-
}),
|
|
132
|
-
|
|
129
|
+
return R(() => {
|
|
130
|
+
m();
|
|
131
|
+
}), x(() => {
|
|
132
|
+
P();
|
|
133
133
|
}), E(() => e.currency, () => {
|
|
134
|
-
|
|
134
|
+
P(), m();
|
|
135
135
|
}), E([() => e.publishableKey, () => e.clientData], () => {
|
|
136
|
-
(e.publishableKey || e.clientData) && (
|
|
137
|
-
}),
|
|
138
|
-
destroyElements:
|
|
139
|
-
}), (
|
|
140
|
-
|
|
136
|
+
(e.publishableKey || e.clientData) && (P(), m());
|
|
137
|
+
}), h({
|
|
138
|
+
destroyElements: P
|
|
139
|
+
}), (s, o) => (D(), g("div", B, [
|
|
140
|
+
y("div", {
|
|
141
141
|
ref_key: "elementsContainer",
|
|
142
142
|
ref: p,
|
|
143
143
|
class: "elements-container"
|
|
144
144
|
}, null, 512),
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
])])) :
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
145
|
+
l.value ? (D(), g("div", I, [...o[0] || (o[0] = [
|
|
146
|
+
y("div", { class: "loading-spinner" }, null, -1),
|
|
147
|
+
y("p", null, "Loading payment form...", -1)
|
|
148
|
+
])])) : w("", !0),
|
|
149
|
+
i.value ? (D(), g("div", $, [
|
|
150
|
+
o[1] || (o[1] = y("div", { class: "error-icon" }, " ⚠️ ", -1)),
|
|
151
|
+
y("p", null, K(i.value), 1),
|
|
152
|
+
y("button", {
|
|
153
153
|
class: "retry-btn",
|
|
154
|
-
onClick:
|
|
154
|
+
onClick: m
|
|
155
155
|
}, " Retry ")
|
|
156
|
-
])) :
|
|
157
|
-
|
|
158
|
-
|
|
156
|
+
])) : w("", !0),
|
|
157
|
+
v.showPayButton && !l.value && !i.value ? (D(), g("div", M, [
|
|
158
|
+
y("button", {
|
|
159
159
|
disabled: n.value,
|
|
160
160
|
class: "payment-button",
|
|
161
|
-
onClick:
|
|
162
|
-
},
|
|
163
|
-
])) :
|
|
161
|
+
onClick: U
|
|
162
|
+
}, K(n.value ? "Processing..." : `Pay ${S.value}${k.value}`), 9, O)
|
|
163
|
+
])) : w("", !0)
|
|
164
164
|
]));
|
|
165
165
|
}
|
|
166
|
-
}), F = (
|
|
167
|
-
const
|
|
168
|
-
for (const [e, a] of
|
|
169
|
-
|
|
170
|
-
return
|
|
171
|
-
},
|
|
166
|
+
}), F = (v, h) => {
|
|
167
|
+
const u = v.__vccOpts || v;
|
|
168
|
+
for (const [e, a] of h)
|
|
169
|
+
u[e] = a;
|
|
170
|
+
return u;
|
|
171
|
+
}, T = /* @__PURE__ */ F(H, [["__scopeId", "data-v-adbdf3c5"]]), z = /* @__PURE__ */ A({
|
|
172
172
|
__name: "AdyenPayment",
|
|
173
173
|
props: {
|
|
174
174
|
paymentId: {},
|
|
@@ -181,12 +181,12 @@ const $ = { class: "stripe-elements" }, B = {
|
|
|
181
181
|
onCancel: { type: Function }
|
|
182
182
|
},
|
|
183
183
|
emits: ["submit", "additionalDetails", "error", "ready", "success"],
|
|
184
|
-
setup(
|
|
185
|
-
const
|
|
186
|
-
if (!
|
|
184
|
+
setup(v, { emit: h }) {
|
|
185
|
+
const u = v, e = h, a = b(null), p = () => {
|
|
186
|
+
if (!u.clientData)
|
|
187
187
|
return console.error("No clientData provided"), null;
|
|
188
188
|
try {
|
|
189
|
-
const n = JSON.parse(
|
|
189
|
+
const n = JSON.parse(u.clientData);
|
|
190
190
|
return console.log("Parsed Adyen session data:", n), {
|
|
191
191
|
id: n.id,
|
|
192
192
|
sessionData: n.sessionData,
|
|
@@ -198,9 +198,9 @@ const $ = { class: "stripe-elements" }, B = {
|
|
|
198
198
|
} catch (n) {
|
|
199
199
|
return console.error("Failed to parse clientData:", n), null;
|
|
200
200
|
}
|
|
201
|
-
},
|
|
202
|
-
var
|
|
203
|
-
if (!
|
|
201
|
+
}, l = async () => {
|
|
202
|
+
var i;
|
|
203
|
+
if (!u.clientKey || !a.value) {
|
|
204
204
|
console.error("Initialization failed: Missing clientKey or container.");
|
|
205
205
|
return;
|
|
206
206
|
}
|
|
@@ -210,12 +210,12 @@ const $ = { class: "stripe-elements" }, B = {
|
|
|
210
210
|
return;
|
|
211
211
|
}
|
|
212
212
|
try {
|
|
213
|
-
const { AdyenCheckout:
|
|
214
|
-
environment:
|
|
215
|
-
clientKey:
|
|
213
|
+
const { AdyenCheckout: c, Card: f, ApplePay: d, GooglePay: S, Klarna: k, Blik: r, Dropin: m } = await import("@adyen/adyen-web"), U = {
|
|
214
|
+
environment: u.environment || "test",
|
|
215
|
+
clientKey: u.clientKey,
|
|
216
216
|
session: n,
|
|
217
|
-
onPaymentCompleted: (t,
|
|
218
|
-
console.info("Payment Completed:", t,
|
|
217
|
+
onPaymentCompleted: (t, _) => {
|
|
218
|
+
console.info("Payment Completed:", t, _), e("submit", t), t.resultCode === "Authorised" || t.resultCode === "Received" ? (console.info("Payment Successful:", t), e("success", {
|
|
219
219
|
status: "succeeded",
|
|
220
220
|
message: "Payment completed successfully",
|
|
221
221
|
resultCode: t.resultCode,
|
|
@@ -233,12 +233,12 @@ const $ = { class: "stripe-elements" }, B = {
|
|
|
233
233
|
paymentData: t
|
|
234
234
|
}));
|
|
235
235
|
},
|
|
236
|
-
onError: (t,
|
|
237
|
-
console.error("Adyen Error:", t.name, t.message, t.stack,
|
|
236
|
+
onError: (t, _) => {
|
|
237
|
+
console.error("Adyen Error:", t.name, t.message, t.stack, _), e("error", t);
|
|
238
238
|
}
|
|
239
|
-
},
|
|
239
|
+
}, P = {
|
|
240
240
|
showPayButton: !0,
|
|
241
|
-
paymentMethodComponents: [f,
|
|
241
|
+
paymentMethodComponents: [f, d, S, k, r],
|
|
242
242
|
paymentMethodsConfiguration: {
|
|
243
243
|
card: {
|
|
244
244
|
hasHolderName: !0,
|
|
@@ -259,48 +259,39 @@ const $ = { class: "stripe-elements" }, B = {
|
|
|
259
259
|
// BLIK configuration for Polish market
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
|
-
},
|
|
263
|
-
console.log("Adyen Checkout created:",
|
|
264
|
-
const
|
|
265
|
-
console.log("Adyen Drop-in created with session payment methods"), a.value && (
|
|
266
|
-
} catch (
|
|
267
|
-
console.error("Error creating Adyen Drop-in:",
|
|
262
|
+
}, s = await c(U);
|
|
263
|
+
console.log("Adyen Checkout created:", s), console.log("Available payment methods from session:", (i = s.paymentMethodsResponse) == null ? void 0 : i.paymentMethods);
|
|
264
|
+
const o = new m(s, P);
|
|
265
|
+
console.log("Adyen Drop-in created with session payment methods"), a.value && (o.mount(a.value), console.log("Adyen Drop-in mounted successfully"), e("ready"));
|
|
266
|
+
} catch (c) {
|
|
267
|
+
console.error("Error creating Adyen Drop-in:", c), e("error", c);
|
|
268
268
|
}
|
|
269
269
|
};
|
|
270
|
-
return
|
|
271
|
-
|
|
272
|
-
}), E(() =>
|
|
273
|
-
a.value && (a.value.innerHTML = "",
|
|
274
|
-
}), (n,
|
|
270
|
+
return R(() => {
|
|
271
|
+
l();
|
|
272
|
+
}), E(() => u.clientData, () => {
|
|
273
|
+
a.value && (a.value.innerHTML = "", l());
|
|
274
|
+
}), (n, i) => (D(), g("div", {
|
|
275
275
|
ref_key: "dropinContainer",
|
|
276
276
|
ref: a,
|
|
277
277
|
class: "payment-dropin"
|
|
278
278
|
}, null, 512));
|
|
279
279
|
}
|
|
280
|
-
}),
|
|
280
|
+
}), W = /* @__PURE__ */ F(z, [["__scopeId", "data-v-ef2ec054"]]), L = { class: "delayed-payment-card" }, q = ["disabled"], J = {
|
|
281
281
|
key: 0,
|
|
282
|
-
class: "
|
|
283
|
-
}, V = {
|
|
284
|
-
key: 0,
|
|
285
|
-
class: "info-row"
|
|
286
|
-
}, G = { class: "value" }, W = {
|
|
287
|
-
key: 1,
|
|
288
|
-
class: "info-row"
|
|
289
|
-
}, X = { class: "value" }, Z = {
|
|
290
|
-
key: 1,
|
|
291
|
-
class: "error-message"
|
|
292
|
-
}, Q = { class: "button-container" }, Y = ["disabled"], ee = /* @__PURE__ */ U({
|
|
282
|
+
class: "mt-2 text-sm text-red-600"
|
|
283
|
+
}, V = /* @__PURE__ */ A({
|
|
293
284
|
__name: "DelayedPayment",
|
|
294
285
|
props: {
|
|
295
|
-
paymentId: { default: void 0 },
|
|
296
|
-
clientData: { default: void 0 },
|
|
297
286
|
amount: {},
|
|
298
287
|
currency: {},
|
|
299
|
-
|
|
288
|
+
clientData: { default: void 0 },
|
|
289
|
+
paymentId: { default: void 0 },
|
|
290
|
+
tenantId: {}
|
|
300
291
|
},
|
|
301
292
|
emits: ["submit", "success", "error", "ready"],
|
|
302
|
-
setup(
|
|
303
|
-
const e =
|
|
293
|
+
setup(v, { expose: h, emit: u }) {
|
|
294
|
+
const e = v, a = u, p = b(!1), l = b(""), n = b({}), i = C(() => ({
|
|
304
295
|
EUR: "€",
|
|
305
296
|
USD: "$",
|
|
306
297
|
GBP: "£",
|
|
@@ -309,109 +300,73 @@ const $ = { class: "stripe-elements" }, B = {
|
|
|
309
300
|
SEK: "kr",
|
|
310
301
|
DKK: "kr",
|
|
311
302
|
PLN: "zł"
|
|
312
|
-
})[e.currency] || e.currency),
|
|
303
|
+
})[e.currency] || e.currency), c = C(() => e.amount.toFixed(2)), f = C(() => n.value.transactionNumber && n.value.providerUid), d = () => {
|
|
313
304
|
if (!e.clientData) {
|
|
314
305
|
console.error("No clientData provided for delayed payment");
|
|
315
306
|
return;
|
|
316
307
|
}
|
|
317
308
|
try {
|
|
318
|
-
const
|
|
319
|
-
|
|
320
|
-
transactionNumber:
|
|
321
|
-
merchantReference:
|
|
322
|
-
providerUid:
|
|
323
|
-
|
|
324
|
-
confirmationUrl: o.confirmationUrl
|
|
309
|
+
const r = JSON.parse(e.clientData);
|
|
310
|
+
n.value = {
|
|
311
|
+
transactionNumber: r.transactionNumber,
|
|
312
|
+
merchantReference: r.merchantReference,
|
|
313
|
+
providerUid: r.providerUid,
|
|
314
|
+
paymentUid: r.paymentUid
|
|
325
315
|
}, a("ready");
|
|
326
|
-
} catch (
|
|
327
|
-
|
|
316
|
+
} catch (r) {
|
|
317
|
+
l.value = "Invalid session data", a("error", r);
|
|
328
318
|
}
|
|
329
|
-
},
|
|
319
|
+
}, S = async () => {
|
|
330
320
|
if (!(!f.value || p.value)) {
|
|
331
|
-
p.value = !0,
|
|
321
|
+
p.value = !0, l.value = "";
|
|
332
322
|
try {
|
|
333
|
-
const
|
|
323
|
+
const r = {
|
|
334
324
|
provider: "delayed-payment",
|
|
335
325
|
amount: e.amount,
|
|
336
326
|
currency: e.currency,
|
|
337
327
|
transactionNumber: n.value.transactionNumber,
|
|
338
328
|
merchantReference: n.value.merchantReference,
|
|
329
|
+
providerUid: n.value.providerUid,
|
|
339
330
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
340
331
|
};
|
|
341
|
-
|
|
342
|
-
throw new Error("Confirmation URL not provided");
|
|
343
|
-
const i = {
|
|
344
|
-
"Content-Type": "application/json",
|
|
345
|
-
Accept: "application/json"
|
|
346
|
-
};
|
|
347
|
-
e.tenantId && (i["X-Tenant-ID"] = e.tenantId);
|
|
348
|
-
const C = await fetch(n.value.confirmationUrl, {
|
|
349
|
-
method: "POST",
|
|
350
|
-
headers: i,
|
|
351
|
-
credentials: "include"
|
|
352
|
-
});
|
|
353
|
-
if (!C.ok) {
|
|
354
|
-
const r = await C.json();
|
|
355
|
-
throw new Error(r.message || "Failed to confirm payment");
|
|
356
|
-
}
|
|
357
|
-
const g = await C.json();
|
|
358
|
-
a("success", {
|
|
332
|
+
a("submit", r), await new Promise((m) => setTimeout(m, 500)), a("success", {
|
|
359
333
|
status: "succeeded",
|
|
360
|
-
message:
|
|
361
|
-
|
|
362
|
-
transactionNumber: n.value.transactionNumber
|
|
334
|
+
message: "Payment confirmed successfully. You will receive a receipt shortly.",
|
|
335
|
+
resultCode: "Authorised",
|
|
336
|
+
transactionNumber: n.value.transactionNumber,
|
|
337
|
+
providerUid: n.value.providerUid,
|
|
338
|
+
paymentData: r
|
|
363
339
|
});
|
|
364
|
-
} catch (
|
|
365
|
-
|
|
340
|
+
} catch (r) {
|
|
341
|
+
l.value = r instanceof Error ? r.message : "Failed to confirm payment", a("error", r);
|
|
366
342
|
} finally {
|
|
367
343
|
p.value = !1;
|
|
368
344
|
}
|
|
369
345
|
}
|
|
370
|
-
},
|
|
371
|
-
|
|
346
|
+
}, k = () => {
|
|
347
|
+
l.value = "";
|
|
372
348
|
};
|
|
373
|
-
return
|
|
374
|
-
|
|
375
|
-
}),
|
|
376
|
-
clearError:
|
|
377
|
-
}), (
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
n.value.transactionNumber ? (b(), v("div", V, [
|
|
390
|
-
i[1] || (i[1] = s("span", { class: "label" }, "Transaction Number:", -1)),
|
|
391
|
-
s("span", G, _(n.value.transactionNumber), 1)
|
|
392
|
-
])) : k("", !0),
|
|
393
|
-
n.value.merchantReference ? (b(), v("div", W, [
|
|
394
|
-
i[2] || (i[2] = s("span", { class: "label" }, "Reference:", -1)),
|
|
395
|
-
s("span", X, _(n.value.merchantReference), 1)
|
|
396
|
-
])) : k("", !0)
|
|
397
|
-
])) : k("", !0),
|
|
398
|
-
u.value ? (b(), v("div", Z, [
|
|
399
|
-
i[3] || (i[3] = s("div", { class: "error-icon" }, " ⚠️ ", -1)),
|
|
400
|
-
s("p", null, _(u.value), 1)
|
|
401
|
-
])) : k("", !0),
|
|
402
|
-
s("div", Q, [
|
|
403
|
-
s("button", {
|
|
404
|
-
disabled: p.value || !f.value,
|
|
405
|
-
class: "submit-button",
|
|
406
|
-
onClick: K
|
|
407
|
-
}, _(p.value ? "Processing..." : `Confirm Payment ${c.value}${d.value}`), 9, Y)
|
|
408
|
-
])
|
|
409
|
-
])
|
|
349
|
+
return R(() => {
|
|
350
|
+
d();
|
|
351
|
+
}), h({
|
|
352
|
+
clearError: k
|
|
353
|
+
}), (r, m) => (D(), g("div", L, [
|
|
354
|
+
m[0] || (m[0] = y("div", { class: "header-row" }, [
|
|
355
|
+
y("span", { class: "header-icon" }, "💳"),
|
|
356
|
+
y("span", { class: "header-title" }, "Delayed payment")
|
|
357
|
+
], -1)),
|
|
358
|
+
m[1] || (m[1] = y("div", { class: "header-description" }, " Payment will be processed manually via invoice or bank transfer ", -1)),
|
|
359
|
+
y("button", {
|
|
360
|
+
disabled: p.value || !f.value,
|
|
361
|
+
class: "confirm-btn",
|
|
362
|
+
onClick: S
|
|
363
|
+
}, K(p.value ? "Processing..." : `Confirm payment ${c.value}${i.value}`), 9, q),
|
|
364
|
+
l.value ? (D(), g("p", J, K(l.value), 1)) : w("", !0)
|
|
410
365
|
]));
|
|
411
366
|
}
|
|
412
|
-
}),
|
|
367
|
+
}), Y = /* @__PURE__ */ F(V, [["__scopeId", "data-v-1e02fd9c"]]);
|
|
413
368
|
export {
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
369
|
+
W as AdyenPayment,
|
|
370
|
+
Y as DelayedPayment,
|
|
371
|
+
T as StripePayment
|
|
417
372
|
};
|