@bunnyapp/components 1.0.64 → 1.0.66-beta.1
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 +42 -27
- package/dist/cjs/src/components/PaymentForm/PaymentForm.d.ts +2 -1
- package/dist/cjs/src/components/PaymentForm/PaymentMethodDetails.d.ts +2 -1
- package/dist/cjs/src/components/PaymentForm/Stripe/PaymentMethodForm.d.ts +2 -1
- package/dist/cjs/src/components/PaymentForm/Stripe/StripeForm.d.ts +3 -2
- package/dist/esm/index.js +42 -27
- package/dist/esm/src/components/PaymentForm/PaymentForm.d.ts +2 -1
- package/dist/esm/src/components/PaymentForm/PaymentMethodDetails.d.ts +2 -1
- package/dist/esm/src/components/PaymentForm/Stripe/PaymentMethodForm.d.ts +2 -1
- package/dist/esm/src/components/PaymentForm/Stripe/StripeForm.d.ts +3 -2
- package/dist/index.d.ts +2 -1
- package/package.json +2 -2
package/dist/cjs/index.js
CHANGED
|
@@ -173,7 +173,7 @@ var BrandContext = react.createContext({
|
|
|
173
173
|
});
|
|
174
174
|
|
|
175
175
|
// This will be replaced at build time by rollup-plugin-replace
|
|
176
|
-
var PACKAGE_VERSION = '1.0.
|
|
176
|
+
var PACKAGE_VERSION = '1.0.66-beta.1';
|
|
177
177
|
var createRequestHeaders = function (token) {
|
|
178
178
|
var headers = common.createClientDevHeaders(token);
|
|
179
179
|
// Add the components version header
|
|
@@ -18892,7 +18892,7 @@ function useSave(_a) {
|
|
|
18892
18892
|
}
|
|
18893
18893
|
|
|
18894
18894
|
var PaymentMethodForm = function (_a) {
|
|
18895
|
-
var plugin = _a.plugin, onFail = _a.onFail, onSavePaymentMethod = _a.onSavePaymentMethod;
|
|
18895
|
+
var country = _a.country, plugin = _a.plugin, onFail = _a.onFail, onSavePaymentMethod = _a.onSavePaymentMethod;
|
|
18896
18896
|
// Hooks
|
|
18897
18897
|
var _b = useSave({
|
|
18898
18898
|
onSaveSuccess: onSavePaymentMethod,
|
|
@@ -18917,21 +18917,33 @@ var PaymentMethodForm = function (_a) {
|
|
|
18917
18917
|
}
|
|
18918
18918
|
});
|
|
18919
18919
|
}); };
|
|
18920
|
-
|
|
18920
|
+
console.log('country', country);
|
|
18921
|
+
console.log('plugin', plugin);
|
|
18922
|
+
console.log('plugin', plugin);
|
|
18923
|
+
return (jsxRuntime.jsxs("form", { children: [jsxRuntime.jsx(reactStripeJs.PaymentElement, { options: {
|
|
18924
|
+
layout: { type: 'accordion' },
|
|
18925
|
+
defaultValues: {
|
|
18926
|
+
billingDetails: {
|
|
18927
|
+
address: {
|
|
18928
|
+
country: country,
|
|
18929
|
+
},
|
|
18930
|
+
},
|
|
18931
|
+
},
|
|
18932
|
+
} }), jsxRuntime.jsx(SavePaymentMethodFooter, { isSaving: isSaving, onSave: onSubmit })] }));
|
|
18921
18933
|
};
|
|
18922
18934
|
|
|
18923
18935
|
// This is just a wrapper to fetch the stripe object and pass it to the form
|
|
18924
18936
|
var StripeForm = function (_a) {
|
|
18925
|
-
var plugin = _a.plugin, onFail = _a.onFail, onSavePaymentMethod = _a.onSavePaymentMethod;
|
|
18926
|
-
return (jsxRuntime.jsx(PaymentMethodForm, { plugin: plugin, onFail: onFail, onSavePaymentMethod: onSavePaymentMethod }));
|
|
18937
|
+
var country = _a.country, plugin = _a.plugin, onFail = _a.onFail, onSavePaymentMethod = _a.onSavePaymentMethod;
|
|
18938
|
+
return (jsxRuntime.jsx(PaymentMethodForm, { country: country, plugin: plugin, onFail: onFail, onSavePaymentMethod: onSavePaymentMethod }));
|
|
18927
18939
|
};
|
|
18928
18940
|
|
|
18929
18941
|
var PaymentMethodDetails = function (_a) {
|
|
18930
18942
|
var _b, _c;
|
|
18931
|
-
var onFail = _a.onFail, plugin = _a.plugin, onSavePaymentMethod = _a.onSavePaymentMethod;
|
|
18943
|
+
var country = _a.country, onFail = _a.onFail, plugin = _a.plugin, onSavePaymentMethod = _a.onSavePaymentMethod;
|
|
18932
18944
|
switch ((_c = (_b = plugin.components) === null || _b === void 0 ? void 0 : _b.frontend) === null || _c === void 0 ? void 0 : _c[0].name) {
|
|
18933
18945
|
case 'StripePayment':
|
|
18934
|
-
return (jsxRuntime.jsx(StripeForm, { onFail: onFail, onSavePaymentMethod: onSavePaymentMethod, plugin: plugin }));
|
|
18946
|
+
return (jsxRuntime.jsx(StripeForm, { country: country, onFail: onFail, onSavePaymentMethod: onSavePaymentMethod, plugin: plugin }));
|
|
18935
18947
|
case 'DemoPayPayment':
|
|
18936
18948
|
return (jsxRuntime.jsx(DemoPayForm, { onFail: onFail, onSavePaymentMethod: onSavePaymentMethod, plugin: plugin }));
|
|
18937
18949
|
default:
|
|
@@ -19078,7 +19090,7 @@ function useSetDefaultPaymentMethod(paymentPlugins, apiHost, token, accountId, o
|
|
|
19078
19090
|
var showErrorNotification$1 = common.useErrorNotification();
|
|
19079
19091
|
var PaymentForm = function (_a) {
|
|
19080
19092
|
var _b;
|
|
19081
|
-
var invoice = _a.invoice, onFail = _a.onFail, onPaymentSuccess = _a.onPaymentSuccess, onPaymentHoldSuccess = _a.onPaymentHoldSuccess, quote = _a.quote, accountId = _a.accountId, onSavePaymentMethod = _a.onSavePaymentMethod, onRemovePaymentMethod = _a.onRemovePaymentMethod, onSetDefaultPaymentMethod = _a.onSetDefaultPaymentMethod, overrideToken = _a.overrideToken, customCheckoutFunction = _a.customCheckoutFunction, currencyIdFromProps = _a.currencyId, paymentHoldOptions = _a.paymentHoldOptions;
|
|
19093
|
+
var country = _a.country, invoice = _a.invoice, onFail = _a.onFail, onPaymentSuccess = _a.onPaymentSuccess, onPaymentHoldSuccess = _a.onPaymentHoldSuccess, quote = _a.quote, accountId = _a.accountId, onSavePaymentMethod = _a.onSavePaymentMethod, onRemovePaymentMethod = _a.onRemovePaymentMethod, onSetDefaultPaymentMethod = _a.onSetDefaultPaymentMethod, overrideToken = _a.overrideToken, customCheckoutFunction = _a.customCheckoutFunction, currencyIdFromProps = _a.currencyId, paymentHoldOptions = _a.paymentHoldOptions;
|
|
19082
19094
|
// Local state
|
|
19083
19095
|
var _c = react.useState(false), showPaymentMethodForm = _c[0], setShowPaymentMethodForm = _c[1];
|
|
19084
19096
|
// Simple hooks
|
|
@@ -19162,7 +19174,7 @@ var PaymentForm = function (_a) {
|
|
|
19162
19174
|
key: '1',
|
|
19163
19175
|
showArrow: false,
|
|
19164
19176
|
label: !showPaymentMethodForm ? (jsxRuntime.jsx("div", __assign({ className: "bunny-pt-2" }, { children: jsxRuntime.jsx(antd.Button, __assign({ onClick: handleClickAddPaymentMethod, type: "default", className: "bunny-w-full", id: "addPaymentMethod" }, { children: "Add payment method" })) }))) : null,
|
|
19165
|
-
children: (jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-gap-2 bunny-mt-2" }, { children: [jsxRuntime.jsx(PaymentMethodSelector, { onSelect: setSelectorPaymentMethodPlugin, paymentMethodAllowedPlugins: paymentPlugins, value: selectorPaymentMethodPlugin }), selectorPaymentMethodPlugin && (jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-flex-col" }, { children: jsxRuntime.jsx(PaymentMethodDetails, { onFail: onFail, onSavePaymentMethod: handleSavePaymentMethod, plugin: selectorPaymentMethodPlugin }) })))] }))),
|
|
19177
|
+
children: (jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-gap-2 bunny-mt-2" }, { children: [jsxRuntime.jsx(PaymentMethodSelector, { onSelect: setSelectorPaymentMethodPlugin, paymentMethodAllowedPlugins: paymentPlugins, value: selectorPaymentMethodPlugin }), selectorPaymentMethodPlugin && (jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-flex-col" }, { children: jsxRuntime.jsx(PaymentMethodDetails, { country: country, onFail: onFail, onSavePaymentMethod: handleSavePaymentMethod, plugin: selectorPaymentMethodPlugin }) })))] }))),
|
|
19166
19178
|
},
|
|
19167
19179
|
] }), paying && !selectedPaymentPluginIsManualPayment ? (jsxRuntime.jsx(jsxRuntime.Fragment, { children: defaultPaymentMethod && selectedPaymentMethodPlugin ? (jsxRuntime.jsx("div", __assign({ className: "bunny-px-4" }, { children: jsxRuntime.jsx(CheckoutFooter, { quote: quote, invoice: invoice, onPaymentSuccess: handlePaymentSuccess, onPaymentHoldSuccess: onPaymentHoldSuccess, plugin: selectedPaymentMethodPlugin, paymentHoldOptions: paymentHoldOptions }) }))) : null })) : null] }) })) })) })));
|
|
19168
19180
|
};
|
|
@@ -19229,10 +19241,10 @@ function ActualInvoice() {
|
|
|
19229
19241
|
}, [formattedInvoice]);
|
|
19230
19242
|
if (!formattedInvoice)
|
|
19231
19243
|
return jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
19232
|
-
return (jsxRuntime.jsx("div", __assign({ className: "bunny-invoice-container" }, { children: jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-gap-6 bunny-overflow-hidden ".concat(isMobile ? 'bunny-flex-col bunny-w-full' : '', " ").concat(className) }, { children: [formattedInvoice.isLegacy ? (jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-justify-center bunny-w-full" }, { children: jsxRuntime.jsx(LegacyDocument, { documentUuid: formattedInvoice.uuid, documentType: "invoice" }) }))) : (invoiceQuoteViewComponent || (jsxRuntime.jsx(InvoiceQuoteView, { html: formattedInvoice.html, formattedInvoice: formattedInvoice, backButtonName: backButtonName, onBackButtonClick: onBackButtonClick }))), isInvoicePayable && (jsxRuntime.jsx("div", __assign({ className: "bunny-w-full ".concat(hideDownloadButton || formattedInvoice.isLegacy ? '' : 'pt-12') }, { children: jsxRuntime.jsx(PaymentForm, { onPaymentSuccess: onSuccess, onFail: onFail, invoice: formattedInvoice }) })))] })) })));
|
|
19244
|
+
return (jsxRuntime.jsx("div", __assign({ className: "bunny-invoice-container" }, { children: jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-gap-6 bunny-overflow-hidden ".concat(isMobile ? 'bunny-flex-col bunny-w-full' : '', " ").concat(className) }, { children: [formattedInvoice.isLegacy ? (jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-justify-center bunny-w-full" }, { children: jsxRuntime.jsx(LegacyDocument, { documentUuid: formattedInvoice.uuid, documentType: "invoice" }) }))) : (invoiceQuoteViewComponent || (jsxRuntime.jsx(InvoiceQuoteView, { html: formattedInvoice.html, formattedInvoice: formattedInvoice, backButtonName: backButtonName, onBackButtonClick: onBackButtonClick }))), isInvoicePayable && (jsxRuntime.jsx("div", __assign({ className: "bunny-w-full ".concat(hideDownloadButton || formattedInvoice.isLegacy ? '' : 'pt-12') }, { children: jsxRuntime.jsx(PaymentForm, { country: formattedInvoice === null || formattedInvoice === void 0 ? void 0 : formattedInvoice.billingCountry, onPaymentSuccess: onSuccess, onFail: onFail, invoice: formattedInvoice }) })))] })) })));
|
|
19233
19245
|
}
|
|
19234
19246
|
|
|
19235
|
-
var MUTATION$7 = function (id) { return "\n query formattedQuote ($id: ID) {\n formattedQuote (id: $id) {\n quote {\n documents { id filename size date url }\n firstInvoice {\n id\n state\n }\n payableId\n id\n payToAccept\n currentPaymentHold {\n createdAt\n expiresAt\n id\n updatedAt\n paymentMethod {\n accountId\n createdAt\n expirationDate\n failureCode\n id\n isDefault\n lastSuccess\n paymentType\n pluginId\n state\n updatedAt\n metadata {\n description\n expiration\n icon\n identifier\n issuer\n kind\n }\n }\n }\n }\n payableId\n acceptedAt\n acceptedByName\n amount\n amountDue\n amountsByPeriod {\n id\n name\n amount\n }\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 }"; };
|
|
19247
|
+
var MUTATION$7 = function (id) { return "\n query formattedQuote ($id: ID) {\n formattedQuote (id: $id) {\n quote {\n documentTemplateId\n documents { id filename size date url }\n firstInvoice {\n id\n state\n }\n payableId\n id\n payToAccept\n currentPaymentHold {\n createdAt\n expiresAt\n id\n updatedAt\n paymentMethod {\n accountId\n createdAt\n expirationDate\n failureCode\n id\n isDefault\n lastSuccess\n paymentType\n pluginId\n state\n updatedAt\n metadata {\n description\n expiration\n icon\n identifier\n issuer\n kind\n }\n }\n }\n }\n payableId\n acceptedAt\n acceptedByName\n amount\n amountDue\n amountsByPeriod {\n id\n name\n amount\n }\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 }"; };
|
|
19236
19248
|
var getFormattedQuote = function (_a) {
|
|
19237
19249
|
var id = _a.id, token = _a.token, apiHost = _a.apiHost;
|
|
19238
19250
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -19565,15 +19577,25 @@ var AcceptQuoteModal = function (_a) {
|
|
|
19565
19577
|
}, open: acceptBoxVisible, title: "Accept quote", width: 400 }, { children: jsxRuntime.jsxs(antd.Form, __assign({ className: "bunny-flex bunny-flex-col bunny-gap-2", form: form, layout: "vertical" }, { children: [jsxRuntime.jsx(antd.Form.Item, __assign({ label: "Your name", name: "name", rules: createRules(true, "Your name") }, { children: jsxRuntime.jsx(antd.Input, { autoFocus: true, ref: firstInputRef }) })), jsxRuntime.jsx(antd.Form.Item, __assign({ label: "Your job title", name: "title", rules: createRules(true, "Your job title") }, { children: jsxRuntime.jsx(antd.Input, {}) })), jsxRuntime.jsx(antd.Form.Item, __assign({ label: "Purchase order number", name: "poNumber", rules: createRules(poNumberRequired, "Purchase order number") }, { children: jsxRuntime.jsx(antd.Input, {}) })), taxNumberRequired && (jsxRuntime.jsx(antd.Form.Item, __assign({ name: "taxNumber", label: taxNumberLabel, rules: createRules(taxNumberRequired, taxNumberLabel) }, { children: jsxRuntime.jsx(antd.Input, {}) })))] })) })));
|
|
19566
19578
|
};
|
|
19567
19579
|
|
|
19580
|
+
var useCurrentUserData = function () {
|
|
19581
|
+
var queryClient = reactQuery.useQueryClient();
|
|
19582
|
+
var token = useToken();
|
|
19583
|
+
var currentUser = queryClient.getQueryData(common.QueryKeyFactory.default.currentUserKey(token));
|
|
19584
|
+
if (!currentUser)
|
|
19585
|
+
return {};
|
|
19586
|
+
return currentUser;
|
|
19587
|
+
};
|
|
19588
|
+
|
|
19568
19589
|
var Title$2 = antd.Typography.Title;
|
|
19569
19590
|
var showSuccessNotification$1 = common.useSuccessNotification();
|
|
19570
19591
|
var PaymentHoldModal = function (_a) {
|
|
19571
19592
|
var visible = _a.visible, setVisible = _a.setVisible, quote = _a.quote;
|
|
19572
19593
|
var queryClient = reactQuery.useQueryClient();
|
|
19573
19594
|
var token = useToken();
|
|
19595
|
+
var account = useCurrentUserData().account;
|
|
19574
19596
|
return (jsxRuntime.jsxs(StyledModal$1, __assign({ centered: true, onCancel: function () {
|
|
19575
19597
|
setVisible(false);
|
|
19576
|
-
}, footer: null, open: visible, width: 600 }, { children: [jsxRuntime.jsx(Title$2, __assign({ className: "mt-4 pb-4 mx-4", level: 5 }, { children: "Pay to accept" })), jsxRuntime.jsx("div", __assign({ className: "mb-4" }, { children: jsxRuntime.jsx(PaymentForm, { quote: {
|
|
19598
|
+
}, footer: null, open: visible, width: 600 }, { children: [jsxRuntime.jsx(Title$2, __assign({ className: "mt-4 pb-4 mx-4", level: 5 }, { children: "Pay to accept" })), jsxRuntime.jsx("div", __assign({ className: "mb-4" }, { children: jsxRuntime.jsx(PaymentForm, { country: account === null || account === void 0 ? void 0 : account.billingCountry, quote: {
|
|
19577
19599
|
amount: quote.amount,
|
|
19578
19600
|
currencyId: quote.currency,
|
|
19579
19601
|
id: quote.quote.id,
|
|
@@ -19689,7 +19711,7 @@ function ActualQuote() {
|
|
|
19689
19711
|
return jsxRuntime.jsx(Invoice, { id: firstInvoice.id });
|
|
19690
19712
|
}
|
|
19691
19713
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-gap-4 ".concat(isMobile ? 'bunny-w-full bunny-overflow-hidden' : '', " ").concat(className) }, { children: [jsxRuntime.jsx(QuoteButtons, { isAccepted: isAccepted, formattedQuote: formattedQuote, isMobile: isMobile, hideDownloadButton: hideDownloadButton, id: id, isAccepting: isAccepting, handleClickAccept: handleClickAccept, setPaymentHoldModalVisible: setPaymentHoldModalVisible, shouldDoPaymentHold: shouldDoPaymentHold, paymentHoldCompleted: paymentHoldCompleted, paymentHold: paymentHold }), jsxRuntime.jsx(InvoiceQuoteView, __assign({ html: formattedQuote.html, targetUrl: ((_b = formattedQuote === null || formattedQuote === void 0 ? void 0 : formattedQuote.quote) === null || _b === void 0 ? void 0 : _b.documentTemplateId)
|
|
19692
|
-
? "".concat(apiHost, "/api/pdf/quote/").concat(formattedQuote.id)
|
|
19714
|
+
? "".concat(apiHost, "/api/pdf/quote/").concat(formattedQuote.quote.id)
|
|
19693
19715
|
: undefined }, { children: ((_d = (_c = formattedQuote.quote) === null || _c === void 0 ? void 0 : _c.documents) === null || _d === void 0 ? void 0 : _d.length) > 0 ? (jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-flex-col bunny-items-end" }, { children: formattedQuote.quote.documents.map(function (doc, index) {
|
|
19694
19716
|
return (jsxRuntime.jsx(antd.Button, __assign({ download: doc.filename, href: doc.url, type: "link" }, { children: doc.filename }), index));
|
|
19695
19717
|
}) }))) : null }))] })), jsxRuntime.jsx(AcceptQuoteModal, { acceptBoxVisible: acceptBoxVisible, formattedQuote: formattedQuote, setAcceptBoxVisible: setAcceptBoxVisible, setIsAccepting: setIsAccepting, sendAccept: sendAccept, isSendAcceptPending: isSendAcceptPending }), jsxRuntime.jsx(PaymentHoldModal, { visible: paymentHoldModalVisible, setVisible: setPaymentHoldModalVisible, quote: formattedQuote }), jsxRuntime.jsx(PandadocPollingModal, { isVisible: pandadocPollingModalVisible, setVisible: setPandadocPollingModalVisible, id: id })] }));
|
|
@@ -20305,15 +20327,6 @@ var getQuote = function (_a) {
|
|
|
20305
20327
|
});
|
|
20306
20328
|
};
|
|
20307
20329
|
|
|
20308
|
-
var useCurrentUserData = function () {
|
|
20309
|
-
var queryClient = reactQuery.useQueryClient();
|
|
20310
|
-
var token = useToken();
|
|
20311
|
-
var currentUser = queryClient.getQueryData(common.QueryKeyFactory.default.currentUserKey(token));
|
|
20312
|
-
if (!currentUser)
|
|
20313
|
-
return {};
|
|
20314
|
-
return currentUser;
|
|
20315
|
-
};
|
|
20316
|
-
|
|
20317
20330
|
var BunnyFooterIcon = function (_a) {
|
|
20318
20331
|
var color = _a.color;
|
|
20319
20332
|
return (jsxRuntime.jsxs("svg", __assign({ width: "45", height: "15", viewBox: "0 0 39 13", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: [jsxRuntime.jsxs("g", __assign({ clipPath: "url(#clip0_6_851)" }, { children: [jsxRuntime.jsx("path", { className: "bunny-icon-path", d: "M14.5898 7.19708C14.5898 9.35053 13.0926 10.325 11.2495 10.325C9.39955 10.325 7.90234 9.35001 7.90234 7.18967V3.26221H10.1125V7.00052C10.1125 7.87719 10.5855 8.27725 11.2495 8.27725C11.9061 8.27725 12.3865 7.87719 12.3865 7.00052V3.26221H14.5898V7.19708Z", fill: color }), jsxRuntime.jsx("path", { className: "bunny-icon-path", d: "M31.8943 12.9625H29.4793L31.8523 8.62816L28.9355 3.26221H31.4708L33.0457 6.35524L34.5924 3.26221H37.0075L31.8943 12.9625Z", fill: color }), jsxRuntime.jsx("path", { className: "bunny-icon-path", d: "M15.1602 5.96827C15.1602 3.8148 16.6574 2.84033 18.5005 2.84033C20.3504 2.84033 21.8476 3.81533 21.8476 5.97568V10.1473H19.6374V6.16483C19.6374 5.28815 19.1645 4.8881 18.5005 4.8881C17.8439 4.8881 17.3634 5.28815 17.3634 6.16483V10.1473H15.1602V5.96827Z", fill: color }), jsxRuntime.jsx("path", { className: "bunny-icon-path", d: "M22.4316 5.96827C22.4316 3.8148 23.9289 2.84033 25.7719 2.84033C27.6219 2.84033 29.1191 3.81533 29.1191 5.97568V10.1473H26.9089V6.16483C26.9089 5.28815 26.4359 4.8881 25.7719 4.8881C25.1154 4.8881 24.6349 5.28815 24.6349 6.16483V10.1473H22.4316V5.96827Z", fill: color }), jsxRuntime.jsx("path", { className: "bunny-icon-path", d: "M7.40511 6.68957C7.40511 8.7236 6.02815 10.3227 4.17816 10.3227C3.23907 10.3227 2.61071 9.94378 2.19358 9.40371V10.1404H0.0605469V0.0405273H2.26381V3.91939C2.68041 3.42158 3.28802 3.07069 4.17763 3.07069C6.02759 3.07069 7.40511 4.66981 7.40511 6.68957ZM2.17229 6.69642C2.17229 7.60802 2.77937 8.2744 3.64823 8.2744C4.53783 8.2744 5.13107 7.59372 5.13107 6.69642C5.13107 5.79912 4.53783 5.11844 3.64823 5.11844C2.77937 5.11844 2.17229 5.78482 2.17229 6.69642Z", fill: color }), jsxRuntime.jsx("path", { className: "bunny-icon-path", d: "M38.966 8.94801C38.966 9.76181 38.2668 10.4631 37.4618 10.4631C36.6499 10.4631 35.9434 9.76181 35.9434 8.94801C35.9434 8.14846 36.6494 7.46094 37.4618 7.46094C38.2668 7.46094 38.966 8.14846 38.966 8.94801Z", fill: color })] })), jsxRuntime.jsx("defs", { children: jsxRuntime.jsx("clipPath", __assign({ id: "clip0_6_851" }, { children: jsxRuntime.jsx("rect", { width: "39", height: "13", fill: "white" }) })) })] })));
|
|
@@ -20338,7 +20351,8 @@ var templateObject_1$6, templateObject_2$1;
|
|
|
20338
20351
|
var Title$1 = antd.Typography.Title;
|
|
20339
20352
|
function PaymentForms(_a) {
|
|
20340
20353
|
var quote = _a.quote, handlePaymentSuccess = _a.handlePaymentSuccess, handlePaymentFail = _a.handlePaymentFail, handleSubmit = _a.handleSubmit, proceedingToPayment = _a.proceedingToPayment, accountId = _a.accountId, overrideToken = _a.overrideToken, customCheckoutFunction = _a.customCheckoutFunction;
|
|
20341
|
-
|
|
20354
|
+
var account = useCurrentUserData().account;
|
|
20355
|
+
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: quote ? (jsxRuntime.jsx(jsxRuntime.Fragment, { children: overrideToken ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Title$1, __assign({ className: "bunny-px-4 bunny-m-0", level: 2 }, { children: "Payment" })), jsxRuntime.jsx(PaymentForm, { country: account === null || account === void 0 ? void 0 : account.billingCountry, onFail: handlePaymentFail, onPaymentSuccess: handlePaymentSuccess, accountId: accountId, quote: quote, overrideToken: overrideToken, customCheckoutFunction: customCheckoutFunction })] })) : null })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Title$1, __assign({ className: "bunny-px-4 bunny-m-0", level: 2 }, { children: "Signup" })), jsxRuntime.jsx(InitialSignupForm, { className: "bunny-px-4", onSubmit: handleSubmit, submitting: proceedingToPayment })] })) }));
|
|
20342
20356
|
}
|
|
20343
20357
|
function InitialSignupForm(_a) {
|
|
20344
20358
|
var className = _a.className, onSubmit = _a.onSubmit, submitting = _a.submitting;
|
|
@@ -20803,7 +20817,7 @@ var QuoteCheckout = function (_a) {
|
|
|
20803
20817
|
}
|
|
20804
20818
|
if (taxationRequiredAccountFields)
|
|
20805
20819
|
return (jsxRuntime.jsx(PaymentFormWrapper, __assign({ setMaxHeight: false }, { children: jsxRuntime.jsx(TaxationForm, { account: account, quote: quote }) })));
|
|
20806
|
-
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: paymentRequired ? (jsxRuntime.jsx(PaymentForm, { onFail: onFail, onPaymentSuccess: onSuccess, quote: quote })) : (jsxRuntime.jsx(PaymentFormWrapper, __assign({ setMaxHeight: false }, { children: jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-gap-2 ".concat(isMobile ? 'bunny-shadow-padding-x' : '') }, { children: [jsxRuntime.jsx(antd.Button, __assign({ onClick: handleCheckoutNoPayment, type: "primary" }, { children: isSaving ? 'Processing...' : 'Complete order' })), jsxRuntime.jsx("div", __assign({ className: "bunny-text-xs bunny-text-slate-500" }, { children: "No payment is required" }))] })) }))) }));
|
|
20820
|
+
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: paymentRequired ? (jsxRuntime.jsx(PaymentForm, { country: account === null || account === void 0 ? void 0 : account.billingCountry, onFail: onFail, onPaymentSuccess: onSuccess, quote: quote })) : (jsxRuntime.jsx(PaymentFormWrapper, __assign({ setMaxHeight: false }, { children: jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-gap-2 ".concat(isMobile ? 'bunny-shadow-padding-x' : '') }, { children: [jsxRuntime.jsx(antd.Button, __assign({ onClick: handleCheckoutNoPayment, type: "primary" }, { children: isSaving ? 'Processing...' : 'Complete order' })), jsxRuntime.jsx("div", __assign({ className: "bunny-text-xs bunny-text-slate-500" }, { children: "No payment is required" }))] })) }))) }));
|
|
20807
20821
|
};
|
|
20808
20822
|
var PaymentFormWrapper = function (_a) {
|
|
20809
20823
|
var children = _a.children, setMaxHeight = _a.setMaxHeight, className = _a.className;
|
|
@@ -20892,9 +20906,9 @@ var Checkout = function (_a) {
|
|
|
20892
20906
|
return null;
|
|
20893
20907
|
return (jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-flex-col bunny-fixed bunny-top-0 bunny-left-0 bunny-right-0 bunny-bottom-0 bunny-bg-slate-50 bunny-overflow-auto", style: {
|
|
20894
20908
|
zIndex: 1001,
|
|
20895
|
-
} }, { children: jsxRuntime.jsxs("div", __assign({ className: pageWrapperClassName(isMobile) }, { children: [jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-justify-end bunny-w-full" }, { children: jsxRuntime.jsx(icons.CloseOutlined, { className: "bunny-text-base bunny-shadow-padding-xb", onClick: onCancel }) })), jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-justify-end bunny-pt-4 bunny-gap-4 ".concat(isMobile ? 'bunny-flex-col' : 'bunny-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: "bunny-h-full", type: "vertical" })), invoice ? (jsxRuntime.jsx("div", __assign({ className: "bunny-w-full bunny-pt-12" }, { children: jsxRuntime.jsx(PaymentForm, { onPaymentSuccess: onSuccess, onFail: onFail, invoice: invoice }) }))) : quote ? (jsxRuntime.jsx(QuoteCheckout, { account: account, onFail: function (error) {
|
|
20909
|
+
} }, { children: jsxRuntime.jsxs("div", __assign({ className: pageWrapperClassName(isMobile) }, { children: [jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-justify-end bunny-w-full" }, { children: jsxRuntime.jsx(icons.CloseOutlined, { className: "bunny-text-base bunny-shadow-padding-xb", onClick: onCancel }) })), jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-justify-end bunny-pt-4 bunny-gap-4 ".concat(isMobile ? 'bunny-flex-col' : 'bunny-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: "bunny-h-full", type: "vertical" })), invoice ? (jsxRuntime.jsx("div", __assign({ className: "bunny-w-full bunny-pt-12" }, { children: jsxRuntime.jsx(PaymentForm, { country: invoice === null || invoice === void 0 ? void 0 : invoice.billingCountry, onPaymentSuccess: onSuccess, onFail: onFail, invoice: invoice }) }))) : quote ? (jsxRuntime.jsx(QuoteCheckout, { account: account, onFail: function (error) {
|
|
20896
20910
|
onFail(error);
|
|
20897
|
-
}, onSuccess: onSuccess, quote: quote, taxationRequiredAccountFields: taxationRequiredAccountFields, token: token })) : (jsxRuntime.jsx(PaymentForm, { onFail: function (error) {
|
|
20911
|
+
}, onSuccess: onSuccess, quote: quote, taxationRequiredAccountFields: taxationRequiredAccountFields, token: token })) : (jsxRuntime.jsx(PaymentForm, { country: account === null || account === void 0 ? void 0 : account.billingCountry, onFail: function (error) {
|
|
20898
20912
|
onFail(error);
|
|
20899
20913
|
}, onPaymentSuccess: onSuccess }))] })), jsxRuntime.jsx(Footer, {})] })) })));
|
|
20900
20914
|
};
|
|
@@ -23281,7 +23295,8 @@ var PaymentFormSection = function (_a) {
|
|
|
23281
23295
|
var onTokenExpired = react.useContext(BunnyContext).onTokenExpired;
|
|
23282
23296
|
var handleAllErrorFormats = common.useAllErrorFormats(onTokenExpired);
|
|
23283
23297
|
var showSuccessNotification = common.useSuccessNotification();
|
|
23284
|
-
|
|
23298
|
+
var account = useCurrentUserData().account;
|
|
23299
|
+
return (jsxRuntime.jsx("div", __assign({ className: "".concat(isMobile || hideBillingDetailsForm ? 'bunny-w-full' : 'bunny-w-1/2 bunny-pt-4', " bunny-flex bunny-justify-center") }, { children: jsxRuntime.jsx(PaymentForm, { country: account === null || account === void 0 ? void 0 : account.billingCountry, onFail: function (error) {
|
|
23285
23300
|
handleAllErrorFormats(error);
|
|
23286
23301
|
}, onSavePaymentMethod: function () {
|
|
23287
23302
|
showSuccessNotification('Your payment method has been saved');
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FormattedInvoice, PluginData, Quote } from '@bunnyapp/common';
|
|
2
|
-
export declare const PaymentForm: ({ invoice, onFail, onPaymentSuccess, onPaymentHoldSuccess, quote, accountId, onSavePaymentMethod, onRemovePaymentMethod, onSetDefaultPaymentMethod, overrideToken, customCheckoutFunction, currencyId: currencyIdFromProps, paymentHoldOptions, }: {
|
|
2
|
+
export declare const PaymentForm: ({ country, invoice, onFail, onPaymentSuccess, onPaymentHoldSuccess, quote, accountId, onSavePaymentMethod, onRemovePaymentMethod, onSetDefaultPaymentMethod, overrideToken, customCheckoutFunction, currencyId: currencyIdFromProps, paymentHoldOptions, }: {
|
|
3
|
+
country?: string | undefined;
|
|
3
4
|
invoice?: FormattedInvoice | undefined;
|
|
4
5
|
quote?: Quote | undefined;
|
|
5
6
|
onFail: (error: any) => void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PluginData } from '@bunnyapp/common';
|
|
2
|
-
declare const PaymentMethodDetails: ({ onFail, plugin, onSavePaymentMethod, }: {
|
|
2
|
+
declare const PaymentMethodDetails: ({ country, onFail, plugin, onSavePaymentMethod, }: {
|
|
3
|
+
country?: string | undefined;
|
|
3
4
|
onFail: (error: any) => void;
|
|
4
5
|
plugin: PluginData;
|
|
5
6
|
onSavePaymentMethod: () => void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PluginData } from '@bunnyapp/common';
|
|
2
|
-
declare const PaymentMethodForm: ({ plugin, onFail, onSavePaymentMethod, }: {
|
|
2
|
+
declare const PaymentMethodForm: ({ country, plugin, onFail, onSavePaymentMethod, }: {
|
|
3
|
+
country?: string | undefined;
|
|
3
4
|
plugin: PluginData;
|
|
4
5
|
onFail: (error: any) => void;
|
|
5
6
|
onSavePaymentMethod: (response: any) => void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { PluginData } from
|
|
2
|
-
declare const StripeForm: ({ plugin, onFail, onSavePaymentMethod, }: {
|
|
1
|
+
import { PluginData } from '@bunnyapp/common';
|
|
2
|
+
declare const StripeForm: ({ country, plugin, onFail, onSavePaymentMethod, }: {
|
|
3
|
+
country?: string | undefined;
|
|
3
4
|
plugin: PluginData;
|
|
4
5
|
onFail: (error: any) => void;
|
|
5
6
|
onSavePaymentMethod: (response: any) => void;
|
package/dist/esm/index.js
CHANGED
|
@@ -143,7 +143,7 @@ var BrandContext = createContext({
|
|
|
143
143
|
});
|
|
144
144
|
|
|
145
145
|
// This will be replaced at build time by rollup-plugin-replace
|
|
146
|
-
var PACKAGE_VERSION = '1.0.
|
|
146
|
+
var PACKAGE_VERSION = '1.0.66-beta.1';
|
|
147
147
|
var createRequestHeaders = function (token) {
|
|
148
148
|
var headers = createClientDevHeaders(token);
|
|
149
149
|
// Add the components version header
|
|
@@ -18862,7 +18862,7 @@ function useSave(_a) {
|
|
|
18862
18862
|
}
|
|
18863
18863
|
|
|
18864
18864
|
var PaymentMethodForm = function (_a) {
|
|
18865
|
-
var plugin = _a.plugin, onFail = _a.onFail, onSavePaymentMethod = _a.onSavePaymentMethod;
|
|
18865
|
+
var country = _a.country, plugin = _a.plugin, onFail = _a.onFail, onSavePaymentMethod = _a.onSavePaymentMethod;
|
|
18866
18866
|
// Hooks
|
|
18867
18867
|
var _b = useSave({
|
|
18868
18868
|
onSaveSuccess: onSavePaymentMethod,
|
|
@@ -18887,21 +18887,33 @@ var PaymentMethodForm = function (_a) {
|
|
|
18887
18887
|
}
|
|
18888
18888
|
});
|
|
18889
18889
|
}); };
|
|
18890
|
-
|
|
18890
|
+
console.log('country', country);
|
|
18891
|
+
console.log('plugin', plugin);
|
|
18892
|
+
console.log('plugin', plugin);
|
|
18893
|
+
return (jsxs("form", { children: [jsx(PaymentElement, { options: {
|
|
18894
|
+
layout: { type: 'accordion' },
|
|
18895
|
+
defaultValues: {
|
|
18896
|
+
billingDetails: {
|
|
18897
|
+
address: {
|
|
18898
|
+
country: country,
|
|
18899
|
+
},
|
|
18900
|
+
},
|
|
18901
|
+
},
|
|
18902
|
+
} }), jsx(SavePaymentMethodFooter, { isSaving: isSaving, onSave: onSubmit })] }));
|
|
18891
18903
|
};
|
|
18892
18904
|
|
|
18893
18905
|
// This is just a wrapper to fetch the stripe object and pass it to the form
|
|
18894
18906
|
var StripeForm = function (_a) {
|
|
18895
|
-
var plugin = _a.plugin, onFail = _a.onFail, onSavePaymentMethod = _a.onSavePaymentMethod;
|
|
18896
|
-
return (jsx(PaymentMethodForm, { plugin: plugin, onFail: onFail, onSavePaymentMethod: onSavePaymentMethod }));
|
|
18907
|
+
var country = _a.country, plugin = _a.plugin, onFail = _a.onFail, onSavePaymentMethod = _a.onSavePaymentMethod;
|
|
18908
|
+
return (jsx(PaymentMethodForm, { country: country, plugin: plugin, onFail: onFail, onSavePaymentMethod: onSavePaymentMethod }));
|
|
18897
18909
|
};
|
|
18898
18910
|
|
|
18899
18911
|
var PaymentMethodDetails = function (_a) {
|
|
18900
18912
|
var _b, _c;
|
|
18901
|
-
var onFail = _a.onFail, plugin = _a.plugin, onSavePaymentMethod = _a.onSavePaymentMethod;
|
|
18913
|
+
var country = _a.country, onFail = _a.onFail, plugin = _a.plugin, onSavePaymentMethod = _a.onSavePaymentMethod;
|
|
18902
18914
|
switch ((_c = (_b = plugin.components) === null || _b === void 0 ? void 0 : _b.frontend) === null || _c === void 0 ? void 0 : _c[0].name) {
|
|
18903
18915
|
case 'StripePayment':
|
|
18904
|
-
return (jsx(StripeForm, { onFail: onFail, onSavePaymentMethod: onSavePaymentMethod, plugin: plugin }));
|
|
18916
|
+
return (jsx(StripeForm, { country: country, onFail: onFail, onSavePaymentMethod: onSavePaymentMethod, plugin: plugin }));
|
|
18905
18917
|
case 'DemoPayPayment':
|
|
18906
18918
|
return (jsx(DemoPayForm, { onFail: onFail, onSavePaymentMethod: onSavePaymentMethod, plugin: plugin }));
|
|
18907
18919
|
default:
|
|
@@ -19048,7 +19060,7 @@ function useSetDefaultPaymentMethod(paymentPlugins, apiHost, token, accountId, o
|
|
|
19048
19060
|
var showErrorNotification$1 = useErrorNotification();
|
|
19049
19061
|
var PaymentForm = function (_a) {
|
|
19050
19062
|
var _b;
|
|
19051
|
-
var invoice = _a.invoice, onFail = _a.onFail, onPaymentSuccess = _a.onPaymentSuccess, onPaymentHoldSuccess = _a.onPaymentHoldSuccess, quote = _a.quote, accountId = _a.accountId, onSavePaymentMethod = _a.onSavePaymentMethod, onRemovePaymentMethod = _a.onRemovePaymentMethod, onSetDefaultPaymentMethod = _a.onSetDefaultPaymentMethod, overrideToken = _a.overrideToken, customCheckoutFunction = _a.customCheckoutFunction, currencyIdFromProps = _a.currencyId, paymentHoldOptions = _a.paymentHoldOptions;
|
|
19063
|
+
var country = _a.country, invoice = _a.invoice, onFail = _a.onFail, onPaymentSuccess = _a.onPaymentSuccess, onPaymentHoldSuccess = _a.onPaymentHoldSuccess, quote = _a.quote, accountId = _a.accountId, onSavePaymentMethod = _a.onSavePaymentMethod, onRemovePaymentMethod = _a.onRemovePaymentMethod, onSetDefaultPaymentMethod = _a.onSetDefaultPaymentMethod, overrideToken = _a.overrideToken, customCheckoutFunction = _a.customCheckoutFunction, currencyIdFromProps = _a.currencyId, paymentHoldOptions = _a.paymentHoldOptions;
|
|
19052
19064
|
// Local state
|
|
19053
19065
|
var _c = useState(false), showPaymentMethodForm = _c[0], setShowPaymentMethodForm = _c[1];
|
|
19054
19066
|
// Simple hooks
|
|
@@ -19132,7 +19144,7 @@ var PaymentForm = function (_a) {
|
|
|
19132
19144
|
key: '1',
|
|
19133
19145
|
showArrow: false,
|
|
19134
19146
|
label: !showPaymentMethodForm ? (jsx("div", __assign({ className: "bunny-pt-2" }, { children: jsx(Button, __assign({ onClick: handleClickAddPaymentMethod, type: "default", className: "bunny-w-full", id: "addPaymentMethod" }, { children: "Add payment method" })) }))) : null,
|
|
19135
|
-
children: (jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-gap-2 bunny-mt-2" }, { children: [jsx(PaymentMethodSelector, { onSelect: setSelectorPaymentMethodPlugin, paymentMethodAllowedPlugins: paymentPlugins, value: selectorPaymentMethodPlugin }), selectorPaymentMethodPlugin && (jsx("div", __assign({ className: "bunny-flex bunny-flex-col" }, { children: jsx(PaymentMethodDetails, { onFail: onFail, onSavePaymentMethod: handleSavePaymentMethod, plugin: selectorPaymentMethodPlugin }) })))] }))),
|
|
19147
|
+
children: (jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-gap-2 bunny-mt-2" }, { children: [jsx(PaymentMethodSelector, { onSelect: setSelectorPaymentMethodPlugin, paymentMethodAllowedPlugins: paymentPlugins, value: selectorPaymentMethodPlugin }), selectorPaymentMethodPlugin && (jsx("div", __assign({ className: "bunny-flex bunny-flex-col" }, { children: jsx(PaymentMethodDetails, { country: country, onFail: onFail, onSavePaymentMethod: handleSavePaymentMethod, plugin: selectorPaymentMethodPlugin }) })))] }))),
|
|
19136
19148
|
},
|
|
19137
19149
|
] }), paying && !selectedPaymentPluginIsManualPayment ? (jsx(Fragment, { children: defaultPaymentMethod && selectedPaymentMethodPlugin ? (jsx("div", __assign({ className: "bunny-px-4" }, { children: jsx(CheckoutFooter, { quote: quote, invoice: invoice, onPaymentSuccess: handlePaymentSuccess, onPaymentHoldSuccess: onPaymentHoldSuccess, plugin: selectedPaymentMethodPlugin, paymentHoldOptions: paymentHoldOptions }) }))) : null })) : null] }) })) })) })));
|
|
19138
19150
|
};
|
|
@@ -19199,10 +19211,10 @@ function ActualInvoice() {
|
|
|
19199
19211
|
}, [formattedInvoice]);
|
|
19200
19212
|
if (!formattedInvoice)
|
|
19201
19213
|
return jsx(Fragment, {});
|
|
19202
|
-
return (jsx("div", __assign({ className: "bunny-invoice-container" }, { children: jsxs("div", __assign({ className: "bunny-flex bunny-gap-6 bunny-overflow-hidden ".concat(isMobile ? 'bunny-flex-col bunny-w-full' : '', " ").concat(className) }, { children: [formattedInvoice.isLegacy ? (jsx("div", __assign({ className: "bunny-flex bunny-justify-center bunny-w-full" }, { children: jsx(LegacyDocument, { documentUuid: formattedInvoice.uuid, documentType: "invoice" }) }))) : (invoiceQuoteViewComponent || (jsx(InvoiceQuoteView, { html: formattedInvoice.html, formattedInvoice: formattedInvoice, backButtonName: backButtonName, onBackButtonClick: onBackButtonClick }))), isInvoicePayable && (jsx("div", __assign({ className: "bunny-w-full ".concat(hideDownloadButton || formattedInvoice.isLegacy ? '' : 'pt-12') }, { children: jsx(PaymentForm, { onPaymentSuccess: onSuccess, onFail: onFail, invoice: formattedInvoice }) })))] })) })));
|
|
19214
|
+
return (jsx("div", __assign({ className: "bunny-invoice-container" }, { children: jsxs("div", __assign({ className: "bunny-flex bunny-gap-6 bunny-overflow-hidden ".concat(isMobile ? 'bunny-flex-col bunny-w-full' : '', " ").concat(className) }, { children: [formattedInvoice.isLegacy ? (jsx("div", __assign({ className: "bunny-flex bunny-justify-center bunny-w-full" }, { children: jsx(LegacyDocument, { documentUuid: formattedInvoice.uuid, documentType: "invoice" }) }))) : (invoiceQuoteViewComponent || (jsx(InvoiceQuoteView, { html: formattedInvoice.html, formattedInvoice: formattedInvoice, backButtonName: backButtonName, onBackButtonClick: onBackButtonClick }))), isInvoicePayable && (jsx("div", __assign({ className: "bunny-w-full ".concat(hideDownloadButton || formattedInvoice.isLegacy ? '' : 'pt-12') }, { children: jsx(PaymentForm, { country: formattedInvoice === null || formattedInvoice === void 0 ? void 0 : formattedInvoice.billingCountry, onPaymentSuccess: onSuccess, onFail: onFail, invoice: formattedInvoice }) })))] })) })));
|
|
19203
19215
|
}
|
|
19204
19216
|
|
|
19205
|
-
var MUTATION$7 = function (id) { return "\n query formattedQuote ($id: ID) {\n formattedQuote (id: $id) {\n quote {\n documents { id filename size date url }\n firstInvoice {\n id\n state\n }\n payableId\n id\n payToAccept\n currentPaymentHold {\n createdAt\n expiresAt\n id\n updatedAt\n paymentMethod {\n accountId\n createdAt\n expirationDate\n failureCode\n id\n isDefault\n lastSuccess\n paymentType\n pluginId\n state\n updatedAt\n metadata {\n description\n expiration\n icon\n identifier\n issuer\n kind\n }\n }\n }\n }\n payableId\n acceptedAt\n acceptedByName\n amount\n amountDue\n amountsByPeriod {\n id\n name\n amount\n }\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 }"; };
|
|
19217
|
+
var MUTATION$7 = function (id) { return "\n query formattedQuote ($id: ID) {\n formattedQuote (id: $id) {\n quote {\n documentTemplateId\n documents { id filename size date url }\n firstInvoice {\n id\n state\n }\n payableId\n id\n payToAccept\n currentPaymentHold {\n createdAt\n expiresAt\n id\n updatedAt\n paymentMethod {\n accountId\n createdAt\n expirationDate\n failureCode\n id\n isDefault\n lastSuccess\n paymentType\n pluginId\n state\n updatedAt\n metadata {\n description\n expiration\n icon\n identifier\n issuer\n kind\n }\n }\n }\n }\n payableId\n acceptedAt\n acceptedByName\n amount\n amountDue\n amountsByPeriod {\n id\n name\n amount\n }\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 }"; };
|
|
19206
19218
|
var getFormattedQuote = function (_a) {
|
|
19207
19219
|
var id = _a.id, token = _a.token, apiHost = _a.apiHost;
|
|
19208
19220
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -19535,15 +19547,25 @@ var AcceptQuoteModal = function (_a) {
|
|
|
19535
19547
|
}, open: acceptBoxVisible, title: "Accept quote", width: 400 }, { children: jsxs(Form, __assign({ className: "bunny-flex bunny-flex-col bunny-gap-2", form: form, layout: "vertical" }, { children: [jsx(Form.Item, __assign({ label: "Your name", name: "name", rules: createRules(true, "Your name") }, { children: jsx(Input, { autoFocus: true, ref: firstInputRef }) })), jsx(Form.Item, __assign({ label: "Your job title", name: "title", rules: createRules(true, "Your job title") }, { children: jsx(Input, {}) })), jsx(Form.Item, __assign({ label: "Purchase order number", name: "poNumber", rules: createRules(poNumberRequired, "Purchase order number") }, { children: jsx(Input, {}) })), taxNumberRequired && (jsx(Form.Item, __assign({ name: "taxNumber", label: taxNumberLabel, rules: createRules(taxNumberRequired, taxNumberLabel) }, { children: jsx(Input, {}) })))] })) })));
|
|
19536
19548
|
};
|
|
19537
19549
|
|
|
19550
|
+
var useCurrentUserData = function () {
|
|
19551
|
+
var queryClient = useQueryClient();
|
|
19552
|
+
var token = useToken();
|
|
19553
|
+
var currentUser = queryClient.getQueryData(QueryKeyFactory.default.currentUserKey(token));
|
|
19554
|
+
if (!currentUser)
|
|
19555
|
+
return {};
|
|
19556
|
+
return currentUser;
|
|
19557
|
+
};
|
|
19558
|
+
|
|
19538
19559
|
var Title$2 = Typography.Title;
|
|
19539
19560
|
var showSuccessNotification$1 = useSuccessNotification();
|
|
19540
19561
|
var PaymentHoldModal = function (_a) {
|
|
19541
19562
|
var visible = _a.visible, setVisible = _a.setVisible, quote = _a.quote;
|
|
19542
19563
|
var queryClient = useQueryClient();
|
|
19543
19564
|
var token = useToken();
|
|
19565
|
+
var account = useCurrentUserData().account;
|
|
19544
19566
|
return (jsxs(StyledModal$1, __assign({ centered: true, onCancel: function () {
|
|
19545
19567
|
setVisible(false);
|
|
19546
|
-
}, footer: null, open: visible, width: 600 }, { children: [jsx(Title$2, __assign({ className: "mt-4 pb-4 mx-4", level: 5 }, { children: "Pay to accept" })), jsx("div", __assign({ className: "mb-4" }, { children: jsx(PaymentForm, { quote: {
|
|
19568
|
+
}, footer: null, open: visible, width: 600 }, { children: [jsx(Title$2, __assign({ className: "mt-4 pb-4 mx-4", level: 5 }, { children: "Pay to accept" })), jsx("div", __assign({ className: "mb-4" }, { children: jsx(PaymentForm, { country: account === null || account === void 0 ? void 0 : account.billingCountry, quote: {
|
|
19547
19569
|
amount: quote.amount,
|
|
19548
19570
|
currencyId: quote.currency,
|
|
19549
19571
|
id: quote.quote.id,
|
|
@@ -19659,7 +19681,7 @@ function ActualQuote() {
|
|
|
19659
19681
|
return jsx(Invoice, { id: firstInvoice.id });
|
|
19660
19682
|
}
|
|
19661
19683
|
return (jsxs(Fragment, { children: [jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-gap-4 ".concat(isMobile ? 'bunny-w-full bunny-overflow-hidden' : '', " ").concat(className) }, { children: [jsx(QuoteButtons, { isAccepted: isAccepted, formattedQuote: formattedQuote, isMobile: isMobile, hideDownloadButton: hideDownloadButton, id: id, isAccepting: isAccepting, handleClickAccept: handleClickAccept, setPaymentHoldModalVisible: setPaymentHoldModalVisible, shouldDoPaymentHold: shouldDoPaymentHold, paymentHoldCompleted: paymentHoldCompleted, paymentHold: paymentHold }), jsx(InvoiceQuoteView, __assign({ html: formattedQuote.html, targetUrl: ((_b = formattedQuote === null || formattedQuote === void 0 ? void 0 : formattedQuote.quote) === null || _b === void 0 ? void 0 : _b.documentTemplateId)
|
|
19662
|
-
? "".concat(apiHost, "/api/pdf/quote/").concat(formattedQuote.id)
|
|
19684
|
+
? "".concat(apiHost, "/api/pdf/quote/").concat(formattedQuote.quote.id)
|
|
19663
19685
|
: undefined }, { children: ((_d = (_c = formattedQuote.quote) === null || _c === void 0 ? void 0 : _c.documents) === null || _d === void 0 ? void 0 : _d.length) > 0 ? (jsx("div", __assign({ className: "bunny-flex bunny-flex-col bunny-items-end" }, { children: formattedQuote.quote.documents.map(function (doc, index) {
|
|
19664
19686
|
return (jsx(Button, __assign({ download: doc.filename, href: doc.url, type: "link" }, { children: doc.filename }), index));
|
|
19665
19687
|
}) }))) : null }))] })), jsx(AcceptQuoteModal, { acceptBoxVisible: acceptBoxVisible, formattedQuote: formattedQuote, setAcceptBoxVisible: setAcceptBoxVisible, setIsAccepting: setIsAccepting, sendAccept: sendAccept, isSendAcceptPending: isSendAcceptPending }), jsx(PaymentHoldModal, { visible: paymentHoldModalVisible, setVisible: setPaymentHoldModalVisible, quote: formattedQuote }), jsx(PandadocPollingModal, { isVisible: pandadocPollingModalVisible, setVisible: setPandadocPollingModalVisible, id: id })] }));
|
|
@@ -20275,15 +20297,6 @@ var getQuote = function (_a) {
|
|
|
20275
20297
|
});
|
|
20276
20298
|
};
|
|
20277
20299
|
|
|
20278
|
-
var useCurrentUserData = function () {
|
|
20279
|
-
var queryClient = useQueryClient();
|
|
20280
|
-
var token = useToken();
|
|
20281
|
-
var currentUser = queryClient.getQueryData(QueryKeyFactory.default.currentUserKey(token));
|
|
20282
|
-
if (!currentUser)
|
|
20283
|
-
return {};
|
|
20284
|
-
return currentUser;
|
|
20285
|
-
};
|
|
20286
|
-
|
|
20287
20300
|
var BunnyFooterIcon = function (_a) {
|
|
20288
20301
|
var color = _a.color;
|
|
20289
20302
|
return (jsxs("svg", __assign({ width: "45", height: "15", viewBox: "0 0 39 13", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: [jsxs("g", __assign({ clipPath: "url(#clip0_6_851)" }, { children: [jsx("path", { className: "bunny-icon-path", d: "M14.5898 7.19708C14.5898 9.35053 13.0926 10.325 11.2495 10.325C9.39955 10.325 7.90234 9.35001 7.90234 7.18967V3.26221H10.1125V7.00052C10.1125 7.87719 10.5855 8.27725 11.2495 8.27725C11.9061 8.27725 12.3865 7.87719 12.3865 7.00052V3.26221H14.5898V7.19708Z", fill: color }), jsx("path", { className: "bunny-icon-path", d: "M31.8943 12.9625H29.4793L31.8523 8.62816L28.9355 3.26221H31.4708L33.0457 6.35524L34.5924 3.26221H37.0075L31.8943 12.9625Z", fill: color }), jsx("path", { className: "bunny-icon-path", d: "M15.1602 5.96827C15.1602 3.8148 16.6574 2.84033 18.5005 2.84033C20.3504 2.84033 21.8476 3.81533 21.8476 5.97568V10.1473H19.6374V6.16483C19.6374 5.28815 19.1645 4.8881 18.5005 4.8881C17.8439 4.8881 17.3634 5.28815 17.3634 6.16483V10.1473H15.1602V5.96827Z", fill: color }), jsx("path", { className: "bunny-icon-path", d: "M22.4316 5.96827C22.4316 3.8148 23.9289 2.84033 25.7719 2.84033C27.6219 2.84033 29.1191 3.81533 29.1191 5.97568V10.1473H26.9089V6.16483C26.9089 5.28815 26.4359 4.8881 25.7719 4.8881C25.1154 4.8881 24.6349 5.28815 24.6349 6.16483V10.1473H22.4316V5.96827Z", fill: color }), jsx("path", { className: "bunny-icon-path", d: "M7.40511 6.68957C7.40511 8.7236 6.02815 10.3227 4.17816 10.3227C3.23907 10.3227 2.61071 9.94378 2.19358 9.40371V10.1404H0.0605469V0.0405273H2.26381V3.91939C2.68041 3.42158 3.28802 3.07069 4.17763 3.07069C6.02759 3.07069 7.40511 4.66981 7.40511 6.68957ZM2.17229 6.69642C2.17229 7.60802 2.77937 8.2744 3.64823 8.2744C4.53783 8.2744 5.13107 7.59372 5.13107 6.69642C5.13107 5.79912 4.53783 5.11844 3.64823 5.11844C2.77937 5.11844 2.17229 5.78482 2.17229 6.69642Z", fill: color }), jsx("path", { className: "bunny-icon-path", d: "M38.966 8.94801C38.966 9.76181 38.2668 10.4631 37.4618 10.4631C36.6499 10.4631 35.9434 9.76181 35.9434 8.94801C35.9434 8.14846 36.6494 7.46094 37.4618 7.46094C38.2668 7.46094 38.966 8.14846 38.966 8.94801Z", fill: color })] })), jsx("defs", { children: jsx("clipPath", __assign({ id: "clip0_6_851" }, { children: jsx("rect", { width: "39", height: "13", fill: "white" }) })) })] })));
|
|
@@ -20308,7 +20321,8 @@ var templateObject_1$6, templateObject_2$1;
|
|
|
20308
20321
|
var Title$1 = Typography.Title;
|
|
20309
20322
|
function PaymentForms(_a) {
|
|
20310
20323
|
var quote = _a.quote, handlePaymentSuccess = _a.handlePaymentSuccess, handlePaymentFail = _a.handlePaymentFail, handleSubmit = _a.handleSubmit, proceedingToPayment = _a.proceedingToPayment, accountId = _a.accountId, overrideToken = _a.overrideToken, customCheckoutFunction = _a.customCheckoutFunction;
|
|
20311
|
-
|
|
20324
|
+
var account = useCurrentUserData().account;
|
|
20325
|
+
return (jsx(Fragment, { children: quote ? (jsx(Fragment, { children: overrideToken ? (jsxs(Fragment, { children: [jsx(Title$1, __assign({ className: "bunny-px-4 bunny-m-0", level: 2 }, { children: "Payment" })), jsx(PaymentForm, { country: account === null || account === void 0 ? void 0 : account.billingCountry, onFail: handlePaymentFail, onPaymentSuccess: handlePaymentSuccess, accountId: accountId, quote: quote, overrideToken: overrideToken, customCheckoutFunction: customCheckoutFunction })] })) : null })) : (jsxs(Fragment, { children: [jsx(Title$1, __assign({ className: "bunny-px-4 bunny-m-0", level: 2 }, { children: "Signup" })), jsx(InitialSignupForm, { className: "bunny-px-4", onSubmit: handleSubmit, submitting: proceedingToPayment })] })) }));
|
|
20312
20326
|
}
|
|
20313
20327
|
function InitialSignupForm(_a) {
|
|
20314
20328
|
var className = _a.className, onSubmit = _a.onSubmit, submitting = _a.submitting;
|
|
@@ -20773,7 +20787,7 @@ var QuoteCheckout = function (_a) {
|
|
|
20773
20787
|
}
|
|
20774
20788
|
if (taxationRequiredAccountFields)
|
|
20775
20789
|
return (jsx(PaymentFormWrapper, __assign({ setMaxHeight: false }, { children: jsx(TaxationForm, { account: account, quote: quote }) })));
|
|
20776
|
-
return (jsx(Fragment, { children: paymentRequired ? (jsx(PaymentForm, { onFail: onFail, onPaymentSuccess: onSuccess, quote: quote })) : (jsx(PaymentFormWrapper, __assign({ setMaxHeight: false }, { children: jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-gap-2 ".concat(isMobile ? 'bunny-shadow-padding-x' : '') }, { children: [jsx(Button, __assign({ onClick: handleCheckoutNoPayment, type: "primary" }, { children: isSaving ? 'Processing...' : 'Complete order' })), jsx("div", __assign({ className: "bunny-text-xs bunny-text-slate-500" }, { children: "No payment is required" }))] })) }))) }));
|
|
20790
|
+
return (jsx(Fragment, { children: paymentRequired ? (jsx(PaymentForm, { country: account === null || account === void 0 ? void 0 : account.billingCountry, onFail: onFail, onPaymentSuccess: onSuccess, quote: quote })) : (jsx(PaymentFormWrapper, __assign({ setMaxHeight: false }, { children: jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-gap-2 ".concat(isMobile ? 'bunny-shadow-padding-x' : '') }, { children: [jsx(Button, __assign({ onClick: handleCheckoutNoPayment, type: "primary" }, { children: isSaving ? 'Processing...' : 'Complete order' })), jsx("div", __assign({ className: "bunny-text-xs bunny-text-slate-500" }, { children: "No payment is required" }))] })) }))) }));
|
|
20777
20791
|
};
|
|
20778
20792
|
var PaymentFormWrapper = function (_a) {
|
|
20779
20793
|
var children = _a.children, setMaxHeight = _a.setMaxHeight, className = _a.className;
|
|
@@ -20862,9 +20876,9 @@ var Checkout = function (_a) {
|
|
|
20862
20876
|
return null;
|
|
20863
20877
|
return (jsx("div", __assign({ className: "bunny-flex bunny-flex-col bunny-fixed bunny-top-0 bunny-left-0 bunny-right-0 bunny-bottom-0 bunny-bg-slate-50 bunny-overflow-auto", style: {
|
|
20864
20878
|
zIndex: 1001,
|
|
20865
|
-
} }, { children: jsxs("div", __assign({ className: pageWrapperClassName(isMobile) }, { children: [jsx("div", __assign({ className: "bunny-flex bunny-justify-end bunny-w-full" }, { children: jsx(CloseOutlined, { className: "bunny-text-base bunny-shadow-padding-xb", onClick: onCancel }) })), jsxs("div", __assign({ className: "bunny-flex bunny-justify-end bunny-pt-4 bunny-gap-4 ".concat(isMobile ? 'bunny-flex-col' : 'bunny-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)) && (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)) && (jsx(Divider, { className: "bunny-h-full", type: "vertical" })), invoice ? (jsx("div", __assign({ className: "bunny-w-full bunny-pt-12" }, { children: jsx(PaymentForm, { onPaymentSuccess: onSuccess, onFail: onFail, invoice: invoice }) }))) : quote ? (jsx(QuoteCheckout, { account: account, onFail: function (error) {
|
|
20879
|
+
} }, { children: jsxs("div", __assign({ className: pageWrapperClassName(isMobile) }, { children: [jsx("div", __assign({ className: "bunny-flex bunny-justify-end bunny-w-full" }, { children: jsx(CloseOutlined, { className: "bunny-text-base bunny-shadow-padding-xb", onClick: onCancel }) })), jsxs("div", __assign({ className: "bunny-flex bunny-justify-end bunny-pt-4 bunny-gap-4 ".concat(isMobile ? 'bunny-flex-col' : 'bunny-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)) && (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)) && (jsx(Divider, { className: "bunny-h-full", type: "vertical" })), invoice ? (jsx("div", __assign({ className: "bunny-w-full bunny-pt-12" }, { children: jsx(PaymentForm, { country: invoice === null || invoice === void 0 ? void 0 : invoice.billingCountry, onPaymentSuccess: onSuccess, onFail: onFail, invoice: invoice }) }))) : quote ? (jsx(QuoteCheckout, { account: account, onFail: function (error) {
|
|
20866
20880
|
onFail(error);
|
|
20867
|
-
}, onSuccess: onSuccess, quote: quote, taxationRequiredAccountFields: taxationRequiredAccountFields, token: token })) : (jsx(PaymentForm, { onFail: function (error) {
|
|
20881
|
+
}, onSuccess: onSuccess, quote: quote, taxationRequiredAccountFields: taxationRequiredAccountFields, token: token })) : (jsx(PaymentForm, { country: account === null || account === void 0 ? void 0 : account.billingCountry, onFail: function (error) {
|
|
20868
20882
|
onFail(error);
|
|
20869
20883
|
}, onPaymentSuccess: onSuccess }))] })), jsx(Footer, {})] })) })));
|
|
20870
20884
|
};
|
|
@@ -23251,7 +23265,8 @@ var PaymentFormSection = function (_a) {
|
|
|
23251
23265
|
var onTokenExpired = useContext(BunnyContext).onTokenExpired;
|
|
23252
23266
|
var handleAllErrorFormats = useAllErrorFormats(onTokenExpired);
|
|
23253
23267
|
var showSuccessNotification = useSuccessNotification();
|
|
23254
|
-
|
|
23268
|
+
var account = useCurrentUserData().account;
|
|
23269
|
+
return (jsx("div", __assign({ className: "".concat(isMobile || hideBillingDetailsForm ? 'bunny-w-full' : 'bunny-w-1/2 bunny-pt-4', " bunny-flex bunny-justify-center") }, { children: jsx(PaymentForm, { country: account === null || account === void 0 ? void 0 : account.billingCountry, onFail: function (error) {
|
|
23255
23270
|
handleAllErrorFormats(error);
|
|
23256
23271
|
}, onSavePaymentMethod: function () {
|
|
23257
23272
|
showSuccessNotification('Your payment method has been saved');
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FormattedInvoice, PluginData, Quote } from '@bunnyapp/common';
|
|
2
|
-
export declare const PaymentForm: ({ invoice, onFail, onPaymentSuccess, onPaymentHoldSuccess, quote, accountId, onSavePaymentMethod, onRemovePaymentMethod, onSetDefaultPaymentMethod, overrideToken, customCheckoutFunction, currencyId: currencyIdFromProps, paymentHoldOptions, }: {
|
|
2
|
+
export declare const PaymentForm: ({ country, invoice, onFail, onPaymentSuccess, onPaymentHoldSuccess, quote, accountId, onSavePaymentMethod, onRemovePaymentMethod, onSetDefaultPaymentMethod, overrideToken, customCheckoutFunction, currencyId: currencyIdFromProps, paymentHoldOptions, }: {
|
|
3
|
+
country?: string | undefined;
|
|
3
4
|
invoice?: FormattedInvoice | undefined;
|
|
4
5
|
quote?: Quote | undefined;
|
|
5
6
|
onFail: (error: any) => void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PluginData } from '@bunnyapp/common';
|
|
2
|
-
declare const PaymentMethodDetails: ({ onFail, plugin, onSavePaymentMethod, }: {
|
|
2
|
+
declare const PaymentMethodDetails: ({ country, onFail, plugin, onSavePaymentMethod, }: {
|
|
3
|
+
country?: string | undefined;
|
|
3
4
|
onFail: (error: any) => void;
|
|
4
5
|
plugin: PluginData;
|
|
5
6
|
onSavePaymentMethod: () => void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PluginData } from '@bunnyapp/common';
|
|
2
|
-
declare const PaymentMethodForm: ({ plugin, onFail, onSavePaymentMethod, }: {
|
|
2
|
+
declare const PaymentMethodForm: ({ country, plugin, onFail, onSavePaymentMethod, }: {
|
|
3
|
+
country?: string | undefined;
|
|
3
4
|
plugin: PluginData;
|
|
4
5
|
onFail: (error: any) => void;
|
|
5
6
|
onSavePaymentMethod: (response: any) => void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { PluginData } from
|
|
2
|
-
declare const StripeForm: ({ plugin, onFail, onSavePaymentMethod, }: {
|
|
1
|
+
import { PluginData } from '@bunnyapp/common';
|
|
2
|
+
declare const StripeForm: ({ country, plugin, onFail, onSavePaymentMethod, }: {
|
|
3
|
+
country?: string | undefined;
|
|
3
4
|
plugin: PluginData;
|
|
4
5
|
onFail: (error: any) => void;
|
|
5
6
|
onSavePaymentMethod: (response: any) => void;
|
package/dist/index.d.ts
CHANGED
|
@@ -71,7 +71,8 @@ declare function Quotes({ className, columns, filter, filterQuotes, sort, noQuot
|
|
|
71
71
|
noQuotesMessage?: string;
|
|
72
72
|
}): react_jsx_runtime.JSX.Element;
|
|
73
73
|
|
|
74
|
-
declare const PaymentForm: ({ invoice, onFail, onPaymentSuccess, onPaymentHoldSuccess, quote, accountId, onSavePaymentMethod, onRemovePaymentMethod, onSetDefaultPaymentMethod, overrideToken, customCheckoutFunction, currencyId: currencyIdFromProps, paymentHoldOptions, }: {
|
|
74
|
+
declare const PaymentForm: ({ country, invoice, onFail, onPaymentSuccess, onPaymentHoldSuccess, quote, accountId, onSavePaymentMethod, onRemovePaymentMethod, onSetDefaultPaymentMethod, overrideToken, customCheckoutFunction, currencyId: currencyIdFromProps, paymentHoldOptions, }: {
|
|
75
|
+
country?: string | undefined;
|
|
75
76
|
invoice?: FormattedInvoice | undefined;
|
|
76
77
|
quote?: Quote$1 | undefined;
|
|
77
78
|
onFail: (error: any) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bunnyapp/components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.66-beta.1",
|
|
4
4
|
"description": "Components from the Bunny portal to embed Bunny UI functionality into your application.",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
67
|
"@ant-design/icons": "^5.6.1",
|
|
68
|
-
"@bunnyapp/common": "^1.0.
|
|
68
|
+
"@bunnyapp/common": "^1.0.66-beta.1",
|
|
69
69
|
"@fortawesome/fontawesome-svg-core": "^6.7.2",
|
|
70
70
|
"@fortawesome/free-brands-svg-icons": "^6.7.2",
|
|
71
71
|
"@fortawesome/free-regular-svg-icons": "^6.7.2",
|