@bunnyapp/components 1.0.14 → 1.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/cjs/index.js +344 -561
- package/dist/cjs/src/components/PaymentForm/CheckoutFooter.d.ts +3 -4
- package/dist/cjs/src/components/PaymentForm/DemoPay/hooks/usePay.d.ts +4 -6
- package/dist/cjs/src/components/PaymentForm/PaymentForm.d.ts +1 -2
- package/dist/cjs/src/components/PaymentForm/PaymentFormTypes.d.ts +3 -28
- package/dist/cjs/src/components/PaymentForm/PaymentMethodDetails.d.ts +1 -2
- package/dist/cjs/src/components/PaymentForm/PaymentMethodSelector.d.ts +3 -3
- package/dist/cjs/src/components/PaymentForm/Stripe/StripeForm.d.ts +1 -1
- package/dist/cjs/src/components/PaymentForm/Stripe/hooks/usePay.d.ts +4 -5
- package/dist/cjs/src/components/Signup/PaymentForms.d.ts +1 -2
- package/dist/cjs/src/contexts/PaymentContext.d.ts +2 -0
- package/dist/esm/index.js +347 -564
- package/dist/esm/src/components/PaymentForm/CheckoutFooter.d.ts +3 -4
- package/dist/esm/src/components/PaymentForm/DemoPay/hooks/usePay.d.ts +4 -6
- package/dist/esm/src/components/PaymentForm/PaymentForm.d.ts +1 -2
- package/dist/esm/src/components/PaymentForm/PaymentFormTypes.d.ts +3 -28
- package/dist/esm/src/components/PaymentForm/PaymentMethodDetails.d.ts +1 -2
- package/dist/esm/src/components/PaymentForm/PaymentMethodSelector.d.ts +3 -3
- package/dist/esm/src/components/PaymentForm/Stripe/StripeForm.d.ts +1 -1
- package/dist/esm/src/components/PaymentForm/Stripe/hooks/usePay.d.ts +4 -5
- package/dist/esm/src/components/Signup/PaymentForms.d.ts +1 -2
- package/dist/esm/src/contexts/PaymentContext.d.ts +2 -0
- package/dist/index.d.ts +1 -3
- package/package.json +4 -3
- package/dist/cjs/src/components/Checkout/InvoiceCheckout.d.ts +0 -8
- package/dist/cjs/src/components/Transactions/DocumentNameEnum.d.ts +0 -4
- package/dist/cjs/src/components/icons/BunnyFooterIcon.d.ts +0 -4
- package/dist/cjs/src/consts/paymentConsts.d.ts +0 -16
- package/dist/cjs/src/graphql/mutations/quoteCreate.d.ts +0 -9
- package/dist/cjs/src/graphql/queries/getInvoice.d.ts +0 -7
- package/dist/cjs/src/graphql/queries/getSubscription.d.ts +0 -12
- package/dist/esm/src/components/Checkout/InvoiceCheckout.d.ts +0 -8
- package/dist/esm/src/components/Transactions/DocumentNameEnum.d.ts +0 -4
- package/dist/esm/src/components/icons/BunnyFooterIcon.d.ts +0 -4
- package/dist/esm/src/consts/paymentConsts.d.ts +0 -16
- package/dist/esm/src/graphql/mutations/quoteCreate.d.ts +0 -9
- package/dist/esm/src/graphql/queries/getInvoice.d.ts +0 -7
- package/dist/esm/src/graphql/queries/getSubscription.d.ts +0 -12
package/dist/cjs/index.js
CHANGED
|
@@ -71,7 +71,7 @@ function styleInject(css, ref) {
|
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
var css_248z = ".ant-collapse-header {\n cursor: default !important;\n padding: 0 !important;\n}\n.ant-tag {\n border: none;\n border-radius: 14px;\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;\n font-weight: 500;\n white-space: nowrap;\n margin: 0;\n}\n.ant-tag-blue {\n color: #3b82f6 !important;\n background: #bfdbfe !important;\n}\n.ant-tag-green {\n color: #059669 !important;\n background: #a7f3d0 !important;\n}\n.ant-tag-red {\n color: #ef4444 !important;\n background: #fecaca !important;\n}\n.ant-tag-orange {\n color: #f97316 !important;\n background: #fed7aa !important;\n}\n.ant-tag-yellow {\n color: #f59e0b !important;\n background: #fde68a !important;\n}\n.ant-tag-purple {\n color: #8b5cf6 !important;\n background: #ddd6fe !important;\n}\n.ant-tag-black {\n color: white !important;\n background: black !important;\n}\n.ant-popover {\n z-index: 1050;\n}\n.ant-popover-inner-content {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n max-width: 300px;\n}\n.ant-popover-message-title {\n padding: 0;\n text-align: center;\n font-size: 1rem;\n}\n.ant-popover-buttons {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.ant-btn-link:disabled {\n color: #717d94 !important;\n}\n.ant-btn-link:disabled:hover {\n background-color: transparent !important;\n}\n.ant-input-affix-wrapper .ant-input-prefix {\n transition: color 0.3s;\n}\n.ant-form-item-label {\n text-transform: none !important;\n font-size: 0.75rem;\n padding-bottom: 2px !important;\n}\n.ant-form-item-label > label {\n width: 100%;\n color: #4b5563 !important;\n}\n.ant-form-item-explain-error {\n font-size: 11px;\n min-height: 11px;\n line-height: 11px;\n padding-top: 2px;\n}\n.ant-form-item {\n margin-bottom: 0;\n}\n.ant-notification {\n width: min-content;\n}\n.ant-notification-topRight {\n right: 0 !important;\n left: 0 !important;\n margin-left: auto !important;\n margin-right: auto !important;\n}\n.ant-notification-notice-wrapper {\n width: 350px !important;\n overflow: hidden !important;\n}\n.ant-notification-notice {\n padding: 16px !important;\n width: 350px !important;\n display: flex !important;\n box-shadow: 0px 6px 10px rgba(0, 0, 0, 0.08), 0px 1px 18px rgba(0, 0, 0, 0.08), 0px 3px 5px rgba(0, 0, 0, 0.16) !important;\n}\n.ant-notification-notice-description {\n padding: 0 14px 0 0 !important;\n color: #232323 !important;\n font-size: 14px !important;\n word-break: break-all !important;\n overflow-wrap: break-word !important;\n}\n.ant-notification-notice-success {\n background-color: #edfffa !important;\n}\n.ant-notification-notice-error {\n background-color: #fff8f4 !important;\n}\n.ant-notification-notice-error .ant-notification-notice-message {\n color: #ff6e1c !important;\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji !important;\n font-weight: 500;\n}\n.ant-notification-notice-error .ant-notification-notice-icon {\n color: #ff6e1c;\n}\n.ant-notification-notice-success .ant-notification-notice-message {\n color: #00b76a !important;\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji !important;\n font-weight: 500;\n}\n.ant-notification-notice-success .ant-notification-notice-icon {\n color: #00b76a !important;\n}\n.ant-notification-notice-message {\n margin-bottom: 0 !important;\n}\n.ant-notification-notice-close {\n top: 16px !important;\n right: 16px !important;\n}\n.ant-menu-submenu-popup > .ant-menu .ant-menu-item {\n display: flex !important;\n align-items: center !important;\n}\n.ant-menu-submenu::after {\n display: none !important;\n}\n.ant-drawer-title {\n font-weight: 400 !important;\n}\n.ant-drawer-header-title {\n flex-direction: row-reverse !important;\n align-items: start !important ;\n}\n.ant-drawer-close {\n margin-inline-end: 0 !important;\n}\n@media (min-width: 768px) {\n .ant-input,\n .ant-picker,\n .ant-select,\n .ant-input-affix-wrapper {\n font-size: 1rem !important;\n }\n .ant-drawer-header {\n padding-right: 1.5rem !important;\n padding-left: 1.5rem !important;\n }\n}\n:root {\n --row-background: #ffffff;\n --row-background-alternate: rgba(100, 116, 139, 0.04);\n --row-background-dark: #121212;\n --row-background-alternate-dark: #1e1e1e;\n}\n.plan-step-line {\n height: 1px;\n min-width: 128px;\n background: #717d94;\n}\n.plan-step-number {\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 9999px;\n border: 1px solid #717d94;\n background: white;\n width: 24px;\n height: 24px;\n color: #717d94;\n}\n.plan-step-number.active {\n border: none;\n color: white;\n background: #ff6e1c;\n}\n.hidden {\n display: none;\n}\n.cardElement {\n padding: 8px 11px;\n border: 1px solid #e5e7eb;\n background-color: white;\n font-family: Inter !important;\n}\n.tooltip {\n visibility: hidden;\n position: absolute !important;\n}\n.has-tooltip:hover .tooltip {\n visibility: visible;\n z-index: 100;\n}\n.show-on-hover {\n opacity: 0;\n}\n.show-on-hover-container:hover .show-on-hover {\n opacity: 1;\n}\n.pdf-only {\n display: none !important;\n}\n.notes p {\n margin: 0;\n padding: 0;\n padding-bottom: 0.25rem;\n}\n#form-element #finix-form-container .field-holder label {\n color: #717d94 !important;\n font-size: 12px !important;\n}\n#form-element #finix-form-container > *:first-child,\n#form-element #finix-form-container > *:last-child {\n margin-top: 0 !important;\n}\n#form-element #finix-form-container > *:not(:first-child):not(:last-child) {\n margin-top: 12px !important;\n}\n#form-element #finix-form-container .field-array > * {\n margin-top: 0 !important;\n}\n#form-element #finix-form-container .field-holder .field,\n#form-element #finix-form-container iframe {\n height: 34px !important;\n}\n#form-element #finix-form-container .field {\n margin-top: 0 !important;\n padding-top: 2px !important;\n}\n#form-element #finix-form-container .field-holder .validation {\n font-size: 11px !important;\n color: #ff4d4f !important;\n}\n.icon-path {\n transition: fill 0.3s;\n}\n.shadow-padding-x {\n padding-right: 1rem;\n padding-left: 1rem;\n}\n.shadow-padding-xb {\n padding-right: 1rem;\n padding-left: 1rem;\n padding-bottom: 0.5rem;\n}\n.content-container {\n width: 100%;\n margin: 0 auto;\n}\n@media (min-width: 1220px) {\n .content-container {\n width: 1220px !important;\n margin: 0 auto;\n }\n}\n@media (min-width: 768px) {\n .shadow-padding-x {\n padding-right: 2rem;\n padding-left: 2rem;\n }\n .shadow-padding-xb {\n padding-right: 2rem;\n padding-left: 2rem;\n padding-bottom: 0.5rem;\n }\n .sm\\:flex {\n display: flex !important;\n }\n .sm\\:hidden {\n display: none !important;\n }\n}\n.rotate-45,\n.transform {\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n}\n.shadow,\n.shadow-lg,\n.shadow-md,\n.shadow-none,\n.shadow-sm,\n.shadow-xl {\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n}\n.container {\n width: 100%;\n}\n@media (min-width: 768px) {\n .container {\n max-width: 768px;\n }\n}\n@media (min-width: 1024px) {\n .container {\n max-width: 1024px;\n }\n}\n@media (min-width: 1280px) {\n .container {\n max-width: 1280px;\n }\n}\n@media (min-width: 1536px) {\n .container {\n max-width: 1536px;\n }\n}\n.visible {\n visibility: visible;\n}\n.fixed {\n position: fixed;\n}\n.absolute {\n position: absolute;\n}\n.relative {\n position: relative;\n}\n.bottom-0 {\n bottom: 0px;\n}\n.left-0 {\n left: 0px;\n}\n.right-0 {\n right: 0px;\n}\n.top-0 {\n top: 0px;\n}\n.z-50 {\n z-index: 50;\n}\n.col-span-2 {\n grid-column: span 2 / span 2;\n}\n.col-span-3 {\n grid-column: span 3 / span 3;\n}\n.m-0 {\n margin: 0px;\n}\n.mx-4 {\n margin-left: 1rem;\n margin-right: 1rem;\n}\n.my-12 {\n margin-top: 3rem;\n margin-bottom: 3rem;\n}\n.my-2 {\n margin-top: 0.5rem;\n margin-bottom: 0.5rem;\n}\n.my-4 {\n margin-top: 1rem;\n margin-bottom: 1rem;\n}\n.mb-4 {\n margin-bottom: 1rem;\n}\n.ml-2 {\n margin-left: 0.5rem;\n}\n.mr-8 {\n margin-right: 2rem;\n}\n.mt-1 {\n margin-top: 0.25rem;\n}\n.mt-2 {\n margin-top: 0.5rem;\n}\n.mt-4 {\n margin-top: 1rem;\n}\n.mt-6 {\n margin-top: 1.5rem;\n}\n.mt-8 {\n margin-top: 2rem;\n}\n.block {\n display: block;\n}\n.flex {\n display: flex;\n}\n.table {\n display: table;\n}\n.grid {\n display: grid;\n}\n.contents {\n display: contents;\n}\n.hidden {\n display: none;\n}\n.h-4 {\n height: 1rem;\n}\n.h-5 {\n height: 1.25rem;\n}\n.h-8 {\n height: 2rem;\n}\n.h-full {\n height: 100%;\n}\n.w-1\\/2 {\n width: 50%;\n}\n.w-1\\/3 {\n width: 33.333333%;\n}\n.w-2\\/3 {\n width: 66.666667%;\n}\n.w-4 {\n width: 1rem;\n}\n.w-full {\n width: 100%;\n}\n.max-w-32 {\n max-width: 8rem;\n}\n.flex-1 {\n flex: 1 1 0%;\n}\n.shrink-0 {\n flex-shrink: 0;\n}\n.grow {\n flex-grow: 1;\n}\n.border-collapse {\n border-collapse: collapse;\n}\n.rotate-45 {\n --tw-rotate: 45deg;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n.transform {\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n.cursor-pointer {\n cursor: pointer;\n}\n.grid-cols-2 {\n grid-template-columns: repeat(2, minmax(0, 1fr));\n}\n.grid-cols-3 {\n grid-template-columns: repeat(3, minmax(0, 1fr));\n}\n.flex-row {\n flex-direction: row;\n}\n.flex-col {\n flex-direction: column;\n}\n.items-end {\n align-items: flex-end;\n}\n.items-center {\n align-items: center;\n}\n.justify-start {\n justify-content: flex-start;\n}\n.justify-end {\n justify-content: flex-end;\n}\n.justify-center {\n justify-content: center;\n}\n.justify-between {\n justify-content: space-between;\n}\n.gap-0 {\n gap: 0px;\n}\n.gap-1 {\n gap: 0.25rem;\n}\n.gap-2 {\n gap: 0.5rem;\n}\n.gap-4 {\n gap: 1rem;\n}\n.gap-6 {\n gap: 1.5rem;\n}\n.space-y-2 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(0.5rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(0.5rem * var(--tw-space-y-reverse));\n}\n.space-y-4 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(1rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(1rem * var(--tw-space-y-reverse));\n}\n.space-y-8 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(2rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(2rem * var(--tw-space-y-reverse));\n}\n.overflow-auto {\n overflow: auto;\n}\n.overflow-hidden {\n overflow: hidden;\n}\n.overflow-visible {\n overflow: visible;\n}\n.whitespace-nowrap {\n white-space: nowrap;\n}\n.text-nowrap {\n text-wrap: nowrap;\n}\n.rounded {\n border-radius: 0.25rem;\n}\n.rounded-full {\n border-radius: 9999px;\n}\n.rounded-md {\n border-radius: 0.375rem;\n}\n.border {\n border-width: 1px;\n}\n.border-solid {\n border-style: solid;\n}\n.border-gray-400 {\n --tw-border-opacity: 1;\n border-color: rgb(156 163 175 / var(--tw-border-opacity, 1));\n}\n.border-gray-500 {\n --tw-border-opacity: 1;\n border-color: rgb(107 114 128 / var(--tw-border-opacity, 1));\n}\n.border-slate-200 {\n --tw-border-opacity: 1;\n border-color: rgb(226 232 240 / var(--tw-border-opacity, 1));\n}\n.border-slate-300 {\n --tw-border-opacity: 1;\n border-color: rgb(203 213 225 / var(--tw-border-opacity, 1));\n}\n.border-slate-700 {\n --tw-border-opacity: 1;\n border-color: rgb(51 65 85 / var(--tw-border-opacity, 1));\n}\n.bg-black {\n --tw-bg-opacity: 1;\n background-color: rgb(0 0 0 / var(--tw-bg-opacity, 1));\n}\n.bg-emerald-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(167 243 208 / var(--tw-bg-opacity, 1));\n}\n.bg-green-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(187 247 208 / var(--tw-bg-opacity, 1));\n}\n.bg-orange-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(254 215 170 / var(--tw-bg-opacity, 1));\n}\n.bg-red-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(254 202 202 / var(--tw-bg-opacity, 1));\n}\n.bg-red-500 {\n --tw-bg-opacity: 1;\n background-color: rgb(239 68 68 / var(--tw-bg-opacity, 1));\n}\n.bg-slate-50 {\n --tw-bg-opacity: 1;\n background-color: rgb(248 250 252 / var(--tw-bg-opacity, 1));\n}\n.bg-white {\n --tw-bg-opacity: 1;\n background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));\n}\n.bg-yellow-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(254 240 138 / var(--tw-bg-opacity, 1));\n}\n.p-0 {\n padding: 0px;\n}\n.p-1 {\n padding: 0.25rem;\n}\n.p-2 {\n padding: 0.5rem;\n}\n.p-4 {\n padding: 1rem;\n}\n.p-8 {\n padding: 2rem;\n}\n.px-0 {\n padding-left: 0px;\n padding-right: 0px;\n}\n.px-2 {\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n}\n.px-4 {\n padding-left: 1rem;\n padding-right: 1rem;\n}\n.px-6 {\n padding-left: 1.5rem;\n padding-right: 1.5rem;\n}\n.py-1 {\n padding-top: 0.25rem;\n padding-bottom: 0.25rem;\n}\n.py-2 {\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n}\n.py-4 {\n padding-top: 1rem;\n padding-bottom: 1rem;\n}\n.py-6 {\n padding-top: 1.5rem;\n padding-bottom: 1.5rem;\n}\n.px-3 {\n padding-left: 0.75rem;\n padding-right: 0.75rem;\n}\n.pb-2 {\n padding-bottom: 0.5rem;\n}\n.pb-4 {\n padding-bottom: 1rem;\n}\n.pb-6 {\n padding-bottom: 1.5rem;\n}\n.pb-8 {\n padding-bottom: 2rem;\n}\n.pl-0 {\n padding-left: 0px;\n}\n.pl-2 {\n padding-left: 0.5rem;\n}\n.pl-4 {\n padding-left: 1rem;\n}\n.pt-1 {\n padding-top: 0.25rem;\n}\n.pt-12 {\n padding-top: 3rem;\n}\n.pt-2 {\n padding-top: 0.5rem;\n}\n.pt-4 {\n padding-top: 1rem;\n}\n.pt-5 {\n padding-top: 1.25rem;\n}\n.pt-6 {\n padding-top: 1.5rem;\n}\n.pt-8 {\n padding-top: 2rem;\n}\n.text-left {\n text-align: left;\n}\n.text-center {\n text-align: center;\n}\n.text-right {\n text-align: right;\n}\n.align-middle {\n vertical-align: middle;\n}\n.text-2xl {\n font-size: 1.5rem;\n line-height: 2rem;\n}\n.text-base {\n font-size: 1rem;\n line-height: 1.5rem;\n}\n.text-lg {\n font-size: 1.125rem;\n line-height: 1.75rem;\n}\n.text-sm {\n font-size: 0.875rem;\n line-height: 1.25rem;\n}\n.text-xl {\n font-size: 1.25rem;\n line-height: 1.75rem;\n}\n.text-xs {\n font-size: 0.75rem;\n line-height: 1rem;\n}\n.font-bold {\n font-weight: 700;\n}\n.font-medium {\n font-weight: 500;\n}\n.font-normal {\n font-weight: 400;\n}\n.capitalize {\n text-transform: capitalize;\n}\n.text-emerald-600 {\n --tw-text-opacity: 1;\n color: rgb(5 150 105 / var(--tw-text-opacity, 1));\n}\n.text-emerald-700 {\n --tw-text-opacity: 1;\n color: rgb(4 120 87 / var(--tw-text-opacity, 1));\n}\n.text-gray-600 {\n --tw-text-opacity: 1;\n color: rgb(75 85 99 / var(--tw-text-opacity, 1));\n}\n.text-gray-900 {\n --tw-text-opacity: 1;\n color: rgb(17 24 39 / var(--tw-text-opacity, 1));\n}\n.text-green-600 {\n --tw-text-opacity: 1;\n color: rgb(22 163 74 / var(--tw-text-opacity, 1));\n}\n.text-orange-500 {\n --tw-text-opacity: 1;\n color: rgb(249 115 22 / var(--tw-text-opacity, 1));\n}\n.text-red-500 {\n --tw-text-opacity: 1;\n color: rgb(239 68 68 / var(--tw-text-opacity, 1));\n}\n.text-slate-400 {\n --tw-text-opacity: 1;\n color: rgb(148 163 184 / var(--tw-text-opacity, 1));\n}\n.text-slate-500 {\n --tw-text-opacity: 1;\n color: rgb(100 116 139 / var(--tw-text-opacity, 1));\n}\n.text-white {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity, 1));\n}\n.text-yellow-500 {\n --tw-text-opacity: 1;\n color: rgb(234 179 8 / var(--tw-text-opacity, 1));\n}\n.underline {\n text-decoration-line: underline;\n}\n.shadow {\n --tw-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);\n --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-lg {\n --tw-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);\n --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-md {\n --tw-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);\n --tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-none {\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-sm {\n --tw-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);\n --tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-xl {\n --tw-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);\n --tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.transition {\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.font-light {\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;\n}\n.font-medium {\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;\n}\n.font-bold {\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;\n}\n@media (min-width: 768px) {\n .sm\\:flex {\n display: flex;\n }\n .sm\\:hidden {\n display: none;\n }\n}\n* {\n margin: 0;\n padding: 0;\n box-sizing: border-box !important;\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;\n line-height: 1.15;\n}\nbody {\n color: #232323;\n background-color: #f8fafc;\n}\nth {\n font-weight: normal;\n}\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, \"Courier New\", monospace;\n}\n@media only screen and (max-width: 768px) {\n select,\n textarea,\n input[type=\"text\"],\n input[type=\"password\"],\n input[type=\"datetime\"],\n input[type=\"datetime-local\"],\n input[type=\"date\"],\n input[type=\"month\"],\n input[type=\"time\"],\n input[type=\"week\"],\n input[type=\"number\"],\n input[type=\"email\"],\n input[type=\"url\"],\n input[type=\"search\"],\n input[type=\"tel\"],\n input[type=\"color\"] {\n font-size: 16px !important;\n }\n}\n@keyframes App-logo-spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n";
|
|
74
|
+
var css_248z = ".ant-collapse-header {\n cursor: default !important;\n padding: 0 !important;\n}\n.ant-tag {\n border: none;\n border-radius: 14px;\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;\n font-weight: 500;\n white-space: nowrap;\n margin: 0;\n}\n.ant-tag-blue {\n color: #3b82f6 !important;\n background: #bfdbfe !important;\n}\n.ant-tag-green {\n color: #059669 !important;\n background: #a7f3d0 !important;\n}\n.ant-tag-red {\n color: #ef4444 !important;\n background: #fecaca !important;\n}\n.ant-tag-orange {\n color: #f97316 !important;\n background: #fed7aa !important;\n}\n.ant-tag-yellow {\n color: #f59e0b !important;\n background: #fde68a !important;\n}\n.ant-tag-purple {\n color: #8b5cf6 !important;\n background: #ddd6fe !important;\n}\n.ant-tag-black {\n color: white !important;\n background: black !important;\n}\n.ant-popover {\n z-index: 1050;\n}\n.ant-popover-inner-content {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n max-width: 300px;\n}\n.ant-popover-message-title {\n padding: 0;\n text-align: center;\n font-size: 1rem;\n}\n.ant-popover-buttons {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.ant-btn-link:disabled {\n color: #717d94 !important;\n}\n.ant-btn-link:disabled:hover {\n background-color: transparent !important;\n}\n.ant-input-affix-wrapper .ant-input-prefix {\n transition: color 0.3s;\n}\n.ant-form-item-label {\n text-transform: none !important;\n font-size: 0.75rem;\n padding-bottom: 2px !important;\n}\n.ant-form-item-label > label {\n width: 100%;\n color: #4b5563 !important;\n}\n.ant-form-item-explain-error {\n font-size: 11px;\n min-height: 11px;\n line-height: 11px;\n padding-top: 2px;\n}\n.ant-form-item {\n margin-bottom: 0;\n}\n.ant-notification {\n width: min-content;\n}\n.ant-notification-topRight {\n right: 0 !important;\n left: 0 !important;\n margin-left: auto !important;\n margin-right: auto !important;\n}\n.ant-notification-notice-wrapper {\n width: 350px !important;\n overflow: hidden !important;\n}\n.ant-notification-notice {\n padding: 16px !important;\n width: 350px !important;\n display: flex !important;\n box-shadow: 0px 6px 10px rgba(0, 0, 0, 0.08), 0px 1px 18px rgba(0, 0, 0, 0.08), 0px 3px 5px rgba(0, 0, 0, 0.16) !important;\n}\n.ant-notification-notice-description {\n padding: 0 14px 0 0 !important;\n color: #232323 !important;\n font-size: 14px !important;\n word-break: break-all !important;\n overflow-wrap: break-word !important;\n}\n.ant-notification-notice-success {\n background-color: #edfffa !important;\n}\n.ant-notification-notice-error {\n background-color: #fff8f4 !important;\n}\n.ant-notification-notice-error .ant-notification-notice-message {\n color: #ff6e1c !important;\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji !important;\n font-weight: 500;\n}\n.ant-notification-notice-error .ant-notification-notice-icon {\n color: #ff6e1c;\n}\n.ant-notification-notice-success .ant-notification-notice-message {\n color: #00b76a !important;\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji !important;\n font-weight: 500;\n}\n.ant-notification-notice-success .ant-notification-notice-icon {\n color: #00b76a !important;\n}\n.ant-notification-notice-message {\n margin-bottom: 0 !important;\n}\n.ant-notification-notice-close {\n top: 16px !important;\n right: 16px !important;\n}\n.ant-menu-submenu-popup > .ant-menu .ant-menu-item {\n display: flex !important;\n align-items: center !important;\n}\n.ant-menu-submenu::after {\n display: none !important;\n}\n.ant-drawer-title {\n font-weight: 400 !important;\n}\n.ant-drawer-header-title {\n flex-direction: row-reverse !important;\n align-items: start !important ;\n}\n.ant-drawer-close {\n margin-inline-end: 0 !important;\n}\n@media (min-width: 768px) {\n .ant-input,\n .ant-picker,\n .ant-select,\n .ant-input-affix-wrapper {\n font-size: 1rem !important;\n }\n .ant-drawer-header {\n padding-right: 1.5rem !important;\n padding-left: 1.5rem !important;\n }\n}\n:root {\n --row-background: #ffffff;\n --row-background-alternate: rgba(100, 116, 139, 0.04);\n --row-background-dark: #121212;\n --row-background-alternate-dark: #1e1e1e;\n}\n.plan-step-line {\n height: 1px;\n min-width: 128px;\n background: #717d94;\n}\n.plan-step-number {\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 9999px;\n border: 1px solid #717d94;\n background: white;\n width: 24px;\n height: 24px;\n color: #717d94;\n}\n.plan-step-number.active {\n border: none;\n color: white;\n background: #ff6e1c;\n}\n.hidden {\n display: none;\n}\n.cardElement {\n padding: 8px 11px;\n border: 1px solid #e5e7eb;\n background-color: white;\n font-family: Inter !important;\n}\n.tooltip {\n visibility: hidden;\n position: absolute !important;\n}\n.has-tooltip:hover .tooltip {\n visibility: visible;\n z-index: 100;\n}\n.show-on-hover {\n opacity: 0;\n}\n.show-on-hover-container:hover .show-on-hover {\n opacity: 1;\n}\n.pdf-only {\n display: none !important;\n}\n.notes p {\n margin: 0;\n padding: 0;\n padding-bottom: 0.25rem;\n}\n#form-element #finix-form-container .field-holder label {\n color: #717d94 !important;\n font-size: 12px !important;\n}\n#form-element #finix-form-container > *:first-child,\n#form-element #finix-form-container > *:last-child {\n margin-top: 0 !important;\n}\n#form-element #finix-form-container > *:not(:first-child):not(:last-child) {\n margin-top: 12px !important;\n}\n#form-element #finix-form-container .field-array > * {\n margin-top: 0 !important;\n}\n#form-element #finix-form-container .field-holder .field,\n#form-element #finix-form-container iframe {\n height: 34px !important;\n}\n#form-element #finix-form-container .field {\n margin-top: 0 !important;\n padding-top: 2px !important;\n}\n#form-element #finix-form-container .field-holder .validation {\n font-size: 11px !important;\n color: #ff4d4f !important;\n}\n.icon-path {\n transition: fill 0.3s;\n}\n.shadow-padding-x {\n padding-right: 1rem;\n padding-left: 1rem;\n}\n.shadow-padding-xb {\n padding-right: 1rem;\n padding-left: 1rem;\n padding-bottom: 0.5rem;\n}\n.content-container {\n width: 100%;\n margin: 0 auto;\n}\n@media (min-width: 1220px) {\n .content-container {\n width: 1220px !important;\n margin: 0 auto;\n }\n}\n@media (min-width: 768px) {\n .shadow-padding-x {\n padding-right: 2rem;\n padding-left: 2rem;\n }\n .shadow-padding-xb {\n padding-right: 2rem;\n padding-left: 2rem;\n padding-bottom: 0.5rem;\n }\n .sm\\:flex {\n display: flex !important;\n }\n .sm\\:hidden {\n display: none !important;\n }\n}\n.rotate-45,\n.transform {\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n}\n.shadow,\n.shadow-lg,\n.shadow-md,\n.shadow-none,\n.shadow-sm,\n.shadow-xl {\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n}\n.container {\n width: 100%;\n}\n@media (min-width: 768px) {\n .container {\n max-width: 768px;\n }\n}\n@media (min-width: 1024px) {\n .container {\n max-width: 1024px;\n }\n}\n@media (min-width: 1280px) {\n .container {\n max-width: 1280px;\n }\n}\n@media (min-width: 1536px) {\n .container {\n max-width: 1536px;\n }\n}\n.visible {\n visibility: visible;\n}\n.fixed {\n position: fixed;\n}\n.absolute {\n position: absolute;\n}\n.relative {\n position: relative;\n}\n.bottom-0 {\n bottom: 0px;\n}\n.left-0 {\n left: 0px;\n}\n.right-0 {\n right: 0px;\n}\n.top-0 {\n top: 0px;\n}\n.z-50 {\n z-index: 50;\n}\n.col-span-2 {\n grid-column: span 2 / span 2;\n}\n.col-span-3 {\n grid-column: span 3 / span 3;\n}\n.m-0 {\n margin: 0px;\n}\n.mx-4 {\n margin-left: 1rem;\n margin-right: 1rem;\n}\n.my-12 {\n margin-top: 3rem;\n margin-bottom: 3rem;\n}\n.my-2 {\n margin-top: 0.5rem;\n margin-bottom: 0.5rem;\n}\n.my-4 {\n margin-top: 1rem;\n margin-bottom: 1rem;\n}\n.mb-4 {\n margin-bottom: 1rem;\n}\n.ml-2 {\n margin-left: 0.5rem;\n}\n.mr-8 {\n margin-right: 2rem;\n}\n.mt-1 {\n margin-top: 0.25rem;\n}\n.mt-2 {\n margin-top: 0.5rem;\n}\n.mt-4 {\n margin-top: 1rem;\n}\n.mt-6 {\n margin-top: 1.5rem;\n}\n.mt-8 {\n margin-top: 2rem;\n}\n.block {\n display: block;\n}\n.flex {\n display: flex;\n}\n.table {\n display: table;\n}\n.grid {\n display: grid;\n}\n.contents {\n display: contents;\n}\n.hidden {\n display: none;\n}\n.h-4 {\n height: 1rem;\n}\n.h-5 {\n height: 1.25rem;\n}\n.h-8 {\n height: 2rem;\n}\n.h-full {\n height: 100%;\n}\n.w-1\\/2 {\n width: 50%;\n}\n.w-1\\/3 {\n width: 33.333333%;\n}\n.w-2\\/3 {\n width: 66.666667%;\n}\n.w-4 {\n width: 1rem;\n}\n.w-full {\n width: 100%;\n}\n.max-w-32 {\n max-width: 8rem;\n}\n.flex-1 {\n flex: 1 1 0%;\n}\n.shrink-0 {\n flex-shrink: 0;\n}\n.grow {\n flex-grow: 1;\n}\n.border-collapse {\n border-collapse: collapse;\n}\n.rotate-45 {\n --tw-rotate: 45deg;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n.transform {\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n.cursor-pointer {\n cursor: pointer;\n}\n.grid-cols-2 {\n grid-template-columns: repeat(2, minmax(0, 1fr));\n}\n.grid-cols-3 {\n grid-template-columns: repeat(3, minmax(0, 1fr));\n}\n.flex-row {\n flex-direction: row;\n}\n.flex-col {\n flex-direction: column;\n}\n.items-end {\n align-items: flex-end;\n}\n.items-center {\n align-items: center;\n}\n.justify-start {\n justify-content: flex-start;\n}\n.justify-end {\n justify-content: flex-end;\n}\n.justify-center {\n justify-content: center;\n}\n.justify-between {\n justify-content: space-between;\n}\n.gap-0 {\n gap: 0px;\n}\n.gap-1 {\n gap: 0.25rem;\n}\n.gap-2 {\n gap: 0.5rem;\n}\n.gap-4 {\n gap: 1rem;\n}\n.gap-6 {\n gap: 1.5rem;\n}\n.space-y-2 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(0.5rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(0.5rem * var(--tw-space-y-reverse));\n}\n.space-y-4 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(1rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(1rem * var(--tw-space-y-reverse));\n}\n.space-y-8 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(2rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(2rem * var(--tw-space-y-reverse));\n}\n.overflow-auto {\n overflow: auto;\n}\n.overflow-hidden {\n overflow: hidden;\n}\n.overflow-visible {\n overflow: visible;\n}\n.whitespace-nowrap {\n white-space: nowrap;\n}\n.text-nowrap {\n text-wrap: nowrap;\n}\n.rounded {\n border-radius: 0.25rem;\n}\n.rounded-full {\n border-radius: 9999px;\n}\n.rounded-md {\n border-radius: 0.375rem;\n}\n.border {\n border-width: 1px;\n}\n.border-solid {\n border-style: solid;\n}\n.border-gray-400 {\n --tw-border-opacity: 1;\n border-color: rgb(156 163 175 / var(--tw-border-opacity, 1));\n}\n.border-gray-500 {\n --tw-border-opacity: 1;\n border-color: rgb(107 114 128 / var(--tw-border-opacity, 1));\n}\n.border-slate-200 {\n --tw-border-opacity: 1;\n border-color: rgb(226 232 240 / var(--tw-border-opacity, 1));\n}\n.border-slate-300 {\n --tw-border-opacity: 1;\n border-color: rgb(203 213 225 / var(--tw-border-opacity, 1));\n}\n.border-slate-700 {\n --tw-border-opacity: 1;\n border-color: rgb(51 65 85 / var(--tw-border-opacity, 1));\n}\n.bg-black {\n --tw-bg-opacity: 1;\n background-color: rgb(0 0 0 / var(--tw-bg-opacity, 1));\n}\n.bg-emerald-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(167 243 208 / var(--tw-bg-opacity, 1));\n}\n.bg-green-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(187 247 208 / var(--tw-bg-opacity, 1));\n}\n.bg-orange-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(254 215 170 / var(--tw-bg-opacity, 1));\n}\n.bg-red-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(254 202 202 / var(--tw-bg-opacity, 1));\n}\n.bg-red-500 {\n --tw-bg-opacity: 1;\n background-color: rgb(239 68 68 / var(--tw-bg-opacity, 1));\n}\n.bg-slate-50 {\n --tw-bg-opacity: 1;\n background-color: rgb(248 250 252 / var(--tw-bg-opacity, 1));\n}\n.bg-white {\n --tw-bg-opacity: 1;\n background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));\n}\n.bg-yellow-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(254 240 138 / var(--tw-bg-opacity, 1));\n}\n.p-0 {\n padding: 0px;\n}\n.p-1 {\n padding: 0.25rem;\n}\n.p-2 {\n padding: 0.5rem;\n}\n.p-4 {\n padding: 1rem;\n}\n.p-8 {\n padding: 2rem;\n}\n.px-2 {\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n}\n.px-3 {\n padding-left: 0.75rem;\n padding-right: 0.75rem;\n}\n.px-4 {\n padding-left: 1rem;\n padding-right: 1rem;\n}\n.px-6 {\n padding-left: 1.5rem;\n padding-right: 1.5rem;\n}\n.py-1 {\n padding-top: 0.25rem;\n padding-bottom: 0.25rem;\n}\n.py-2 {\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n}\n.py-4 {\n padding-top: 1rem;\n padding-bottom: 1rem;\n}\n.py-6 {\n padding-top: 1.5rem;\n padding-bottom: 1.5rem;\n}\n.pb-2 {\n padding-bottom: 0.5rem;\n}\n.pb-4 {\n padding-bottom: 1rem;\n}\n.pb-6 {\n padding-bottom: 1.5rem;\n}\n.pb-8 {\n padding-bottom: 2rem;\n}\n.pl-0 {\n padding-left: 0px;\n}\n.pl-2 {\n padding-left: 0.5rem;\n}\n.pl-4 {\n padding-left: 1rem;\n}\n.pt-1 {\n padding-top: 0.25rem;\n}\n.pt-12 {\n padding-top: 3rem;\n}\n.pt-2 {\n padding-top: 0.5rem;\n}\n.pt-4 {\n padding-top: 1rem;\n}\n.pt-5 {\n padding-top: 1.25rem;\n}\n.pt-6 {\n padding-top: 1.5rem;\n}\n.pt-8 {\n padding-top: 2rem;\n}\n.text-left {\n text-align: left;\n}\n.text-center {\n text-align: center;\n}\n.text-right {\n text-align: right;\n}\n.align-middle {\n vertical-align: middle;\n}\n.text-2xl {\n font-size: 1.5rem;\n line-height: 2rem;\n}\n.text-base {\n font-size: 1rem;\n line-height: 1.5rem;\n}\n.text-lg {\n font-size: 1.125rem;\n line-height: 1.75rem;\n}\n.text-sm {\n font-size: 0.875rem;\n line-height: 1.25rem;\n}\n.text-xl {\n font-size: 1.25rem;\n line-height: 1.75rem;\n}\n.text-xs {\n font-size: 0.75rem;\n line-height: 1rem;\n}\n.font-bold {\n font-weight: 700;\n}\n.font-medium {\n font-weight: 500;\n}\n.font-normal {\n font-weight: 400;\n}\n.capitalize {\n text-transform: capitalize;\n}\n.text-emerald-600 {\n --tw-text-opacity: 1;\n color: rgb(5 150 105 / var(--tw-text-opacity, 1));\n}\n.text-emerald-700 {\n --tw-text-opacity: 1;\n color: rgb(4 120 87 / var(--tw-text-opacity, 1));\n}\n.text-gray-600 {\n --tw-text-opacity: 1;\n color: rgb(75 85 99 / var(--tw-text-opacity, 1));\n}\n.text-gray-900 {\n --tw-text-opacity: 1;\n color: rgb(17 24 39 / var(--tw-text-opacity, 1));\n}\n.text-green-600 {\n --tw-text-opacity: 1;\n color: rgb(22 163 74 / var(--tw-text-opacity, 1));\n}\n.text-orange-500 {\n --tw-text-opacity: 1;\n color: rgb(249 115 22 / var(--tw-text-opacity, 1));\n}\n.text-red-500 {\n --tw-text-opacity: 1;\n color: rgb(239 68 68 / var(--tw-text-opacity, 1));\n}\n.text-slate-400 {\n --tw-text-opacity: 1;\n color: rgb(148 163 184 / var(--tw-text-opacity, 1));\n}\n.text-slate-500 {\n --tw-text-opacity: 1;\n color: rgb(100 116 139 / var(--tw-text-opacity, 1));\n}\n.text-white {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity, 1));\n}\n.text-yellow-500 {\n --tw-text-opacity: 1;\n color: rgb(234 179 8 / var(--tw-text-opacity, 1));\n}\n.underline {\n text-decoration-line: underline;\n}\n.shadow {\n --tw-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);\n --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-lg {\n --tw-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);\n --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-md {\n --tw-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);\n --tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-none {\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-sm {\n --tw-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);\n --tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-xl {\n --tw-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);\n --tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.transition {\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.font-light {\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;\n}\n.font-medium {\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;\n}\n.font-bold {\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;\n}\n@media (min-width: 768px) {\n .sm\\:flex {\n display: flex;\n }\n .sm\\:hidden {\n display: none;\n }\n}\n* {\n margin: 0;\n padding: 0;\n box-sizing: border-box !important;\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;\n line-height: 1.15;\n}\nbody {\n color: #232323;\n background-color: #f8fafc;\n}\nth {\n font-weight: normal;\n}\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, \"Courier New\", monospace;\n}\n@media only screen and (max-width: 768px) {\n select,\n textarea,\n input[type=\"text\"],\n input[type=\"password\"],\n input[type=\"datetime\"],\n input[type=\"datetime-local\"],\n input[type=\"date\"],\n input[type=\"month\"],\n input[type=\"time\"],\n input[type=\"week\"],\n input[type=\"number\"],\n input[type=\"email\"],\n input[type=\"url\"],\n input[type=\"search\"],\n input[type=\"tel\"],\n input[type=\"color\"] {\n font-size: 16px !important;\n }\n}\n@keyframes App-logo-spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n";
|
|
75
75
|
styleInject(css_248z);
|
|
76
76
|
|
|
77
77
|
/******************************************************************************
|
|
@@ -1804,6 +1804,48 @@ var quoteMetaTitle = function (_a) {
|
|
|
1804
1804
|
return vendorName + " " + documentName;
|
|
1805
1805
|
};
|
|
1806
1806
|
|
|
1807
|
+
var fetchPDF = function (apiEndpoint, invoiceUuid) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1808
|
+
var response;
|
|
1809
|
+
return __generator(this, function (_a) {
|
|
1810
|
+
switch (_a.label) {
|
|
1811
|
+
case 0:
|
|
1812
|
+
if (!invoiceUuid) {
|
|
1813
|
+
throw new Error("Invoice ID is required to fetch PDF");
|
|
1814
|
+
}
|
|
1815
|
+
return [4 /*yield*/, fetch("".concat(apiEndpoint, "/api/legacy_invoices/").concat(invoiceUuid))];
|
|
1816
|
+
case 1:
|
|
1817
|
+
response = _a.sent();
|
|
1818
|
+
if (!response.ok)
|
|
1819
|
+
throw new Error("Failed to fetch PDF");
|
|
1820
|
+
return [2 /*return*/, response.blob()]; // Return the PDF as a blob
|
|
1821
|
+
}
|
|
1822
|
+
});
|
|
1823
|
+
}); };
|
|
1824
|
+
function InvoicePDF(_a) {
|
|
1825
|
+
var invoiceUuid = _a.invoiceUuid, apiHost = _a.apiHost;
|
|
1826
|
+
var _b = React.useState(undefined), pdfUrl = _b[0], setPdfUrl = _b[1];
|
|
1827
|
+
var _c = reactQuery.useQuery({
|
|
1828
|
+
queryKey: ["invoicePDF", invoiceUuid],
|
|
1829
|
+
queryFn: function () { return fetchPDF(apiHost || "", invoiceUuid); },
|
|
1830
|
+
enabled: Boolean(invoiceUuid),
|
|
1831
|
+
}), pdfBlob = _c.data, isLoading = _c.isLoading;
|
|
1832
|
+
React.useEffect(function () {
|
|
1833
|
+
if (pdfBlob) {
|
|
1834
|
+
var url_1 = URL.createObjectURL(pdfBlob);
|
|
1835
|
+
setPdfUrl(url_1);
|
|
1836
|
+
return function () { return URL.revokeObjectURL(url_1); };
|
|
1837
|
+
}
|
|
1838
|
+
}, [pdfBlob]);
|
|
1839
|
+
if (isLoading || !pdfUrl)
|
|
1840
|
+
return jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
1841
|
+
return (jsxRuntime.jsx("iframe", { src: pdfUrl, style: {
|
|
1842
|
+
border: "none",
|
|
1843
|
+
gridColumn: "1/-1",
|
|
1844
|
+
minHeight: "1000px",
|
|
1845
|
+
minWidth: "780px",
|
|
1846
|
+
}, title: "Invoice PDF", width: "100%" }));
|
|
1847
|
+
}
|
|
1848
|
+
|
|
1807
1849
|
var PaymentContext = React.createContext({});
|
|
1808
1850
|
|
|
1809
1851
|
var paymentMethodsQuery = "query paymentMethods ($filter: String, $first: Int, $sort: String) {\n paymentMethods (filter: $filter, first: $first, sort: $sort) {\n nodes {\n id\n disabled\n pluginId\n accountId\n expirationDate\n plugin {\n guid\n id\n }\n state\n metadata {\n issuer\n identifier\n kind\n description\n icon\n }\n }\n }\n}";
|
|
@@ -1875,289 +1917,110 @@ var getQuoteAmountDue = function (quote) {
|
|
|
1875
1917
|
return quote.amountDue;
|
|
1876
1918
|
};
|
|
1877
1919
|
|
|
1878
|
-
|
|
1879
|
-
var
|
|
1880
|
-
var
|
|
1881
|
-
return { token: "DemoPayTestToken", amount: amount, currency: currency };
|
|
1882
|
-
};
|
|
1883
|
-
var DIGIT_REGEX = /\d/;
|
|
1884
|
-
var isDigit = function (char) { return DIGIT_REGEX.test(char); };
|
|
1885
|
-
var isDeletion = function (char) { return [8, 46].includes(char); }; // Backspace or Delete
|
|
1886
|
-
var isNavigation = function (char) { return [9, 37, 38, 39, 40].includes(char); }; // Tab, Arrows
|
|
1887
|
-
var isModifier = function (char) { return [16, 17, 18].includes(char); }; // Shift, Ctrl, Alt
|
|
1888
|
-
var isValidKey = function (code) {
|
|
1889
|
-
return isDeletion(code) || isNavigation(code) || isModifier(code);
|
|
1890
|
-
};
|
|
1891
|
-
var isValidExpiry = function (expiry) {
|
|
1892
|
-
var month = parseInt(expiry.substring(0, 2), 10);
|
|
1893
|
-
var year = parseInt(expiry.substring(2, 4), 10) + 2000;
|
|
1894
|
-
if (isNaN(month) || isNaN(year))
|
|
1895
|
-
return false;
|
|
1896
|
-
if (month < 1 || month > 12)
|
|
1897
|
-
return false;
|
|
1898
|
-
return true;
|
|
1899
|
-
};
|
|
1900
|
-
var isCardExpired = function (expiry) {
|
|
1901
|
-
var month = parseInt(expiry.substring(0, 2), 10);
|
|
1902
|
-
var year = parseInt(expiry.substring(2, 4), 10) + 2000;
|
|
1903
|
-
var expiryDate = new Date(year, month, 1);
|
|
1904
|
-
return expiryDate < new Date();
|
|
1905
|
-
};
|
|
1906
|
-
var formatCardExpiry = function (cardExpiry) {
|
|
1907
|
-
if (cardExpiry.length <= 2)
|
|
1908
|
-
return cardExpiry;
|
|
1909
|
-
return cardExpiry.substring(0, 2) + "/" + cardExpiry.substring(2);
|
|
1910
|
-
};
|
|
1911
|
-
// removes spaces from a credit card number
|
|
1912
|
-
var unformatCardNumber = function (cardNumber) {
|
|
1913
|
-
var cardNumberArray = cardNumber.split("");
|
|
1914
|
-
var unformattedCardNumberArray = cardNumberArray.filter(function (character) { return character !== " "; });
|
|
1915
|
-
return unformattedCardNumberArray.join("");
|
|
1916
|
-
};
|
|
1917
|
-
var storePayment = function (options, plugin, apiHost, accountId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1918
|
-
var testCreditCardNumber, testCreditCardCvc, testCreditCardExpirationDate, token, response;
|
|
1919
|
-
return __generator(this, function (_a) {
|
|
1920
|
-
switch (_a.label) {
|
|
1921
|
-
case 0:
|
|
1922
|
-
testCreditCardNumber = options.testCreditCardNumber, testCreditCardCvc = options.testCreditCardCvc, testCreditCardExpirationDate = options.testCreditCardExpirationDate, token = options.token;
|
|
1923
|
-
return [4 /*yield*/, common.invokePlugin({
|
|
1924
|
-
method: "store_payment_method",
|
|
1925
|
-
plugin: plugin,
|
|
1926
|
-
payload: {
|
|
1927
|
-
test_credit_card_number: testCreditCardNumber,
|
|
1928
|
-
test_credit_card_cvc: testCreditCardCvc,
|
|
1929
|
-
test_credit_card_expiration_date: testCreditCardExpirationDate,
|
|
1930
|
-
account_id: accountId,
|
|
1931
|
-
},
|
|
1932
|
-
token: token,
|
|
1933
|
-
apiHost: apiHost,
|
|
1934
|
-
})];
|
|
1935
|
-
case 1:
|
|
1936
|
-
response = _a.sent();
|
|
1937
|
-
if ((response === null || response === void 0 ? void 0 : response.status) !== "success")
|
|
1938
|
-
throw new Error(response === null || response === void 0 ? void 0 : response.message);
|
|
1939
|
-
return [2 /*return*/, response];
|
|
1940
|
-
}
|
|
1941
|
-
});
|
|
1942
|
-
}); };
|
|
1943
|
-
|
|
1944
|
-
function usePay$1(_a) {
|
|
1945
|
-
var _this = this;
|
|
1946
|
-
var onPaymentSuccess = _a.onPaymentSuccess, onPaymentError = _a.onPaymentError, quote = _a.quote, invoice = _a.invoice;
|
|
1947
|
-
var pay = function (_a) {
|
|
1948
|
-
var plugin = _a.plugin, savePaymentMethod = _a.savePaymentMethod;
|
|
1949
|
-
return __awaiter(_this, void 0, void 0, function () {
|
|
1950
|
-
var amountDue, currencyId, response;
|
|
1951
|
-
return __generator(this, function (_b) {
|
|
1952
|
-
amountDue = quote ? getQuoteAmountDue(quote) : invoice === null || invoice === void 0 ? void 0 : invoice.amountDue;
|
|
1953
|
-
currencyId = (quote === null || quote === void 0 ? void 0 : quote.currencyId) || (invoice === null || invoice === void 0 ? void 0 : invoice.currency);
|
|
1954
|
-
if (!amountDue || !currencyId) {
|
|
1955
|
-
throw new Error("No amount or currencyId");
|
|
1956
|
-
}
|
|
1957
|
-
try {
|
|
1958
|
-
response = confirmPayment({
|
|
1959
|
-
amount: amountDue,
|
|
1960
|
-
currency: currencyId,
|
|
1961
|
-
});
|
|
1962
|
-
onPaymentSuccess({
|
|
1963
|
-
pluginPaymentResponse: {
|
|
1964
|
-
plugin: plugin,
|
|
1965
|
-
token: response.token,
|
|
1966
|
-
savePaymentMethod: savePaymentMethod,
|
|
1967
|
-
},
|
|
1968
|
-
});
|
|
1969
|
-
}
|
|
1970
|
-
catch (error) {
|
|
1971
|
-
onPaymentError === null || onPaymentError === void 0 ? void 0 : onPaymentError(error);
|
|
1972
|
-
}
|
|
1973
|
-
return [2 /*return*/];
|
|
1974
|
-
});
|
|
1975
|
-
});
|
|
1976
|
-
};
|
|
1977
|
-
return { pay: pay };
|
|
1978
|
-
}
|
|
1979
|
-
|
|
1980
|
-
var createPaymentMethod = function (_a) {
|
|
1981
|
-
var paymentMethodId = _a.paymentMethodId, plugin = _a.plugin, token = _a.token, apiHost = _a.apiHost, accountId = _a.accountId;
|
|
1982
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
1983
|
-
var response;
|
|
1984
|
-
return __generator(this, function (_b) {
|
|
1985
|
-
switch (_b.label) {
|
|
1986
|
-
case 0: return [4 /*yield*/, common.invokePlugin({
|
|
1987
|
-
plugin: plugin,
|
|
1988
|
-
method: "store_payment_method",
|
|
1989
|
-
payload: {
|
|
1990
|
-
payment_method_id: paymentMethodId,
|
|
1991
|
-
account_id: accountId,
|
|
1992
|
-
},
|
|
1993
|
-
token: token,
|
|
1994
|
-
apiHost: apiHost,
|
|
1995
|
-
})];
|
|
1996
|
-
case 1:
|
|
1997
|
-
response = _b.sent();
|
|
1998
|
-
if (response.status !== "success")
|
|
1999
|
-
throw new Error(response.message || "Unknown error");
|
|
2000
|
-
return [2 /*return*/, response];
|
|
2001
|
-
}
|
|
2002
|
-
});
|
|
2003
|
-
});
|
|
2004
|
-
};
|
|
2005
|
-
var createSetupIntent = function (plugin, token, apiHost, accountId) {
|
|
2006
|
-
return common.invokePlugin({
|
|
2007
|
-
plugin: plugin,
|
|
2008
|
-
method: "create_setup_intent",
|
|
2009
|
-
token: token,
|
|
2010
|
-
apiHost: apiHost,
|
|
2011
|
-
payload: {
|
|
2012
|
-
account_id: accountId,
|
|
2013
|
-
},
|
|
2014
|
-
});
|
|
2015
|
-
};
|
|
2016
|
-
var createPaymentIntent = function (_a) {
|
|
2017
|
-
var payable = _a.payable, savePaymentMethod = _a.savePaymentMethod, memo = _a.memo, plugin = _a.plugin, token = _a.token, apiHost = _a.apiHost;
|
|
1920
|
+
var MUTATION$8 = "\n mutation checkout(\n $invoiceId: ID,\n $quoteId: ID,\n $paymentMethodId: ID,\n $paymentMethodData: CheckoutPaymentMethodAttributes\n ) {\n checkout(\n invoiceId: $invoiceId,\n quoteId: $quoteId,\n paymentMethodId: $paymentMethodId,\n paymentMethodData: $paymentMethodData\n ) {\n invoice {\n id\n state\n amount\n amountDue\n }\n payment {\n id\n state\n amount\n }\n paymentApplication {\n id\n invoiceId\n paymentId\n }\n transaction {\n id\n amount\n }\n }\n }\n";
|
|
1921
|
+
var checkout = function (_a) {
|
|
1922
|
+
var quoteId = _a.quoteId, invoiceId = _a.invoiceId, paymentMethodId = _a.paymentMethodId, paymentMethodData = _a.paymentMethodData, token = _a.token, apiHost = _a.apiHost;
|
|
2018
1923
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
2019
|
-
var
|
|
1924
|
+
var mutationVars, response, errors;
|
|
2020
1925
|
return __generator(this, function (_b) {
|
|
2021
1926
|
switch (_b.label) {
|
|
2022
1927
|
case 0:
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
1928
|
+
mutationVars = {
|
|
1929
|
+
quoteId: quoteId,
|
|
1930
|
+
invoiceId: invoiceId,
|
|
1931
|
+
paymentMethodId: paymentMethodId,
|
|
2027
1932
|
};
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
1933
|
+
if (paymentMethodData) {
|
|
1934
|
+
mutationVars.paymentMethodData = __assign(__assign({}, paymentMethodData), { metadata: paymentMethodData.metadata });
|
|
1935
|
+
}
|
|
1936
|
+
return [4 /*yield*/, common.gqlRequest({
|
|
1937
|
+
query: MUTATION$8,
|
|
2032
1938
|
token: token,
|
|
1939
|
+
vars: mutationVars,
|
|
2033
1940
|
apiHost: apiHost,
|
|
2034
1941
|
})];
|
|
2035
1942
|
case 1:
|
|
2036
1943
|
response = _b.sent();
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
1944
|
+
errors = (response === null || response === void 0 ? void 0 : response.checkout).errors;
|
|
1945
|
+
if (errors)
|
|
1946
|
+
throw errors;
|
|
1947
|
+
return [2 /*return*/, {
|
|
1948
|
+
savePaymentMethod: paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.savePaymentMethod,
|
|
1949
|
+
}];
|
|
2040
1950
|
}
|
|
2041
1951
|
});
|
|
2042
1952
|
});
|
|
2043
1953
|
};
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
return pure.loadStripe(payload.publishable_key).then(setStripe);
|
|
2080
|
-
})
|
|
2081
|
-
.catch(function (error) {
|
|
2082
|
-
console.error("Caught Error in fetching stripe key: ", error);
|
|
2083
|
-
showErrorNotification(error.message, "Unexpected Error fetching key");
|
|
1954
|
+
|
|
1955
|
+
function usePay$1(_a) {
|
|
1956
|
+
var _this = this;
|
|
1957
|
+
var onPaymentSuccess = _a.onPaymentSuccess, onPaymentError = _a.onPaymentError, quote = _a.quote, invoice = _a.invoice, storedPaymentMethod = _a.storedPaymentMethod;
|
|
1958
|
+
var _b = React.useContext(BunnyContext), token = _b.token, apiHost = _b.apiHost;
|
|
1959
|
+
var pay = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
1960
|
+
var amountDue, currencyId, response, error_1;
|
|
1961
|
+
return __generator(this, function (_a) {
|
|
1962
|
+
switch (_a.label) {
|
|
1963
|
+
case 0:
|
|
1964
|
+
amountDue = quote ? getQuoteAmountDue(quote) : invoice === null || invoice === void 0 ? void 0 : invoice.amountDue;
|
|
1965
|
+
currencyId = (quote === null || quote === void 0 ? void 0 : quote.currencyId) || (invoice === null || invoice === void 0 ? void 0 : invoice.currency);
|
|
1966
|
+
if (!amountDue || !currencyId) {
|
|
1967
|
+
throw new Error("No amount or currencyId");
|
|
1968
|
+
}
|
|
1969
|
+
_a.label = 1;
|
|
1970
|
+
case 1:
|
|
1971
|
+
_a.trys.push([1, 3, , 4]);
|
|
1972
|
+
return [4 /*yield*/, checkout({
|
|
1973
|
+
invoiceId: invoice === null || invoice === void 0 ? void 0 : invoice.id,
|
|
1974
|
+
quoteId: quote === null || quote === void 0 ? void 0 : quote.id,
|
|
1975
|
+
paymentMethodId: storedPaymentMethod === null || storedPaymentMethod === void 0 ? void 0 : storedPaymentMethod.id,
|
|
1976
|
+
token: token,
|
|
1977
|
+
apiHost: apiHost,
|
|
1978
|
+
})];
|
|
1979
|
+
case 2:
|
|
1980
|
+
response = _a.sent();
|
|
1981
|
+
onPaymentSuccess === null || onPaymentSuccess === void 0 ? void 0 : onPaymentSuccess(response);
|
|
1982
|
+
return [3 /*break*/, 4];
|
|
1983
|
+
case 3:
|
|
1984
|
+
error_1 = _a.sent();
|
|
1985
|
+
onPaymentError === null || onPaymentError === void 0 ? void 0 : onPaymentError(error_1);
|
|
1986
|
+
return [3 /*break*/, 4];
|
|
1987
|
+
case 4: return [2 /*return*/];
|
|
1988
|
+
}
|
|
2084
1989
|
});
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
};
|
|
1990
|
+
}); };
|
|
1991
|
+
return { pay: pay };
|
|
1992
|
+
}
|
|
2089
1993
|
|
|
2090
1994
|
function usePay(_a) {
|
|
2091
1995
|
var _this = this;
|
|
2092
|
-
var onPaymentSuccess = _a.onPaymentSuccess, onPaymentError = _a.onPaymentError, quote = _a.quote, invoice = _a.invoice;
|
|
1996
|
+
var onPaymentSuccess = _a.onPaymentSuccess, onPaymentError = _a.onPaymentError, quote = _a.quote, invoice = _a.invoice, storedPaymentMethod = _a.storedPaymentMethod;
|
|
2093
1997
|
// Hooks
|
|
2094
|
-
var elements = reactStripeJs.useElements();
|
|
2095
|
-
var stripe = reactStripeJs.useStripe();
|
|
2096
1998
|
var _b = React.useContext(BunnyContext), token = _b.token, apiHost = _b.apiHost;
|
|
2097
|
-
var pay = function (
|
|
2098
|
-
var
|
|
2099
|
-
return
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
savePaymentMethod: true,
|
|
2121
|
-
plugin: plugin,
|
|
2122
|
-
token: token,
|
|
2123
|
-
apiHost: apiHost || "",
|
|
2124
|
-
})];
|
|
2125
|
-
case 3:
|
|
2126
|
-
paymentIntent = _c.sent();
|
|
2127
|
-
clientSecret = paymentIntent === null || paymentIntent === void 0 ? void 0 : paymentIntent.client_secret;
|
|
2128
|
-
return [4 /*yield*/, stripe.confirmPayment({
|
|
2129
|
-
elements: elements,
|
|
2130
|
-
clientSecret: clientSecret,
|
|
2131
|
-
redirect: "if_required",
|
|
2132
|
-
confirmParams: {
|
|
2133
|
-
return_url: window.location.href,
|
|
2134
|
-
},
|
|
2135
|
-
})];
|
|
2136
|
-
case 4:
|
|
2137
|
-
response = _c.sent();
|
|
2138
|
-
// See https://stripe.com/docs/payments/save-during-payment?platform=web#web-submit-payment
|
|
2139
|
-
if (response.error)
|
|
2140
|
-
throw new Error(response.error.message);
|
|
2141
|
-
paymentIntentId = (_b = response.paymentIntent) === null || _b === void 0 ? void 0 : _b.id;
|
|
2142
|
-
if (!paymentIntentId)
|
|
2143
|
-
throw new Error("Payment intent couldn't be retrieved");
|
|
2144
|
-
onPaymentSuccess === null || onPaymentSuccess === void 0 ? void 0 : onPaymentSuccess({
|
|
2145
|
-
pluginPaymentResponse: {
|
|
2146
|
-
plugin: plugin,
|
|
2147
|
-
token: paymentIntentId,
|
|
2148
|
-
savePaymentMethod: true,
|
|
2149
|
-
},
|
|
2150
|
-
});
|
|
2151
|
-
return [3 /*break*/, 6];
|
|
2152
|
-
case 5:
|
|
2153
|
-
error_1 = _c.sent();
|
|
2154
|
-
onPaymentError === null || onPaymentError === void 0 ? void 0 : onPaymentError(error_1);
|
|
2155
|
-
return [3 /*break*/, 6];
|
|
2156
|
-
case 6: return [2 /*return*/];
|
|
2157
|
-
}
|
|
2158
|
-
});
|
|
1999
|
+
var pay = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
2000
|
+
var response, error_1;
|
|
2001
|
+
return __generator(this, function (_a) {
|
|
2002
|
+
switch (_a.label) {
|
|
2003
|
+
case 0:
|
|
2004
|
+
_a.trys.push([0, 2, , 3]);
|
|
2005
|
+
return [4 /*yield*/, checkout({
|
|
2006
|
+
invoiceId: invoice === null || invoice === void 0 ? void 0 : invoice.id,
|
|
2007
|
+
quoteId: quote === null || quote === void 0 ? void 0 : quote.id,
|
|
2008
|
+
paymentMethodId: storedPaymentMethod === null || storedPaymentMethod === void 0 ? void 0 : storedPaymentMethod.id,
|
|
2009
|
+
token: token,
|
|
2010
|
+
apiHost: apiHost,
|
|
2011
|
+
})];
|
|
2012
|
+
case 1:
|
|
2013
|
+
response = _a.sent();
|
|
2014
|
+
onPaymentSuccess === null || onPaymentSuccess === void 0 ? void 0 : onPaymentSuccess(response);
|
|
2015
|
+
return [3 /*break*/, 3];
|
|
2016
|
+
case 2:
|
|
2017
|
+
error_1 = _a.sent();
|
|
2018
|
+
onPaymentError === null || onPaymentError === void 0 ? void 0 : onPaymentError(error_1);
|
|
2019
|
+
return [3 /*break*/, 3];
|
|
2020
|
+
case 3: return [2 /*return*/];
|
|
2021
|
+
}
|
|
2159
2022
|
});
|
|
2160
|
-
};
|
|
2023
|
+
}); };
|
|
2161
2024
|
return { pay: pay };
|
|
2162
2025
|
}
|
|
2163
2026
|
|
|
@@ -2166,30 +2029,29 @@ var ActualCheckoutFooter = function (_a) {
|
|
|
2166
2029
|
var quote = _a.quote, invoice = _a.invoice, onPaymentSuccess = _a.onPaymentSuccess, noPadding = _a.noPadding, plugin = _a.plugin;
|
|
2167
2030
|
var isMobile = common.useIsMobile();
|
|
2168
2031
|
var _b = React.useState(false), isPaying = _b[0], setIsPaying = _b[1];
|
|
2032
|
+
var storedPaymentMethod = React.useContext(PaymentContext).storedPaymentMethod;
|
|
2169
2033
|
var amountDue = quote ? getQuoteAmountDue(quote) : invoice === null || invoice === void 0 ? void 0 : invoice.amountDue;
|
|
2170
2034
|
var currencyId = (quote === null || quote === void 0 ? void 0 : quote.currencyId) || (invoice === null || invoice === void 0 ? void 0 : invoice.currency);
|
|
2171
2035
|
// Payment hooks
|
|
2172
2036
|
var payDemoPay = usePay$1({
|
|
2173
|
-
onPaymentSuccess:
|
|
2174
|
-
onPaymentSuccess(response);
|
|
2175
|
-
},
|
|
2037
|
+
onPaymentSuccess: onPaymentSuccess,
|
|
2176
2038
|
onPaymentError: function (error) {
|
|
2177
2039
|
setIsPaying(false);
|
|
2178
|
-
showErrorNotification$1(error);
|
|
2040
|
+
showErrorNotification$1(JSON.stringify(error));
|
|
2179
2041
|
},
|
|
2180
2042
|
quote: quote,
|
|
2181
2043
|
invoice: invoice,
|
|
2044
|
+
storedPaymentMethod: storedPaymentMethod,
|
|
2182
2045
|
}).pay;
|
|
2183
2046
|
var payStripe = usePay({
|
|
2184
|
-
onPaymentSuccess:
|
|
2185
|
-
onPaymentSuccess(response);
|
|
2186
|
-
},
|
|
2047
|
+
onPaymentSuccess: onPaymentSuccess,
|
|
2187
2048
|
onPaymentError: function (error) {
|
|
2188
2049
|
setIsPaying(false);
|
|
2189
|
-
showErrorNotification$1(error);
|
|
2050
|
+
showErrorNotification$1(JSON.stringify(error));
|
|
2190
2051
|
},
|
|
2191
2052
|
quote: quote,
|
|
2192
2053
|
invoice: invoice,
|
|
2054
|
+
storedPaymentMethod: storedPaymentMethod,
|
|
2193
2055
|
}).pay;
|
|
2194
2056
|
var handlePaymentSubmit = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
2195
2057
|
var _a;
|
|
@@ -2199,22 +2061,17 @@ var ActualCheckoutFooter = function (_a) {
|
|
|
2199
2061
|
case 0:
|
|
2200
2062
|
if (!plugin)
|
|
2201
2063
|
return [2 /*return*/];
|
|
2202
|
-
_a = (_c = (_b = plugin
|
|
2064
|
+
_a = (_c = (_b = plugin.components) === null || _b === void 0 ? void 0 : _b.frontend) === null || _c === void 0 ? void 0 : _c[0].name;
|
|
2203
2065
|
switch (_a) {
|
|
2204
2066
|
case "StripePayment": return [3 /*break*/, 1];
|
|
2205
2067
|
case "DemoPayPayment": return [3 /*break*/, 3];
|
|
2206
2068
|
}
|
|
2207
2069
|
return [3 /*break*/, 5];
|
|
2208
|
-
case 1: return [4 /*yield*/, payStripe(
|
|
2209
|
-
plugin: plugin,
|
|
2210
|
-
})];
|
|
2070
|
+
case 1: return [4 /*yield*/, payStripe()];
|
|
2211
2071
|
case 2:
|
|
2212
2072
|
_d.sent();
|
|
2213
2073
|
return [3 /*break*/, 6];
|
|
2214
|
-
case 3: return [4 /*yield*/, payDemoPay(
|
|
2215
|
-
plugin: plugin,
|
|
2216
|
-
savePaymentMethod: false,
|
|
2217
|
-
})];
|
|
2074
|
+
case 3: return [4 /*yield*/, payDemoPay()];
|
|
2218
2075
|
case 4:
|
|
2219
2076
|
_d.sent();
|
|
2220
2077
|
return [3 /*break*/, 6];
|
|
@@ -2229,18 +2086,10 @@ var ActualCheckoutFooter = function (_a) {
|
|
|
2229
2086
|
}, size: isMobile ? "large" : "middle", type: "primary" }, { children: "".concat(isPaying ? "Paying" : "Pay", " ").concat(amountDue && currencyId ? common.formatCurrency(amountDue, currencyId) : "") })) })));
|
|
2230
2087
|
};
|
|
2231
2088
|
var CheckoutFooter = function (_a) {
|
|
2232
|
-
var _b, _c;
|
|
2233
2089
|
var quote = _a.quote, invoice = _a.invoice, onPaymentSuccess = _a.onPaymentSuccess, noPadding = _a.noPadding, plugin = _a.plugin;
|
|
2234
2090
|
if (!plugin)
|
|
2235
2091
|
return null;
|
|
2236
|
-
|
|
2237
|
-
var accountId = React.useContext(PaymentContext).accountId;
|
|
2238
|
-
// If plugin is not stripe, pass undefined to prevent errors
|
|
2239
|
-
var stripePlugin = ((_c = (_b = plugin === null || plugin === void 0 ? void 0 : plugin.components) === null || _b === void 0 ? void 0 : _b.frontend) === null || _c === void 0 ? void 0 : _c[0].name) === "StripePayment"
|
|
2240
|
-
? plugin
|
|
2241
|
-
: undefined;
|
|
2242
|
-
var _e = useStripePlugin(stripePlugin, token, apiHost, accountId), stripe = _e.stripe, options = _e.options;
|
|
2243
|
-
return (jsxRuntime.jsx(reactStripeJs.Elements, __assign({ options: options, stripe: stripe }, { children: jsxRuntime.jsx(ActualCheckoutFooter, { plugin: plugin, invoice: invoice, quote: quote, onPaymentSuccess: onPaymentSuccess, noPadding: noPadding }) })));
|
|
2092
|
+
return (jsxRuntime.jsx(ActualCheckoutFooter, { plugin: plugin, invoice: invoice, quote: quote, onPaymentSuccess: onPaymentSuccess, noPadding: noPadding }));
|
|
2244
2093
|
};
|
|
2245
2094
|
|
|
2246
2095
|
var dayjs_min = {exports: {}};
|
|
@@ -2274,7 +2123,7 @@ var CreditCard = function (_a) {
|
|
|
2274
2123
|
var onClickRemove = _a.onClickRemove, onClickUpdate = _a.onClickUpdate, paymentMethodData = _a.paymentMethodData, _c = _a.shadow, shadow = _c === void 0 ? "shadow-md" : _c, _d = _a.cardEnabled, cardEnabled = _d === void 0 ? true : _d;
|
|
2275
2124
|
var isMobile = common.useIsMobile();
|
|
2276
2125
|
var Wrapper = cardEnabled ? Card : "div";
|
|
2277
|
-
return (jsxRuntime.jsxs(Wrapper, __assign({ className: "".concat(cardEnabled ? shadow : "", " m-0") }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex items-center justify-between gap-4 p-4" }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex items-center gap-4" }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex items-center gap-2" }, { children: [jsxRuntime.jsx(CardImage, { paymentMethodData: paymentMethodData }), jsxRuntime.jsx(Text$f, { children: (_b = paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.metadata) === null || _b === void 0 ? void 0 : _b.
|
|
2126
|
+
return (jsxRuntime.jsxs(Wrapper, __assign({ className: "".concat(cardEnabled ? shadow : "", " m-0") }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex items-center justify-between gap-4 p-4" }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex items-center gap-4" }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex items-center gap-2" }, { children: [jsxRuntime.jsx(CardImage, { paymentMethodData: paymentMethodData }), jsxRuntime.jsx(Text$f, { children: (_b = paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.metadata) === null || _b === void 0 ? void 0 : _b.identifier })] })), jsxRuntime.jsx(antd.Tag, __assign({ color: isExpired(paymentMethodData) ? "red" : "green" }, { children: isExpired(paymentMethodData) ? "Expired" : "Valid" }))] })), !isMobile && (jsxRuntime.jsx(CardActions, { onClickRemove: onClickRemove, onClickUpdate: onClickUpdate }))] })), dayjs(paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.expirationDate).isValid() && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(antd.Divider, {}), jsxRuntime.jsxs("div", __assign({ className: "flex flex-col p-4" }, { children: [jsxRuntime.jsx(CardAttribute, { title: "EXPIRATION", value: expirationDate(paymentMethodData) }), isMobile && (jsxRuntime.jsx(CardActions, { onClickRemove: onClickRemove, onClickUpdate: onClickUpdate }))] }))] }))] })));
|
|
2278
2127
|
};
|
|
2279
2128
|
var MiniCreditCard = function (_a) {
|
|
2280
2129
|
var _b;
|
|
@@ -2286,7 +2135,7 @@ var MiniCreditCard = function (_a) {
|
|
|
2286
2135
|
var backgroundColor = React.useMemo(function () {
|
|
2287
2136
|
return darkMode ? "var(--row-background-alternate)" : "bg-slate-50";
|
|
2288
2137
|
}, [darkMode]);
|
|
2289
|
-
return (jsxRuntime.jsx("div", __assign({ className: "flex flex-row justify-between items-center p-1 px-3 border-solid ".concat(backgroundColor, " ").concat(borderColor, " rounded-md border") }, { children: paymentMethodData ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.
|
|
2138
|
+
return (jsxRuntime.jsx("div", __assign({ className: "flex flex-row justify-between items-center p-1 px-3 border-solid ".concat(backgroundColor, " ").concat(borderColor, " rounded-md border") }, { children: paymentMethodData ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", __assign({ className: "flex flex-row gap-4" }, { children: jsxRuntime.jsxs("div", __assign({ className: "flex items-center gap-4 space-between w-full" }, { children: [jsxRuntime.jsx(CardImage, { paymentMethodData: paymentMethodData }), jsxRuntime.jsx(Text$f, { children: (_b = paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.metadata) === null || _b === void 0 ? void 0 : _b.identifier }), jsxRuntime.jsx(antd.Tag, __assign({ color: isExpired(paymentMethodData) ? "red" : "green" }, { children: isExpired(paymentMethodData) ? "Expired" : "Valid" }))] })) })), !hideRemoveButton && (jsxRuntime.jsx(antd.Popconfirm, __assign({ title: "Remove card?", onConfirm: onClickRemove }, { children: jsxRuntime.jsx(antd.Button, __assign({ className: "font-normal p-0", type: "link" }, { children: "Remove" })) })))] })) : (jsxRuntime.jsxs("div", __assign({ className: "flex flex-row gap-2 items-center" }, { children: [jsxRuntime.jsx(CreditCardOutlined$1, {}), jsxRuntime.jsx(Text$f, __assign({ className: "text-slate-400", style: { fontSize: "11px" } }, { children: "No payment method selected" })), jsxRuntime.jsx(antd.Button, { disabled: true, type: "link" })] }))) })));
|
|
2290
2139
|
};
|
|
2291
2140
|
var CardImage = function (_a) {
|
|
2292
2141
|
var _b, _c;
|
|
@@ -2332,6 +2181,67 @@ var SavePaymentMethodFooter = function (_a) {
|
|
|
2332
2181
|
return (jsxRuntime.jsxs("div", __assign({ className: "flex justify-end gap-2 ".concat(noPadding ? "" : "pt-6") }, { children: [onClickCancel && (jsxRuntime.jsx(antd.Button, __assign({ className: "w-full", size: isMobile ? "large" : "middle", onClick: function () { return onClickCancel(); } }, { children: "Cancel" }))), jsxRuntime.jsx(antd.Button, __assign({ className: "w-full", disabled: isSaving, onClick: onSave, size: isMobile ? "large" : "middle", type: "primary" }, { children: isSaving ? "Saving" : "Save" }))] })));
|
|
2333
2182
|
};
|
|
2334
2183
|
|
|
2184
|
+
var DIGIT_REGEX = /\d/;
|
|
2185
|
+
var isDigit = function (char) { return DIGIT_REGEX.test(char); };
|
|
2186
|
+
var isDeletion = function (char) { return [8, 46].includes(char); }; // Backspace or Delete
|
|
2187
|
+
var isNavigation = function (char) { return [9, 37, 38, 39, 40].includes(char); }; // Tab, Arrows
|
|
2188
|
+
var isModifier = function (char) { return [16, 17, 18].includes(char); }; // Shift, Ctrl, Alt
|
|
2189
|
+
var isValidKey = function (code) {
|
|
2190
|
+
return isDeletion(code) || isNavigation(code) || isModifier(code);
|
|
2191
|
+
};
|
|
2192
|
+
var isValidExpiry = function (expiry) {
|
|
2193
|
+
var month = parseInt(expiry.substring(0, 2), 10);
|
|
2194
|
+
var year = parseInt(expiry.substring(2, 4), 10) + 2000;
|
|
2195
|
+
if (isNaN(month) || isNaN(year))
|
|
2196
|
+
return false;
|
|
2197
|
+
if (month < 1 || month > 12)
|
|
2198
|
+
return false;
|
|
2199
|
+
return true;
|
|
2200
|
+
};
|
|
2201
|
+
var isCardExpired = function (expiry) {
|
|
2202
|
+
var month = parseInt(expiry.substring(0, 2), 10);
|
|
2203
|
+
var year = parseInt(expiry.substring(2, 4), 10) + 2000;
|
|
2204
|
+
var expiryDate = new Date(year, month, 1);
|
|
2205
|
+
return expiryDate < new Date();
|
|
2206
|
+
};
|
|
2207
|
+
var formatCardExpiry = function (cardExpiry) {
|
|
2208
|
+
if (cardExpiry.length <= 2)
|
|
2209
|
+
return cardExpiry;
|
|
2210
|
+
return cardExpiry.substring(0, 2) + "/" + cardExpiry.substring(2);
|
|
2211
|
+
};
|
|
2212
|
+
// removes spaces from a credit card number
|
|
2213
|
+
var unformatCardNumber = function (cardNumber) {
|
|
2214
|
+
var cardNumberArray = cardNumber.split("");
|
|
2215
|
+
var unformattedCardNumberArray = cardNumberArray.filter(function (character) { return character !== " "; });
|
|
2216
|
+
return unformattedCardNumberArray.join("");
|
|
2217
|
+
};
|
|
2218
|
+
var storePayment = function (options, plugin, apiHost, accountId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
2219
|
+
var testCreditCardNumber, testCreditCardCvc, testCreditCardExpirationDate, token, response;
|
|
2220
|
+
return __generator(this, function (_a) {
|
|
2221
|
+
switch (_a.label) {
|
|
2222
|
+
case 0:
|
|
2223
|
+
testCreditCardNumber = options.testCreditCardNumber, testCreditCardCvc = options.testCreditCardCvc, testCreditCardExpirationDate = options.testCreditCardExpirationDate, token = options.token;
|
|
2224
|
+
return [4 /*yield*/, common.invokePlugin({
|
|
2225
|
+
method: "store_payment_method",
|
|
2226
|
+
plugin: plugin,
|
|
2227
|
+
payload: {
|
|
2228
|
+
test_credit_card_number: testCreditCardNumber,
|
|
2229
|
+
test_credit_card_cvc: testCreditCardCvc,
|
|
2230
|
+
test_credit_card_expiration_date: testCreditCardExpirationDate,
|
|
2231
|
+
account_id: accountId,
|
|
2232
|
+
},
|
|
2233
|
+
token: token,
|
|
2234
|
+
apiHost: apiHost,
|
|
2235
|
+
})];
|
|
2236
|
+
case 1:
|
|
2237
|
+
response = _a.sent();
|
|
2238
|
+
if ((response === null || response === void 0 ? void 0 : response.status) !== "success")
|
|
2239
|
+
throw new Error(response === null || response === void 0 ? void 0 : response.message);
|
|
2240
|
+
return [2 /*return*/, response];
|
|
2241
|
+
}
|
|
2242
|
+
});
|
|
2243
|
+
}); };
|
|
2244
|
+
|
|
2335
2245
|
var DemoPayCardCvc = function (_a) {
|
|
2336
2246
|
var autoFocus = _a.autoFocus, onChange = _a.onChange, placeholder = _a.placeholder, value = _a.value;
|
|
2337
2247
|
var onKeyPress = function (event) {
|
|
@@ -2497,6 +2407,91 @@ var StyledInputs = styled__default["default"].div(templateObject_1$7 || (templat
|
|
|
2497
2407
|
});
|
|
2498
2408
|
var templateObject_1$7;
|
|
2499
2409
|
|
|
2410
|
+
var createPaymentMethod = function (_a) {
|
|
2411
|
+
var paymentMethodId = _a.paymentMethodId, plugin = _a.plugin, token = _a.token, apiHost = _a.apiHost, accountId = _a.accountId;
|
|
2412
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
2413
|
+
var response;
|
|
2414
|
+
return __generator(this, function (_b) {
|
|
2415
|
+
switch (_b.label) {
|
|
2416
|
+
case 0: return [4 /*yield*/, common.invokePlugin({
|
|
2417
|
+
plugin: plugin,
|
|
2418
|
+
method: "store_payment_method",
|
|
2419
|
+
payload: {
|
|
2420
|
+
payment_method_id: paymentMethodId,
|
|
2421
|
+
account_id: accountId,
|
|
2422
|
+
},
|
|
2423
|
+
token: token,
|
|
2424
|
+
apiHost: apiHost,
|
|
2425
|
+
})];
|
|
2426
|
+
case 1:
|
|
2427
|
+
response = _b.sent();
|
|
2428
|
+
if (response.status !== "success")
|
|
2429
|
+
throw new Error(response.message || "Unknown error");
|
|
2430
|
+
return [2 /*return*/, response];
|
|
2431
|
+
}
|
|
2432
|
+
});
|
|
2433
|
+
});
|
|
2434
|
+
};
|
|
2435
|
+
var createSetupIntent = function (plugin, token, apiHost, accountId) {
|
|
2436
|
+
return common.invokePlugin({
|
|
2437
|
+
plugin: plugin,
|
|
2438
|
+
method: "create_setup_intent",
|
|
2439
|
+
token: token,
|
|
2440
|
+
apiHost: apiHost,
|
|
2441
|
+
payload: {
|
|
2442
|
+
account_id: accountId,
|
|
2443
|
+
},
|
|
2444
|
+
});
|
|
2445
|
+
};
|
|
2446
|
+
var fetchStripeKey = function (plugin, token, apiHost, accountId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
2447
|
+
var response;
|
|
2448
|
+
return __generator(this, function (_a) {
|
|
2449
|
+
switch (_a.label) {
|
|
2450
|
+
case 0: return [4 /*yield*/, common.invokePlugin({
|
|
2451
|
+
plugin: plugin,
|
|
2452
|
+
method: "retrieve_config",
|
|
2453
|
+
token: token,
|
|
2454
|
+
apiHost: apiHost,
|
|
2455
|
+
payload: {
|
|
2456
|
+
account_id: accountId,
|
|
2457
|
+
},
|
|
2458
|
+
})];
|
|
2459
|
+
case 1:
|
|
2460
|
+
response = _a.sent();
|
|
2461
|
+
return [2 /*return*/, response];
|
|
2462
|
+
}
|
|
2463
|
+
});
|
|
2464
|
+
}); };
|
|
2465
|
+
pure.loadStripe.setLoadParameters({ advancedFraudSignals: false });
|
|
2466
|
+
var useStripePlugin = function (plugin, token, apiHost, accountId) {
|
|
2467
|
+
var _a = React.useState(null), stripe = _a[0], setStripe = _a[1];
|
|
2468
|
+
var showErrorNotification = common.useErrorNotification();
|
|
2469
|
+
var options = {
|
|
2470
|
+
mode: "setup",
|
|
2471
|
+
// TODO: Fetch currency from the entity/account
|
|
2472
|
+
currency: "usd",
|
|
2473
|
+
setupFutureUsage: "off_session",
|
|
2474
|
+
};
|
|
2475
|
+
React.useEffect(function () {
|
|
2476
|
+
var _a, _b;
|
|
2477
|
+
if (!plugin)
|
|
2478
|
+
return;
|
|
2479
|
+
if (((_b = (_a = plugin.components) === null || _a === void 0 ? void 0 : _a.frontend) === null || _b === void 0 ? void 0 : _b[0].name) !== "StripePayment")
|
|
2480
|
+
return;
|
|
2481
|
+
fetchStripeKey(plugin, token, apiHost || "", accountId)
|
|
2482
|
+
.then(function (_a) {
|
|
2483
|
+
var payload = _a.payload;
|
|
2484
|
+
return pure.loadStripe(payload.publishable_key).then(setStripe);
|
|
2485
|
+
})
|
|
2486
|
+
.catch(function (error) {
|
|
2487
|
+
console.error("Caught Error in fetching stripe key: ", error);
|
|
2488
|
+
showErrorNotification(error.message, "Unexpected Error fetching key");
|
|
2489
|
+
});
|
|
2490
|
+
// eslint-disable-next-line
|
|
2491
|
+
}, [plugin, token]);
|
|
2492
|
+
return { stripe: stripe, options: options };
|
|
2493
|
+
};
|
|
2494
|
+
|
|
2500
2495
|
function useSave(_a) {
|
|
2501
2496
|
var _this = this;
|
|
2502
2497
|
var onSaveSuccess = _a.onSaveSuccess;
|
|
@@ -2615,12 +2610,7 @@ var PaymentMethodForm = function (_a) {
|
|
|
2615
2610
|
// This is just a wrapper to fetch the stripe object and pass it to the form
|
|
2616
2611
|
var StripeForm = function (_a) {
|
|
2617
2612
|
var plugin = _a.plugin, onFail = _a.onFail, onSavePaymentMethod = _a.onSavePaymentMethod;
|
|
2618
|
-
|
|
2619
|
-
var accountId = React.useContext(PaymentContext).accountId;
|
|
2620
|
-
var _c = useStripePlugin(plugin, token, apiHost, accountId), stripe = _c.stripe, options = _c.options;
|
|
2621
|
-
if (!stripe)
|
|
2622
|
-
return null;
|
|
2623
|
-
return (jsxRuntime.jsx(reactStripeJs.Elements, __assign({ options: options, stripe: stripe }, { children: jsxRuntime.jsx(PaymentMethodForm, { plugin: plugin, onFail: onFail, onSavePaymentMethod: onSavePaymentMethod }) })));
|
|
2613
|
+
return (jsxRuntime.jsx(PaymentMethodForm, { plugin: plugin, onFail: onFail, onSavePaymentMethod: onSavePaymentMethod }));
|
|
2624
2614
|
};
|
|
2625
2615
|
|
|
2626
2616
|
var PaymentMethodDetails = function (_a) {
|
|
@@ -2646,17 +2636,17 @@ var CardIcon = function () {
|
|
|
2646
2636
|
var Text$d = antd.Typography.Text;
|
|
2647
2637
|
var PaymentMethodSelector = function (_a) {
|
|
2648
2638
|
var paymentMethodAllowedPlugins = _a.paymentMethodAllowedPlugins, onSelect = _a.onSelect, value = _a.value;
|
|
2649
|
-
return (jsxRuntime.jsx("div", __assign({ className: "flex flex-col gap-2" }, { children: paymentMethodAllowedPlugins === null || paymentMethodAllowedPlugins === void 0 ? void 0 : paymentMethodAllowedPlugins.map(function (plugin, index) { return (jsxRuntime.jsx(PaymentOption, { name: plugin.name, onClick: onSelect,
|
|
2639
|
+
return (jsxRuntime.jsx("div", __assign({ className: "flex flex-col gap-2" }, { children: paymentMethodAllowedPlugins === null || paymentMethodAllowedPlugins === void 0 ? void 0 : paymentMethodAllowedPlugins.map(function (plugin, index) { return (jsxRuntime.jsx(PaymentOption, { name: plugin.name, onClick: onSelect, paymentPlugin: plugin, selected: (value === null || value === void 0 ? void 0 : value.id) === plugin.id }, index)); }) })));
|
|
2650
2640
|
};
|
|
2651
2641
|
var PaymentOption = function (_a) {
|
|
2652
|
-
var selected = _a.selected,
|
|
2642
|
+
var selected = _a.selected, paymentPlugin = _a.paymentPlugin, onClick = _a.onClick, name = _a.name;
|
|
2653
2643
|
var brandColor = React.useContext(BrandContext).brandColor;
|
|
2654
2644
|
var darkMode = React.useContext(BunnyContext).darkMode;
|
|
2655
2645
|
var isAch = name === null || name === void 0 ? void 0 : name.toLowerCase().includes("ach");
|
|
2656
2646
|
var isCard = name === null || name === void 0 ? void 0 : name.toLowerCase().includes("card");
|
|
2657
2647
|
return (jsxRuntime.jsxs(PaymentOptionContainer, __assign({ "$brandColor": brandColor, "$selected": selected, className: "flex justify-between items-center w-full cursor-pointer py-2 px-4 rounded border-solid ".concat(darkMode
|
|
2658
2648
|
? "var(--row-background-dark) border-gray-500"
|
|
2659
|
-
: "bg-slate-50 border-slate-200", " border"), onClick: function () { return onClick(
|
|
2649
|
+
: "bg-slate-50 border-slate-200", " border"), onClick: function () { return onClick(paymentPlugin); } }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex gap-2 items-center" }, { children: [jsxRuntime.jsx(antd.Checkbox, { checked: selected, className: darkMode ? "border-gray-400" : "" }), jsxRuntime.jsx(Text$d, { children: name })] })), isAch ? (jsxRuntime.jsx(BankOutlined$1, { className: "text-slate-400" })) : isCard ? (jsxRuntime.jsx(CardIcon, {})) : (jsxRuntime.jsx(CardIcon, {}))] })));
|
|
2660
2650
|
};
|
|
2661
2651
|
var PaymentOptionContainer = styled__default["default"].div(templateObject_1$6 || (templateObject_1$6 = __makeTemplateObject(["\n transition: border 0.3s ease;\n\n ", "\n\n &:hover {\n border-color: ", ";\n }\n"], ["\n transition: border 0.3s ease;\n\n ", "\n\n &:hover {\n border-color: ", ";\n }\n"])), function (_a) {
|
|
2662
2652
|
var $brandColor = _a.$brandColor, $selected = _a.$selected;
|
|
@@ -2718,7 +2708,7 @@ var PaymentForm = function (_a) {
|
|
|
2718
2708
|
selectedPaymentMethod) {
|
|
2719
2709
|
return;
|
|
2720
2710
|
}
|
|
2721
|
-
var pluginPaymentMethod = paymentMethodAllowedPlugins === null || paymentMethodAllowedPlugins === void 0 ? void 0 : paymentMethodAllowedPlugins.find(function (plugin) { var _a; return plugin.
|
|
2711
|
+
var pluginPaymentMethod = paymentMethodAllowedPlugins === null || paymentMethodAllowedPlugins === void 0 ? void 0 : paymentMethodAllowedPlugins.find(function (plugin) { var _a, _b, _c; return ((_a = plugin.id) === null || _a === void 0 ? void 0 : _a.toString()) === ((_c = (_b = storedPaymentMethod === null || storedPaymentMethod === void 0 ? void 0 : storedPaymentMethod.plugin) === null || _b === void 0 ? void 0 : _b.id) === null || _c === void 0 ? void 0 : _c.toString()); });
|
|
2722
2712
|
if (pluginPaymentMethod) {
|
|
2723
2713
|
setSelectedPaymentMethod(pluginPaymentMethod);
|
|
2724
2714
|
}
|
|
@@ -2737,18 +2727,10 @@ var PaymentForm = function (_a) {
|
|
|
2737
2727
|
var pluginCount = (paymentMethodAllowedPlugins === null || paymentMethodAllowedPlugins === void 0 ? void 0 : paymentMethodAllowedPlugins.length) || 0;
|
|
2738
2728
|
return pluginCount > 1;
|
|
2739
2729
|
}, [paymentMethodAllowedPlugins]);
|
|
2740
|
-
var handlePaymentSuccess = function (
|
|
2741
|
-
var pluginPaymentResponse = _a.pluginPaymentResponse, savedPaymentMethodResponse = _a.savedPaymentMethodResponse;
|
|
2730
|
+
var handlePaymentSuccess = function () {
|
|
2742
2731
|
// Hide payment method selector and form
|
|
2743
2732
|
setShowPaymentMethodForm(false);
|
|
2744
|
-
|
|
2745
|
-
var paymentMethod = paymentMethodAllowedPlugins === null || paymentMethodAllowedPlugins === void 0 ? void 0 : paymentMethodAllowedPlugins.find(function (plugin) { var _a; return plugin.id === ((_a = pluginPaymentResponse === null || pluginPaymentResponse === void 0 ? void 0 : pluginPaymentResponse.plugin) === null || _a === void 0 ? void 0 : _a.id); });
|
|
2746
|
-
setSelectedPaymentMethod(paymentMethod);
|
|
2747
|
-
// Handle success keeps going up component tree
|
|
2748
|
-
onPaymentSuccess === null || onPaymentSuccess === void 0 ? void 0 : onPaymentSuccess({
|
|
2749
|
-
pluginPaymentResponse: pluginPaymentResponse,
|
|
2750
|
-
savedPaymentMethodResponse: savedPaymentMethodResponse,
|
|
2751
|
-
});
|
|
2733
|
+
onPaymentSuccess === null || onPaymentSuccess === void 0 ? void 0 : onPaymentSuccess();
|
|
2752
2734
|
};
|
|
2753
2735
|
var handleSavePaymentMethod = function () {
|
|
2754
2736
|
queryClient.invalidateQueries({
|
|
@@ -2761,156 +2743,17 @@ var PaymentForm = function (_a) {
|
|
|
2761
2743
|
onClickCancel: function () { return setShowPaymentMethodForm(false); },
|
|
2762
2744
|
accountId: accountId,
|
|
2763
2745
|
overrideToken: overrideToken,
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
};
|
|
2770
|
-
|
|
2771
|
-
var MUTATION$8 = "\n mutation checkout(\n $invoiceId: ID,\n $quoteId: ID,\n $paymentMethodId: ID,\n $paymentMethodData: CheckoutPaymentMethodAttributes\n ) {\n checkout(\n invoiceId: $invoiceId,\n quoteId: $quoteId,\n paymentMethodId: $paymentMethodId,\n paymentMethodData: $paymentMethodData\n ) {\n invoice {\n id\n state\n amount\n amountDue\n }\n payment {\n id\n state\n amount\n }\n paymentApplication {\n id\n invoiceId\n paymentId\n }\n transaction {\n id\n amount\n }\n }\n }\n";
|
|
2772
|
-
var checkout = function (_a) {
|
|
2773
|
-
var quoteId = _a.quoteId, invoiceId = _a.invoiceId, paymentMethodId = _a.paymentMethodId, paymentMethodData = _a.paymentMethodData, token = _a.token, apiHost = _a.apiHost;
|
|
2774
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
2775
|
-
var mutationVars, response, errors;
|
|
2776
|
-
return __generator(this, function (_b) {
|
|
2777
|
-
switch (_b.label) {
|
|
2778
|
-
case 0:
|
|
2779
|
-
mutationVars = {
|
|
2780
|
-
quoteId: quoteId,
|
|
2781
|
-
invoiceId: invoiceId,
|
|
2782
|
-
paymentMethodId: paymentMethodId,
|
|
2783
|
-
};
|
|
2784
|
-
if (paymentMethodData) {
|
|
2785
|
-
mutationVars.paymentMethodData = __assign(__assign({}, paymentMethodData), { metadata: paymentMethodData.metadata });
|
|
2786
|
-
}
|
|
2787
|
-
return [4 /*yield*/, common.gqlRequest({
|
|
2788
|
-
query: MUTATION$8,
|
|
2789
|
-
token: token,
|
|
2790
|
-
vars: mutationVars,
|
|
2791
|
-
apiHost: apiHost,
|
|
2792
|
-
})];
|
|
2793
|
-
case 1:
|
|
2794
|
-
response = _b.sent();
|
|
2795
|
-
errors = (response === null || response === void 0 ? void 0 : response.checkout).errors;
|
|
2796
|
-
if (errors)
|
|
2797
|
-
throw errors;
|
|
2798
|
-
return [2 /*return*/, {
|
|
2799
|
-
savePaymentMethod: paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.savePaymentMethod,
|
|
2800
|
-
}];
|
|
2801
|
-
}
|
|
2802
|
-
});
|
|
2803
|
-
});
|
|
2804
|
-
};
|
|
2805
|
-
|
|
2806
|
-
var InvoiceCheckout = function (_a) {
|
|
2807
|
-
var onSuccess = _a.onSuccess, onFail = _a.onFail, invoice = _a.invoice, entityId = _a.entityId;
|
|
2808
|
-
var _b = React.useContext(BunnyContext), apiHost = _b.apiHost, token = _b.token, graphQLClient = _b.graphQLClient;
|
|
2809
|
-
var checkoutMutation = reactQuery.useMutation({
|
|
2810
|
-
mutationFn: function (_a) {
|
|
2811
|
-
var pluginPaymentMethod = _a.pluginPaymentMethod, savedPaymentMethod = _a.savedPaymentMethod;
|
|
2812
|
-
if (savedPaymentMethod) {
|
|
2813
|
-
var paymentMethodId = savedPaymentMethod.paymentMethodId;
|
|
2814
|
-
return checkout({
|
|
2815
|
-
invoiceId: invoice === null || invoice === void 0 ? void 0 : invoice.id,
|
|
2816
|
-
paymentMethodId: paymentMethodId,
|
|
2817
|
-
token: token,
|
|
2818
|
-
apiHost: apiHost,
|
|
2819
|
-
});
|
|
2820
|
-
}
|
|
2821
|
-
else if (pluginPaymentMethod) {
|
|
2822
|
-
var plugin = pluginPaymentMethod.plugin, savePaymentMethod = pluginPaymentMethod.savePaymentMethod, metadata = pluginPaymentMethod.metadata;
|
|
2823
|
-
var paymentToken = pluginPaymentMethod.token;
|
|
2824
|
-
return checkout({
|
|
2825
|
-
invoiceId: invoice === null || invoice === void 0 ? void 0 : invoice.id,
|
|
2826
|
-
paymentMethodData: {
|
|
2827
|
-
metadata: metadata,
|
|
2828
|
-
pluginGuid: plugin.guid,
|
|
2829
|
-
savePaymentMethod: savePaymentMethod,
|
|
2830
|
-
token: paymentToken,
|
|
2831
|
-
},
|
|
2832
|
-
token: token,
|
|
2833
|
-
apiHost: apiHost,
|
|
2834
|
-
});
|
|
2835
|
-
}
|
|
2836
|
-
else
|
|
2837
|
-
throw new Error("No payment method provided");
|
|
2838
|
-
},
|
|
2839
|
-
onSuccess: onSuccess,
|
|
2840
|
-
onError: onFail,
|
|
2841
|
-
});
|
|
2842
|
-
// Handlers
|
|
2843
|
-
var handleCheckout = function (_a) {
|
|
2844
|
-
var pluginPaymentResponse = _a.pluginPaymentResponse, savedPaymentMethodResponse = _a.savedPaymentMethodResponse;
|
|
2845
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
2846
|
-
var token_1, plugin, savePaymentMethod, metadata, paymentMethodId;
|
|
2847
|
-
return __generator(this, function (_b) {
|
|
2848
|
-
if (pluginPaymentResponse) {
|
|
2849
|
-
token_1 = pluginPaymentResponse.token, plugin = pluginPaymentResponse.plugin, savePaymentMethod = pluginPaymentResponse.savePaymentMethod, metadata = pluginPaymentResponse.metadata;
|
|
2850
|
-
checkoutMutation.mutate({
|
|
2851
|
-
pluginPaymentMethod: {
|
|
2852
|
-
savePaymentMethod: savePaymentMethod,
|
|
2853
|
-
plugin: plugin,
|
|
2854
|
-
metadata: metadata,
|
|
2855
|
-
token: token_1,
|
|
2856
|
-
},
|
|
2857
|
-
});
|
|
2858
|
-
}
|
|
2859
|
-
else if (savedPaymentMethodResponse) {
|
|
2860
|
-
paymentMethodId = savedPaymentMethodResponse.paymentMethodId;
|
|
2861
|
-
checkoutMutation.mutate({
|
|
2862
|
-
savedPaymentMethod: {
|
|
2863
|
-
paymentMethodId: paymentMethodId,
|
|
2864
|
-
},
|
|
2865
|
-
});
|
|
2866
|
-
}
|
|
2867
|
-
return [2 /*return*/];
|
|
2868
|
-
});
|
|
2869
|
-
});
|
|
2870
|
-
};
|
|
2871
|
-
return (jsxRuntime.jsx("div", __assign({ className: "w-full pt-12" }, { children: jsxRuntime.jsx(PaymentForm, { entityId: entityId, onPaymentSuccess: handleCheckout, onFail: onFail, invoice: invoice, graphQLClient: graphQLClient }) })));
|
|
2746
|
+
storedPaymentMethod: storedPaymentMethod,
|
|
2747
|
+
} }, { children: jsxRuntime.jsx(StripeWrapper, __assign({ plugin: selectedPaymentMethod, token: token, apiHost: apiHost, accountId: accountId }, { children: jsxRuntime.jsx("div", __assign({ className: "flex flex-col gap-0 w-full" }, { children: jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", __assign({ className: "px-4" }, { children: jsxRuntime.jsx(MiniCreditCard, { onClickRemove: function () { return onClickRemove(storedPaymentMethod); }, paymentMethodData: storedPaymentMethod }) })), paying && storedPaymentMethod ? (jsxRuntime.jsx("div", __assign({ className: "px-4" }, { children: jsxRuntime.jsx(CheckoutFooter, { quote: quote, invoice: invoice, onPaymentSuccess: handlePaymentSuccess, plugin: selectedPaymentMethod }) }))) : (
|
|
2748
|
+
//if not paying and payment method is saved, show Collapse
|
|
2749
|
+
jsxRuntime.jsx(antd.Collapse, __assign({ bordered: false, activeKey: showPaymentMethodForm ? "1" : undefined, ghost: true, collapsible: "disabled", destroyInactivePanel: true }, { children: jsxRuntime.jsx(Panel, __assign({ header: jsxRuntime.jsx(jsxRuntime.Fragment, { children: !showPaymentMethodForm ? (jsxRuntime.jsx("div", __assign({ className: "pt-4 px-4" }, { children: jsxRuntime.jsxs(antd.Button, __assign({ onClick: function () {
|
|
2750
|
+
setShowPaymentMethodForm(true);
|
|
2751
|
+
}, type: "default", className: "w-full" }, { children: [storedPaymentMethod ? "Update" : "Add", " payment method"] })) }))) : null }), showArrow: false }, { children: jsxRuntime.jsx("div", { children: selectedPaymentMethod ? (jsxRuntime.jsxs("div", __assign({ className: "flex flex-col gap-2 mt-2" }, { children: [showPaymentMethodSelector && (jsxRuntime.jsx(PaymentMethodSelector, { onSelect: setSelectedPaymentMethod, paymentMethodAllowedPlugins: paymentMethodAllowedPlugins, value: selectedPaymentMethod })), jsxRuntime.jsx("div", __assign({ className: "flex flex-col" }, { children: jsxRuntime.jsx(PaymentMethodDetails, { onFail: onFail, onSavePaymentMethod: handleSavePaymentMethod, paymentMethod: selectedPaymentMethod }) }))] }))) : (jsxRuntime.jsx("div", { children: "No payment method selected" })) }) }), "1") })))] }) })) })) })));
|
|
2872
2752
|
};
|
|
2873
|
-
|
|
2874
|
-
var
|
|
2875
|
-
var
|
|
2876
|
-
return
|
|
2877
|
-
switch (_a.label) {
|
|
2878
|
-
case 0:
|
|
2879
|
-
if (!invoiceUuid) {
|
|
2880
|
-
throw new Error("Invoice ID is required to fetch PDF");
|
|
2881
|
-
}
|
|
2882
|
-
return [4 /*yield*/, fetch("".concat(apiEndpoint, "/api/legacy_invoices/").concat(invoiceUuid))];
|
|
2883
|
-
case 1:
|
|
2884
|
-
response = _a.sent();
|
|
2885
|
-
if (!response.ok)
|
|
2886
|
-
throw new Error("Failed to fetch PDF");
|
|
2887
|
-
return [2 /*return*/, response.blob()]; // Return the PDF as a blob
|
|
2888
|
-
}
|
|
2889
|
-
});
|
|
2890
|
-
}); };
|
|
2891
|
-
function InvoicePDF(_a) {
|
|
2892
|
-
var invoiceUuid = _a.invoiceUuid, apiHost = _a.apiHost;
|
|
2893
|
-
var _b = React.useState(undefined), pdfUrl = _b[0], setPdfUrl = _b[1];
|
|
2894
|
-
var _c = reactQuery.useQuery({
|
|
2895
|
-
queryKey: ["invoicePDF", invoiceUuid],
|
|
2896
|
-
queryFn: function () { return fetchPDF(apiHost || "", invoiceUuid); },
|
|
2897
|
-
enabled: Boolean(invoiceUuid),
|
|
2898
|
-
}), pdfBlob = _c.data, isLoading = _c.isLoading;
|
|
2899
|
-
React.useEffect(function () {
|
|
2900
|
-
if (pdfBlob) {
|
|
2901
|
-
var url_1 = URL.createObjectURL(pdfBlob);
|
|
2902
|
-
setPdfUrl(url_1);
|
|
2903
|
-
return function () { return URL.revokeObjectURL(url_1); };
|
|
2904
|
-
}
|
|
2905
|
-
}, [pdfBlob]);
|
|
2906
|
-
if (isLoading || !pdfUrl)
|
|
2907
|
-
return jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
2908
|
-
return (jsxRuntime.jsx("iframe", { src: pdfUrl, style: {
|
|
2909
|
-
border: "none",
|
|
2910
|
-
gridColumn: "1/-1",
|
|
2911
|
-
minHeight: "1000px",
|
|
2912
|
-
minWidth: "780px",
|
|
2913
|
-
}, title: "Invoice PDF", width: "100%" }));
|
|
2753
|
+
function StripeWrapper(_a) {
|
|
2754
|
+
var children = _a.children, plugin = _a.plugin, token = _a.token, apiHost = _a.apiHost, accountId = _a.accountId;
|
|
2755
|
+
var _b = useStripePlugin(plugin, token, apiHost, accountId), stripe = _b.stripe, options = _b.options;
|
|
2756
|
+
return (jsxRuntime.jsx(reactStripeJs.Elements, __assign({ options: options, stripe: stripe }, { children: children })));
|
|
2914
2757
|
}
|
|
2915
2758
|
|
|
2916
2759
|
function Invoice(_a) {
|
|
@@ -2931,10 +2774,12 @@ function Invoice(_a) {
|
|
|
2931
2774
|
function ActualInvoice() {
|
|
2932
2775
|
// Context
|
|
2933
2776
|
var queryClient = reactQuery.useQueryClient();
|
|
2934
|
-
var _a = React.useContext(InvoiceQuoteContext), id = _a.id, invoiceQuoteViewComponent = _a.invoiceQuoteViewComponent, backButtonName = _a.backButtonName, onBackButtonClick = _a.onBackButtonClick,
|
|
2935
|
-
|
|
2777
|
+
var _a = React.useContext(InvoiceQuoteContext), id = _a.id, invoiceQuoteViewComponent = _a.invoiceQuoteViewComponent, backButtonName = _a.backButtonName, onBackButtonClick = _a.onBackButtonClick,
|
|
2778
|
+
// onPaymentSuccess,
|
|
2779
|
+
entityId = _a.entityId, className = _a.className;
|
|
2780
|
+
var _b = React.useContext(BunnyContext), apiHost = _b.apiHost, token = _b.token, onTokenExpired = _b.onTokenExpired, graphQLClient = _b.graphQLClient;
|
|
2936
2781
|
// Local state
|
|
2937
|
-
var isMobile = common.useIsMobile();
|
|
2782
|
+
var isMobile = common.useIsMobile(common.BreakpointNumbers.lg);
|
|
2938
2783
|
// Hooks
|
|
2939
2784
|
var showSuccessNotification = common.useSuccessNotification();
|
|
2940
2785
|
var handleAllErrorFormats = common.useAllErrorFormats(onTokenExpired);
|
|
@@ -2950,19 +2795,17 @@ function ActualInvoice() {
|
|
|
2950
2795
|
}
|
|
2951
2796
|
if (!formattedInvoice)
|
|
2952
2797
|
return jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
2953
|
-
var onSuccess = function (
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
queryKey: common.QueryKeyFactory.default.accountPaymentMethodKey,
|
|
2958
|
-
});
|
|
2798
|
+
var onSuccess = function () {
|
|
2799
|
+
// queryClient.invalidateQueries({
|
|
2800
|
+
// queryKey: QueryKeyFactory.default.accountPaymentMethodKey,
|
|
2801
|
+
// });
|
|
2959
2802
|
queryClient.invalidateQueries({
|
|
2960
2803
|
queryKey: common.QueryKeyFactory.default.transactionsKey(),
|
|
2961
2804
|
});
|
|
2962
2805
|
queryClient.invalidateQueries({
|
|
2963
2806
|
queryKey: common.QueryKeyFactory.default.createFormattedInvoiceKey(token, id),
|
|
2964
2807
|
});
|
|
2965
|
-
|
|
2808
|
+
// onPaymentSuccess?.(savePaymentMethod);
|
|
2966
2809
|
showSuccessNotification("Your invoice has been paid", "Payment successful");
|
|
2967
2810
|
};
|
|
2968
2811
|
var onFail = function (error) {
|
|
@@ -2971,9 +2814,7 @@ function ActualInvoice() {
|
|
|
2971
2814
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs(reactHelmetAsync.Helmet, { children: [jsxRuntime.jsxs("title", { children: [formattedInvoice.vendorName, " ", common.DOCUMENT_NAME.INVOICE] }), jsxRuntime.jsx("meta", { name: "description", content: quoteMetaDescription(formattedInvoice.vendorName) }), jsxRuntime.jsx("meta", { property: "og:type", content: "website" }), jsxRuntime.jsx("meta", { property: "og:title", content: quoteMetaTitle({
|
|
2972
2815
|
vendorName: formattedInvoice.vendorName,
|
|
2973
2816
|
documentName: common.DOCUMENT_NAME.INVOICE,
|
|
2974
|
-
}) }), jsxRuntime.jsx("meta", { property: "og:description", content: quoteMetaDescription(formattedInvoice.vendorName) })] }), jsxRuntime.jsxs("div", __assign({ className: "flex gap-6 ".concat(isMobile ? "flex-col w-full overflow-hidden" : "shadow-padding-xb", " ").concat(className) }, { children: [formattedInvoice.isLegacy ? (jsxRuntime.jsx("div", __assign({ className: "flex justify-center w-full" }, { children: jsxRuntime.jsx(InvoicePDF, { invoiceUuid: formattedInvoice.uuid, apiHost: apiHost }) }))) : (invoiceQuoteViewComponent || (jsxRuntime.jsx(InvoiceQuoteView, { html: formattedInvoice.html, formattedInvoice: formattedInvoice, backButtonName: backButtonName, onBackButtonClick: onBackButtonClick }))),
|
|
2975
|
-
onFail(error);
|
|
2976
|
-
}, onSuccess: onSuccess, entityId: entityId }))] }))] }));
|
|
2817
|
+
}) }), jsxRuntime.jsx("meta", { property: "og:description", content: quoteMetaDescription(formattedInvoice.vendorName) })] }), jsxRuntime.jsxs("div", __assign({ className: "flex gap-6 ".concat(isMobile ? "flex-col w-full overflow-hidden" : "shadow-padding-xb", " ").concat(className) }, { children: [formattedInvoice.isLegacy ? (jsxRuntime.jsx("div", __assign({ className: "flex justify-center w-full" }, { children: jsxRuntime.jsx(InvoicePDF, { invoiceUuid: formattedInvoice.uuid, apiHost: apiHost }) }))) : (invoiceQuoteViewComponent || (jsxRuntime.jsx(InvoiceQuoteView, { html: formattedInvoice.html, formattedInvoice: formattedInvoice, backButtonName: backButtonName, onBackButtonClick: onBackButtonClick }))), isInvoicePayable && (jsxRuntime.jsx("div", __assign({ className: "w-full pt-12" }, { children: jsxRuntime.jsx(PaymentForm, { entityId: entityId, onPaymentSuccess: onSuccess, onFail: onFail, invoice: formattedInvoice, graphQLClient: graphQLClient }) })))] }))] }));
|
|
2977
2818
|
}
|
|
2978
2819
|
|
|
2979
2820
|
var MUTATION$7 = function (id) { return "\n query formattedQuote ($id: ID) {\n formattedQuote (id: $id) {\n payableId\n acceptedAt\n acceptedByName\n amount\n amountDue\n amountsByPeriod {\n id\n name\n amount\n }\n object { documents { id filename size date url } }\n billingCity\n billingCountry\n billingState\n billingStreet\n billingZip\n contactName\n currency\n customerBillingCity\n customerBillingCountry\n customerBillingState\n customerBillingStreet\n customerBillingZip\n customerName\n discount\n discountValue\n duration\n endDate\n expiresAt\n html\n formattedLines {\n amount\n amountsByPeriod {\n quantity\n id\n name\n startDate\n endDate\n amount\n amountsByTier {\n id\n tier {\n starts\n ends\n price\n }\n quantity\n amount\n }\n prorationRate\n }\n billingPeriodEnd\n billingPeriodStart\n chargeType\n discount\n frequency\n isRamp\n periods\n planName\n position\n price\n priceDecimals\n priceListChargeId\n priceListChargeName\n priceListId\n priceListName\n priceTiers {\n price\n starts\n }\n pricingModel\n productName\n prorationRate\n quantity\n showProductNameOnLineItem\n taxCode\n trialEndDate\n trialStartDate\n unitOfMeasure\n vatCode\n }\n netPaymentDays\n notes\n number\n poNumberRequired\n salesContactEmail\n sharedAt\n startDate\n state\n subtotal\n taxAmount\n taxNumberLabel\n taxNumberRequired\n vendorName\n }\n }"; };
|
|
@@ -3502,7 +3343,9 @@ function Transactions(_a) {
|
|
|
3502
3343
|
common.TransactionKind.PAYMENT,
|
|
3503
3344
|
common.TransactionKind.REFUND,
|
|
3504
3345
|
common.TransactionKind.WRITE_OFF,
|
|
3505
|
-
] : _j, style = _a.style, filter = _a.filter, noTransactionsMessage = _a.noTransactionsMessage, entityId = _a.entityId, filterTransactions = _a.filterTransactions,
|
|
3346
|
+
] : _j, style = _a.style, filter = _a.filter, noTransactionsMessage = _a.noTransactionsMessage, entityId = _a.entityId, filterTransactions = _a.filterTransactions, _k = _a.sortTransactions, sortTransactions = _k === void 0 ? function (a, b) {
|
|
3347
|
+
return new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime();
|
|
3348
|
+
} : _k;
|
|
3506
3349
|
var contextValues = {
|
|
3507
3350
|
showSearchBar: showSearchBar,
|
|
3508
3351
|
showTitle: showTitle,
|
|
@@ -3523,9 +3366,9 @@ function Transactions(_a) {
|
|
|
3523
3366
|
filterTransactions: filterTransactions,
|
|
3524
3367
|
sortTransactions: sortTransactions,
|
|
3525
3368
|
};
|
|
3526
|
-
var
|
|
3369
|
+
var _l = React.useContext(BunnyContext), token = _l.token, apiHost = _l.apiHost;
|
|
3527
3370
|
// Local state
|
|
3528
|
-
var
|
|
3371
|
+
var _m = React.useState(""), search = _m[0], setSearch = _m[1];
|
|
3529
3372
|
var filterValue = filter ||
|
|
3530
3373
|
(search ? "filter: \"transaction.transactionableId is ".concat(search, "\"") : "");
|
|
3531
3374
|
// Queries
|
|
@@ -3896,86 +3739,40 @@ var FormBillingState = function (_a) {
|
|
|
3896
3739
|
|
|
3897
3740
|
var QuoteCheckout = function (_a) {
|
|
3898
3741
|
var account = _a.account, onSuccess = _a.onSuccess, onFail = _a.onFail, quote = _a.quote, taxationRequiredAccountFields = _a.taxationRequiredAccountFields, entityId = _a.entityId;
|
|
3899
|
-
// Context
|
|
3900
|
-
var isMobile = common.useIsMobile();
|
|
3901
3742
|
var _b = React.useContext(BunnyContext), apiHost = _b.apiHost, token = _b.token, graphQLClient = _b.graphQLClient;
|
|
3743
|
+
var isMobile = common.useIsMobile();
|
|
3902
3744
|
var _c = React.useState(false), isSaving = _c[0], setIsSaving = _c[1];
|
|
3903
3745
|
var paymentRequired = getQuoteAmountDue(quote) > 0;
|
|
3904
3746
|
var checkoutMutation = reactQuery.useMutation({
|
|
3905
|
-
mutationFn: function (
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
});
|
|
3919
|
-
}
|
|
3920
|
-
if (pluginPaymentMethod) {
|
|
3921
|
-
var plugin = pluginPaymentMethod.plugin, savePaymentMethod = pluginPaymentMethod.savePaymentMethod, metadata = pluginPaymentMethod.metadata;
|
|
3922
|
-
var paymentToken = pluginPaymentMethod.token;
|
|
3923
|
-
return checkout({
|
|
3924
|
-
quoteId: quote.id,
|
|
3925
|
-
paymentMethodData: {
|
|
3926
|
-
metadata: metadata,
|
|
3927
|
-
pluginGuid: plugin.guid,
|
|
3928
|
-
savePaymentMethod: savePaymentMethod,
|
|
3929
|
-
token: paymentToken,
|
|
3930
|
-
},
|
|
3931
|
-
token: token,
|
|
3932
|
-
apiHost: apiHost,
|
|
3933
|
-
});
|
|
3934
|
-
}
|
|
3935
|
-
throw new Error("Pay payment method provided");
|
|
3936
|
-
},
|
|
3747
|
+
mutationFn: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
3748
|
+
return __generator(this, function (_a) {
|
|
3749
|
+
switch (_a.label) {
|
|
3750
|
+
case 0:
|
|
3751
|
+
if (!quote)
|
|
3752
|
+
throw new Error("Quote is required");
|
|
3753
|
+
if (paymentRequired)
|
|
3754
|
+
throw new Error("Payment is required");
|
|
3755
|
+
return [4 /*yield*/, checkout({ quoteId: quote.id, token: token, apiHost: apiHost })];
|
|
3756
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
3757
|
+
}
|
|
3758
|
+
});
|
|
3759
|
+
}); },
|
|
3937
3760
|
onSuccess: onSuccess,
|
|
3938
3761
|
onError: onFail,
|
|
3939
3762
|
});
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
3944
|
-
var token_1, plugin, savePaymentMethod, metadata, paymentMethodId;
|
|
3945
|
-
return __generator(this, function (_b) {
|
|
3763
|
+
function handleCheckoutNoPayment() {
|
|
3764
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3765
|
+
return __generator(this, function (_a) {
|
|
3946
3766
|
setIsSaving(true);
|
|
3947
|
-
|
|
3948
|
-
token_1 = pluginPaymentResponse.token, plugin = pluginPaymentResponse.plugin, savePaymentMethod = pluginPaymentResponse.savePaymentMethod, metadata = pluginPaymentResponse.metadata;
|
|
3949
|
-
checkoutMutation.mutate({
|
|
3950
|
-
pluginPaymentMethod: {
|
|
3951
|
-
savePaymentMethod: savePaymentMethod,
|
|
3952
|
-
plugin: plugin,
|
|
3953
|
-
metadata: metadata,
|
|
3954
|
-
token: token_1,
|
|
3955
|
-
},
|
|
3956
|
-
});
|
|
3957
|
-
}
|
|
3958
|
-
else if (savedPaymentMethodResponse) {
|
|
3959
|
-
paymentMethodId = savedPaymentMethodResponse.paymentMethodId;
|
|
3960
|
-
checkoutMutation.mutate({
|
|
3961
|
-
storedPaymentMethod: {
|
|
3962
|
-
paymentMethodId: paymentMethodId,
|
|
3963
|
-
},
|
|
3964
|
-
});
|
|
3965
|
-
}
|
|
3966
|
-
else {
|
|
3967
|
-
checkoutMutation.mutate({});
|
|
3968
|
-
}
|
|
3767
|
+
checkoutMutation.mutate();
|
|
3969
3768
|
setIsSaving(false);
|
|
3970
3769
|
return [2 /*return*/];
|
|
3971
3770
|
});
|
|
3972
3771
|
});
|
|
3973
|
-
}
|
|
3772
|
+
}
|
|
3974
3773
|
if (taxationRequiredAccountFields)
|
|
3975
3774
|
return (jsxRuntime.jsx(PaymentFormWrapper, __assign({ setMaxHeight: false }, { children: jsxRuntime.jsx(TaxationForm, { account: account, quote: quote }) })));
|
|
3976
|
-
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: paymentRequired ? (jsxRuntime.jsx(PaymentForm, { entityId: entityId, onFail: onFail, onPaymentSuccess:
|
|
3977
|
-
handleCheckout({});
|
|
3978
|
-
}, type: "primary" }, { children: isSaving ? "Processing..." : "Complete order" })), jsxRuntime.jsx("div", __assign({ className: "text-xs text-slate-500" }, { children: "No payment is required" }))] })) }))) }));
|
|
3775
|
+
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: paymentRequired ? (jsxRuntime.jsx(PaymentForm, { entityId: entityId, onFail: onFail, onPaymentSuccess: onSuccess, quote: quote, graphQLClient: graphQLClient })) : (jsxRuntime.jsx(PaymentFormWrapper, __assign({ setMaxHeight: false }, { children: jsxRuntime.jsxs("div", __assign({ className: "flex flex-col gap-2 ".concat(isMobile ? "shadow-padding-x" : "") }, { children: [jsxRuntime.jsx(antd.Button, __assign({ onClick: handleCheckoutNoPayment, type: "primary" }, { children: isSaving ? "Processing..." : "Complete order" })), jsxRuntime.jsx("div", __assign({ className: "text-xs text-slate-500" }, { children: "No payment is required" }))] })) }))) }));
|
|
3979
3776
|
};
|
|
3980
3777
|
var PaymentFormWrapper = function (_a) {
|
|
3981
3778
|
var children = _a.children, setMaxHeight = _a.setMaxHeight, className = _a.className;
|
|
@@ -4052,24 +3849,11 @@ var Checkout = function (_a) {
|
|
|
4052
3849
|
return null;
|
|
4053
3850
|
return (jsxRuntime.jsx("div", __assign({ className: "flex flex-col fixed top-0 left-0 right-0 bottom-0 bg-slate-50 overflow-auto", style: {
|
|
4054
3851
|
zIndex: 1001,
|
|
4055
|
-
} }, { children: jsxRuntime.jsxs("div", __assign({ className: pageWrapperClassName(isMobile) }, { children: [jsxRuntime.jsx("div", __assign({ className: "flex justify-end w-full" }, { children: jsxRuntime.jsx(CloseOutlined$1, { className: "text-base shadow-padding-xb", onClick: onCancel }) })), jsxRuntime.jsxs("div", __assign({ className: "flex justify-end gap-6 pt-4 ".concat(isMobile ? "flex-col" : "shadow-padding-xb") }, { children: [((invoice === null || invoice === void 0 ? void 0 : invoice.html) || ((_b = quote === null || quote === void 0 ? void 0 : quote.formattedQuote) === null || _b === void 0 ? void 0 : _b.html)) && (jsxRuntime.jsx(InvoiceQuoteView, { html: invoice ? invoice.html : quote ? quote.formattedQuote.html : "" })), !isMobile && ((invoice === null || invoice === void 0 ? void 0 : invoice.html) || ((_c = quote === null || quote === void 0 ? void 0 : quote.formattedQuote) === null || _c === void 0 ? void 0 : _c.html)) && (jsxRuntime.jsx(antd.Divider, { className: "h-full", type: "vertical" })), invoice ? (jsxRuntime.jsx(
|
|
4056
|
-
onFail(error);
|
|
4057
|
-
}, onSuccess: function (_a) {
|
|
4058
|
-
var savePaymentMethod = _a.savePaymentMethod;
|
|
4059
|
-
onSuccess({ savePaymentMethod: savePaymentMethod });
|
|
4060
|
-
}, entityId: entityId })) : quote ? (jsxRuntime.jsx(QuoteCheckout, { account: account, entityId: entityId, onFail: function (error) {
|
|
3852
|
+
} }, { children: jsxRuntime.jsxs("div", __assign({ className: pageWrapperClassName(isMobile) }, { children: [jsxRuntime.jsx("div", __assign({ className: "flex justify-end w-full" }, { children: jsxRuntime.jsx(CloseOutlined$1, { className: "text-base shadow-padding-xb", onClick: onCancel }) })), jsxRuntime.jsxs("div", __assign({ className: "flex justify-end gap-6 pt-4 ".concat(isMobile ? "flex-col" : "shadow-padding-xb") }, { children: [((invoice === null || invoice === void 0 ? void 0 : invoice.html) || ((_b = quote === null || quote === void 0 ? void 0 : quote.formattedQuote) === null || _b === void 0 ? void 0 : _b.html)) && (jsxRuntime.jsx(InvoiceQuoteView, { html: invoice ? invoice.html : quote ? quote.formattedQuote.html : "" })), !isMobile && ((invoice === null || invoice === void 0 ? void 0 : invoice.html) || ((_c = quote === null || quote === void 0 ? void 0 : quote.formattedQuote) === null || _c === void 0 ? void 0 : _c.html)) && (jsxRuntime.jsx(antd.Divider, { className: "h-full", type: "vertical" })), invoice ? (jsxRuntime.jsx("div", __assign({ className: "w-full pt-12" }, { children: jsxRuntime.jsx(PaymentForm, { entityId: entityId, onPaymentSuccess: onSuccess, onFail: onFail, invoice: invoice, graphQLClient: graphQLClient }) }))) : quote ? (jsxRuntime.jsx(QuoteCheckout, { account: account, entityId: entityId, onFail: function (error) {
|
|
4061
3853
|
onFail(error);
|
|
4062
|
-
}, onSuccess: function (
|
|
4063
|
-
var savePaymentMethod = _a.savePaymentMethod;
|
|
4064
|
-
onSuccess({ savePaymentMethod: savePaymentMethod });
|
|
4065
|
-
}, quote: quote, taxationRequiredAccountFields: taxationRequiredAccountFields, token: token })) : (jsxRuntime.jsx(PaymentForm, { entityId: entityId, onFail: function (error) {
|
|
3854
|
+
}, onSuccess: onSuccess, quote: quote, taxationRequiredAccountFields: taxationRequiredAccountFields, token: token })) : (jsxRuntime.jsx(PaymentForm, { entityId: entityId, onFail: function (error) {
|
|
4066
3855
|
onFail(error);
|
|
4067
|
-
}, onPaymentSuccess:
|
|
4068
|
-
var pluginPaymentResponse = _a.pluginPaymentResponse;
|
|
4069
|
-
onSuccess({
|
|
4070
|
-
savePaymentMethod: pluginPaymentResponse === null || pluginPaymentResponse === void 0 ? void 0 : pluginPaymentResponse.savePaymentMethod,
|
|
4071
|
-
});
|
|
4072
|
-
}, graphQLClient: graphQLClient }))] }))] })) })));
|
|
3856
|
+
}, onPaymentSuccess: onSuccess, graphQLClient: graphQLClient }))] }))] })) })));
|
|
4073
3857
|
};
|
|
4074
3858
|
|
|
4075
3859
|
var DEFAULT_HEADERS = {
|
|
@@ -4352,17 +4136,16 @@ function Signup(_a) {
|
|
|
4352
4136
|
});
|
|
4353
4137
|
});
|
|
4354
4138
|
}
|
|
4355
|
-
function handlePaymentSaveSuccess(
|
|
4139
|
+
function handlePaymentSaveSuccess() {
|
|
4356
4140
|
return __awaiter(this, void 0, void 0, function () {
|
|
4357
|
-
var
|
|
4141
|
+
var plugin;
|
|
4358
4142
|
return __generator(this, function (_a) {
|
|
4359
4143
|
switch (_a.label) {
|
|
4360
4144
|
case 0:
|
|
4361
4145
|
if (!formData) {
|
|
4362
4146
|
throw new Error("Form data is required");
|
|
4363
4147
|
}
|
|
4364
|
-
|
|
4365
|
-
plugin = response === null || response === void 0 ? void 0 : response.plugin;
|
|
4148
|
+
plugin = { id: "" };
|
|
4366
4149
|
if (!(plugin === null || plugin === void 0 ? void 0 : plugin.id)) {
|
|
4367
4150
|
throw new Error("Plugin ID is required");
|
|
4368
4151
|
}
|