@aglyn/plugins-commerce 1.31.0 → 1.33.0
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/README.md +4 -0
- package/package.json +13 -13
- package/src/lib/components/cart.js +35 -15
- package/src/lib/components/cart.js.map +1 -1
- package/src/lib/components/commerce-console-page.js +6 -0
- package/src/lib/components/commerce-console-page.js.map +1 -1
- package/src/lib/components/console/currencies-card.component.d.ts +21 -0
- package/src/lib/components/console/currencies-card.component.js +408 -0
- package/src/lib/components/console/currencies-card.component.js.map +1 -0
- package/src/lib/components/console/product-add-ons-fields.component.d.ts +13 -0
- package/src/lib/components/console/product-add-ons-fields.component.js +74 -2
- package/src/lib/components/console/product-add-ons-fields.component.js.map +1 -1
- package/src/lib/components/console/product-editor-dialog.component.js +42 -1
- package/src/lib/components/console/product-editor-dialog.component.js.map +1 -1
- package/src/lib/components/console/product-fixed-prices-fields.component.d.ts +25 -0
- package/src/lib/components/console/product-fixed-prices-fields.component.js +112 -0
- package/src/lib/components/console/product-fixed-prices-fields.component.js.map +1 -0
- package/src/lib/components/console/reservations-card.component.js +32 -15
- package/src/lib/components/console/reservations-card.component.js.map +1 -1
- package/src/lib/components/console/shipping-settings-card.component.js +337 -10
- package/src/lib/components/console/shipping-settings-card.component.js.map +1 -1
- package/src/lib/components/console/store-settings-card.component.js +1 -1
- package/src/lib/components/console/store-settings-card.component.js.map +1 -1
- package/src/lib/components/console/use-currency-setup.d.ts +20 -0
- package/src/lib/components/console/use-currency-setup.js +61 -0
- package/src/lib/components/console/use-currency-setup.js.map +1 -0
- package/src/lib/components/currency-selector.d.ts +36 -0
- package/src/lib/components/currency-selector.js +157 -0
- package/src/lib/components/currency-selector.js.map +1 -0
- package/src/lib/components/product-add-ons.d.ts +9 -1
- package/src/lib/components/product-add-ons.js +8 -4
- package/src/lib/components/product-add-ons.js.map +1 -1
- package/src/lib/components/product-choice-cards.d.ts +13 -1
- package/src/lib/components/product-choice-cards.js +5 -4
- package/src/lib/components/product-choice-cards.js.map +1 -1
- package/src/lib/components/product-detail.d.ts +8 -0
- package/src/lib/components/product-detail.js +38 -11
- package/src/lib/components/product-detail.js.map +1 -1
- package/src/lib/components/product-grid.d.ts +2 -0
- package/src/lib/components/product-grid.js +22 -9
- package/src/lib/components/product-grid.js.map +1 -1
- package/src/lib/components/related-products.js +6 -2
- package/src/lib/components/related-products.js.map +1 -1
- package/src/lib/components/shopper-currency.d.ts +108 -0
- package/src/lib/components/shopper-currency.js +262 -0
- package/src/lib/components/shopper-currency.js.map +1 -0
- package/src/lib/components/wishlist.js +7 -1
- package/src/lib/components/wishlist.js.map +1 -1
- package/src/lib/declarations.server.js +39 -0
- package/src/lib/declarations.server.js.map +1 -1
- package/src/lib/model/commerce-currency-setup.d.ts +79 -0
- package/src/lib/model/commerce-currency-setup.js +124 -0
- package/src/lib/model/commerce-currency-setup.js.map +1 -0
- package/src/lib/model/commerce-currency.d.ts +215 -0
- package/src/lib/model/commerce-currency.js +511 -0
- package/src/lib/model/commerce-currency.js.map +1 -0
- package/src/lib/model/commerce-orders.d.ts +17 -0
- package/src/lib/model/commerce-orders.js +10 -5
- package/src/lib/model/commerce-orders.js.map +1 -1
- package/src/lib/model/commerce-record-routes.js +26 -1
- package/src/lib/model/commerce-record-routes.js.map +1 -1
- package/src/lib/model/commerce-reservations.d.ts +6 -0
- package/src/lib/model/commerce-reservations.js.map +1 -1
- package/src/lib/model/commerce-shipping.d.ts +66 -11
- package/src/lib/model/commerce-shipping.js +91 -7
- package/src/lib/model/commerce-shipping.js.map +1 -1
- package/src/lib/model/commerce.d.ts +6 -0
- package/src/lib/model/commerce.js.map +1 -1
- package/src/lib/model/index.d.ts +2 -0
- package/src/lib/model/index.js +2 -0
- package/src/lib/model/index.js.map +1 -1
- package/src/lib/model/order-figures.js +9 -2
- package/src/lib/model/order-figures.js.map +1 -1
- package/src/lib/model/product-modifiers.d.ts +5 -0
- package/src/lib/model/product-modifiers.js.map +1 -1
- package/src/lib/model/store-setup-content.js +23 -2
- package/src/lib/model/store-setup-content.js.map +1 -1
- package/src/lib/server/billing-webhook.js +37 -24
- package/src/lib/server/billing-webhook.js.map +1 -1
- package/src/lib/server/carrier-shipping.d.ts +2 -0
- package/src/lib/server/carrier-shipping.js +8 -4
- package/src/lib/server/carrier-shipping.js.map +1 -1
- package/src/lib/server/cart-checkout.js +74 -13
- package/src/lib/server/cart-checkout.js.map +1 -1
- package/src/lib/server/cart.d.ts +12 -0
- package/src/lib/server/cart.js +50 -4
- package/src/lib/server/cart.js.map +1 -1
- package/src/lib/server/catalog.d.ts +5 -0
- package/src/lib/server/catalog.js +7 -0
- package/src/lib/server/catalog.js.map +1 -1
- package/src/lib/server/checkout.js +53 -12
- package/src/lib/server/checkout.js.map +1 -1
- package/src/lib/server/currency.d.ts +93 -0
- package/src/lib/server/currency.js +182 -0
- package/src/lib/server/currency.js.map +1 -0
- package/src/lib/server/order-notifications.js +4 -2
- package/src/lib/server/order-notifications.js.map +1 -1
- package/src/lib/server/product.d.ts +9 -0
- package/src/lib/server/product.js +12 -0
- package/src/lib/server/product.js.map +1 -1
- package/src/lib/server/refund.js +3 -3
- package/src/lib/server/refund.js.map +1 -1
- package/src/lib/server/site-chat-tools.d.ts +22 -0
- package/src/lib/server/site-chat-tools.js +369 -0
- package/src/lib/server/site-chat-tools.js.map +1 -0
- package/src/lib/server/site-chat-visitor.d.ts +24 -0
- package/src/lib/server/site-chat-visitor.js +39 -0
- package/src/lib/server/site-chat-visitor.js.map +1 -0
- package/src/lib/server/site-offers.d.ts +31 -0
- package/src/lib/server/site-offers.js +91 -0
- package/src/lib/server/site-offers.js.map +1 -0
- package/src/lib/server/stays-site-search.d.ts +20 -0
- package/src/lib/server/stays-site-search.js +78 -0
- package/src/lib/server/stays-site-search.js.map +1 -0
- package/src/lib/server.js +20 -0
- package/src/lib/server.js.map +1 -1
- package/src/lib/site-chat-tool-definitions.d.ts +26 -0
- package/src/lib/site-chat-tool-definitions.js +141 -0
- package/src/lib/site-chat-tool-definitions.js.map +1 -0
- package/src/lib/site.js +8 -0
- package/src/lib/site.js.map +1 -1
- package/src/lib/subprocessors.js +7 -0
- package/src/lib/subprocessors.js.map +1 -1
|
@@ -429,7 +429,7 @@ async function findOrderForDispute(paymentIntentId) {
|
|
|
429
429
|
}
|
|
430
430
|
transaction.set(orderRef, {
|
|
431
431
|
externalRefundedCents: externalCents + newCents,
|
|
432
|
-
timeline: CommerceModel.appendOrderEvent(order, 'refund',
|
|
432
|
+
timeline: CommerceModel.appendOrderEvent(order, 'refund', `${CommerceModel.saleMoneyText(newCents, order.currency)} refunded outside the dashboard (in Stripe)`)
|
|
433
433
|
}, {
|
|
434
434
|
merge: true
|
|
435
435
|
});
|
|
@@ -1826,6 +1826,12 @@ async function findOrderForDispute(paymentIntentId) {
|
|
|
1826
1826
|
}
|
|
1827
1827
|
export const commerceBillingWebhookHandler = async ({ type, object, event, requestHost })=>{
|
|
1828
1828
|
var _object_metadata, _object_metadata1, _object_metadata2, _object_metadata3, _object_metadata4;
|
|
1829
|
+
// The money of THIS sale in the currency it was charged in (AGL-4248): a
|
|
1830
|
+
// session or charge names it. A USD sale reads exactly as it always has.
|
|
1831
|
+
const saleMoney = (cents)=>{
|
|
1832
|
+
var _ref;
|
|
1833
|
+
return CommerceModel.saleMoneyText(cents, String((_ref = object == null ? void 0 : object.currency) != null ? _ref : 'usd'));
|
|
1834
|
+
};
|
|
1829
1835
|
// THE MERCHANT'S PAYMENT ACCOUNT CHANGED. Every commerce money route —
|
|
1830
1836
|
// checkout, cart checkout, draft orders, reservations, POS — gates the sale
|
|
1831
1837
|
// on the readiness the connect route CACHED on the merchant's profile
|
|
@@ -3049,8 +3055,11 @@ export const commerceBillingWebhookHandler = async ({ type, object, event, reque
|
|
|
3049
3055
|
} : {}, {
|
|
3050
3056
|
quantity: line.quantity
|
|
3051
3057
|
}));
|
|
3052
|
-
|
|
3053
|
-
|
|
3058
|
+
// The units the shopper was charged, in cart order, when the
|
|
3059
|
+
// checkout charged in another currency than the store's (AGL-4248).
|
|
3060
|
+
const chargedUnits = CommerceModel.decodeChargeUnitsMetadata(object == null ? void 0 : object.metadata);
|
|
3061
|
+
const lineItems = cart.lines.map((line, lineIndex)=>{
|
|
3062
|
+
var _variant_options, _variant_options1, _ref, _ref1;
|
|
3054
3063
|
const product = productsById.get(line.productId);
|
|
3055
3064
|
if (!product) return null;
|
|
3056
3065
|
const variant = line.variantId ? product.variants.find((item)=>item.id === line.variantId) : product.variants[0];
|
|
@@ -3082,7 +3091,9 @@ export const commerceBillingWebhookHandler = async ({ type, object, event, reque
|
|
|
3082
3091
|
supplierId: product.supplierId
|
|
3083
3092
|
} : {}, {
|
|
3084
3093
|
quantity: line.quantity,
|
|
3085
|
-
|
|
3094
|
+
// The unit the shopper was charged, when the checkout charged in
|
|
3095
|
+
// another currency than the store's (AGL-4248).
|
|
3096
|
+
unitAmountCents: (_ref = chargedUnits == null ? void 0 : chargedUnits[lineIndex]) != null ? _ref : Math.round(Number((_ref1 = variant == null ? void 0 : variant.priceUsd) != null ? _ref1 : 0) * 100) + extraCents
|
|
3086
3097
|
});
|
|
3087
3098
|
}).filter(Boolean);
|
|
3088
3099
|
const shipping = (_ref40 = object == null ? void 0 : object.shipping_details) != null ? _ref40 : object == null ? void 0 : object.customer_details;
|
|
@@ -3134,8 +3145,8 @@ export const commerceBillingWebhookHandler = async ({ type, object, event, reque
|
|
|
3134
3145
|
}
|
|
3135
3146
|
});
|
|
3136
3147
|
const created = await firestore.runTransaction(async (transaction)=>{
|
|
3137
|
-
var _counter_get, _ref, _ref1, _ref2, _ref3, _ref4, _ref5;
|
|
3138
|
-
var _object_metadata, _object_metadata1, _object_metadata2, _object_customer_details, _object_customer_details1;
|
|
3148
|
+
var _counter_get, _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8;
|
|
3149
|
+
var _object_metadata, _object_metadata1, _object_metadata2, _object_metadata3, _object_metadata4, _object_customer_details, _object_customer_details1;
|
|
3139
3150
|
const [existing, counter] = await Promise.all([
|
|
3140
3151
|
transaction.get(orderRef),
|
|
3141
3152
|
transaction.get(counterRef)
|
|
@@ -3182,8 +3193,9 @@ export const commerceBillingWebhookHandler = async ({ type, object, event, reque
|
|
|
3182
3193
|
// to be dropped here, storing `shippingCents: 0` on every online
|
|
3183
3194
|
// order while the shopper's shipping sat inside `amount_total`.
|
|
3184
3195
|
const totals = CommerceModel.computeCheckoutSessionTotals(lineItems, object, {
|
|
3185
|
-
|
|
3186
|
-
|
|
3196
|
+
// The take as charged, in the charge currency (AGL-4248).
|
|
3197
|
+
feeCents: Number((_ref = (_ref1 = object == null ? void 0 : (_object_metadata = object.metadata) == null ? void 0 : _object_metadata.chargeFeeCents) != null ? _ref1 : feeCents) != null ? _ref : 0),
|
|
3198
|
+
extrasCents: Number((_ref2 = object == null ? void 0 : (_object_metadata1 = object.metadata) == null ? void 0 : _object_metadata1.chargeExtrasCents) != null ? _ref2 : checkoutExtrasCents(cartExtras))
|
|
3187
3199
|
});
|
|
3188
3200
|
// With the fields the orders list queries by (AGL-3321).
|
|
3189
3201
|
transaction.set(orderRef, CommerceModel.withOrderListFields(orderRef.id, _extends({
|
|
@@ -3192,13 +3204,13 @@ export const commerceBillingWebhookHandler = async ({ type, object, event, reque
|
|
|
3192
3204
|
channel: 'online',
|
|
3193
3205
|
lineItems,
|
|
3194
3206
|
totals
|
|
3195
|
-
}, cartExtras.length ? {
|
|
3207
|
+
}, CommerceModel.orderCurrencyFields(object, totals), cartExtras.length ? {
|
|
3196
3208
|
extras: cartExtras
|
|
3197
3209
|
} : {}, creditSold ? {
|
|
3198
3210
|
credits: [
|
|
3199
3211
|
creditSold
|
|
3200
3212
|
]
|
|
3201
|
-
} : {}, (object == null ? void 0 : (
|
|
3213
|
+
} : {}, (object == null ? void 0 : (_object_metadata2 = object.metadata) == null ? void 0 : _object_metadata2.giftCardCode) && Number(object == null ? void 0 : (_object_metadata3 = object.metadata) == null ? void 0 : _object_metadata3.giftCardCents) > 0 ? {
|
|
3202
3214
|
giftCardRedeemedCents: Math.round(Number(object.metadata.giftCardCents))
|
|
3203
3215
|
} : {}, {
|
|
3204
3216
|
// WHICH TAX THIS SALE CARRIED (AGL-2451). `totals.taxCents` above
|
|
@@ -3208,7 +3220,7 @@ export const commerceBillingWebhookHandler = async ({ type, object, event, reque
|
|
|
3208
3220
|
// the order and the filed row cannot disagree. A manual cart's tax
|
|
3209
3221
|
// rides a real Stripe Tax Rate since AGL-1953 and therefore has a
|
|
3210
3222
|
// populated breakdown — the flag is what tells the two apart.
|
|
3211
|
-
taxMode: storefrontTaxModeOf(object, Number((
|
|
3223
|
+
taxMode: storefrontTaxModeOf(object, Number((_ref3 = object == null ? void 0 : (_object_metadata4 = object.metadata) == null ? void 0 : _object_metadata4.taxCents) != null ? _ref3 : 0))
|
|
3212
3224
|
}, taxEngineStampFromMetadata(object == null ? void 0 : object.metadata), {
|
|
3213
3225
|
timeline: [
|
|
3214
3226
|
{
|
|
@@ -3233,19 +3245,19 @@ export const commerceBillingWebhookHandler = async ({ type, object, event, reque
|
|
|
3233
3245
|
}, unresolvedLines.length ? {
|
|
3234
3246
|
unresolvedLines
|
|
3235
3247
|
} : {}, {
|
|
3236
|
-
paymentIntentId: String((
|
|
3248
|
+
paymentIntentId: String((_ref4 = object == null ? void 0 : object.payment_intent) != null ? _ref4 : '') || null,
|
|
3237
3249
|
checkoutSessionId: String(object.id)
|
|
3238
3250
|
}, typeof (event == null ? void 0 : event.livemode) === 'boolean' ? {
|
|
3239
3251
|
livemode: event.livemode
|
|
3240
3252
|
} : {}, directFields, {
|
|
3241
|
-
customerName: (
|
|
3242
|
-
customerEmail: (
|
|
3253
|
+
customerName: (_ref5 = object == null ? void 0 : (_object_customer_details = object.customer_details) == null ? void 0 : _object_customer_details.name) != null ? _ref5 : null,
|
|
3254
|
+
customerEmail: (_ref6 = object == null ? void 0 : (_object_customer_details1 = object.customer_details) == null ? void 0 : _object_customer_details1.email) != null ? _ref6 : null
|
|
3243
3255
|
}, (shipping == null ? void 0 : shipping.address) && (cartLocalFulfillment == null ? void 0 : cartLocalFulfillment.fields.fulfillmentMethod) !== 'pickup' ? {
|
|
3244
3256
|
shippingAddress: stripeOrderAddress(shipping == null ? void 0 : shipping.name, shipping.address)
|
|
3245
|
-
} : {}, (
|
|
3257
|
+
} : {}, (_ref7 = cartLocalFulfillment == null ? void 0 : cartLocalFulfillment.fields) != null ? _ref7 : {}, couponCode ? {
|
|
3246
3258
|
couponCode
|
|
3247
3259
|
} : {}, {
|
|
3248
|
-
amountCents: Number((
|
|
3260
|
+
amountCents: Number((_ref8 = object == null ? void 0 : object.amount_total) != null ? _ref8 : 0),
|
|
3249
3261
|
feeCents: Number(feeCents != null ? feeCents : 0)
|
|
3250
3262
|
}, cartHardware, {
|
|
3251
3263
|
createdAtMs: Date.now(),
|
|
@@ -3378,7 +3390,7 @@ export const commerceBillingWebhookHandler = async ({ type, object, event, reque
|
|
|
3378
3390
|
var _ref47, _ref48, _ref49, _ref50, _ref51;
|
|
3379
3391
|
const receiptSettings = await hostRef.collection('settings').doc('store').get().catch(()=>null);
|
|
3380
3392
|
const receiptFooter = String((_ref47 = receiptSettings == null ? void 0 : receiptSettings.get('receiptFooter')) != null ? _ref47 : '');
|
|
3381
|
-
const linesText = lineItems.map((line)=>`${line.quantity}× ${line.name}${line.variantLabel ? ` (${line.variantLabel})` : ''} —
|
|
3393
|
+
const linesText = lineItems.map((line)=>`${line.quantity}× ${line.name}${line.variantLabel ? ` (${line.variantLabel})` : ''} — ${saleMoney(line.unitAmountCents * line.quantity)}`).concat(// Optional lines the buyer took (AGL-3635), as charged.
|
|
3382
3394
|
cartExtras.map((extra)=>`${extra.label} — $${(extra.amountCents / 100).toFixed(2)}`)).join('\n');
|
|
3383
3395
|
// The keys assigned above the gate (AGL-2149); the receipt only
|
|
3384
3396
|
// reports them.
|
|
@@ -3394,7 +3406,7 @@ export const commerceBillingWebhookHandler = async ({ type, object, event, reque
|
|
|
3394
3406
|
const downloadToken = mintDownloadToken(hostId, String(object.id));
|
|
3395
3407
|
const siteOrigin = String((_ref48 = object == null ? void 0 : object.success_url) != null ? _ref48 : '').replace(/\/\?.*$|\?.*$/, '');
|
|
3396
3408
|
const downloadLines = lineItems.filter((line)=>line.productType === 'digital').map((line)=>`Download ${line.name}: ${siteOrigin}/api/commerce/download` + `?hostId=${hostId}&orderId=${object.id}` + `&productId=${line.productId}&token=${downloadToken}`).join('\n');
|
|
3397
|
-
const orderTotal =
|
|
3409
|
+
const orderTotal = saleMoney(Number((_ref49 = object == null ? void 0 : object.amount_total) != null ? _ref49 : 0));
|
|
3398
3410
|
// Where to collect it, or when it is coming (AGL-3624).
|
|
3399
3411
|
const fulfillmentText = (_ref50 = cartLocalFulfillment == null ? void 0 : cartLocalFulfillment.summary) != null ? _ref50 : '';
|
|
3400
3412
|
const orderSummary = [
|
|
@@ -3499,7 +3511,7 @@ export const commerceBillingWebhookHandler = async ({ type, object, event, reque
|
|
|
3499
3511
|
// reason. The hold refuses the SECOND shopper; it never gates the
|
|
3500
3512
|
// first one's goods.
|
|
3501
3513
|
await releaseStockHold(hostRef, String((_ref41 = (_object_metadata21 = object.metadata) == null ? void 0 : _object_metadata21.stockHoldKey) != null ? _ref41 : ''));
|
|
3502
|
-
const cartOrderTotal =
|
|
3514
|
+
const cartOrderTotal = saleMoney(Number((_ref42 = object == null ? void 0 : object.amount_total) != null ? _ref42 : 0));
|
|
3503
3515
|
const cartUnits = lineItems.reduce((sum, line)=>sum + line.quantity, 0);
|
|
3504
3516
|
void notifyHostManagers(String(hostId), {
|
|
3505
3517
|
type: 'content.order',
|
|
@@ -3536,7 +3548,7 @@ export const commerceBillingWebhookHandler = async ({ type, object, event, reque
|
|
|
3536
3548
|
interaction: {
|
|
3537
3549
|
source: 'order',
|
|
3538
3550
|
refId: String(object.id),
|
|
3539
|
-
summary: `Placed an order (
|
|
3551
|
+
summary: `Placed an order (${saleMoney(Number((_ref45 = object == null ? void 0 : object.amount_total) != null ? _ref45 : 0))})`
|
|
3540
3552
|
}
|
|
3541
3553
|
}));
|
|
3542
3554
|
if (couponCode) {
|
|
@@ -4358,7 +4370,8 @@ export const commerceBillingWebhookHandler = async ({ type, object, event, reque
|
|
|
4358
4370
|
status: 'paid',
|
|
4359
4371
|
channel: 'online',
|
|
4360
4372
|
lineItems: buyNowLineItems,
|
|
4361
|
-
totals: buyNowTotals
|
|
4373
|
+
totals: buyNowTotals
|
|
4374
|
+
}, CommerceModel.orderCurrencyFields(object, buyNowTotals), {
|
|
4362
4375
|
// WHICH TAX THIS SALE CARRIED (AGL-2451). Buy-now's manual tax
|
|
4363
4376
|
// goes over as an ordinary `line_items[1]` Stripe is never told is
|
|
4364
4377
|
// tax (AGL-1711), so the session reports `amount_tax: 0` and
|
|
@@ -4418,7 +4431,7 @@ export const commerceBillingWebhookHandler = async ({ type, object, event, reque
|
|
|
4418
4431
|
// In-app order notification (wave v6): host managers see sales
|
|
4419
4432
|
// in the bell, not just the owner's email: what came in, from whom
|
|
4420
4433
|
// and where (AGL-3432).
|
|
4421
|
-
const buyNowTotal =
|
|
4434
|
+
const buyNowTotal = saleMoney(Number((_ref81 = object == null ? void 0 : object.amount_total) != null ? _ref81 : 0));
|
|
4422
4435
|
void notifyHostManagers(String(hostId), {
|
|
4423
4436
|
type: 'content.order',
|
|
4424
4437
|
title: `New order on {site} — ${buyNowTotal}`,
|
|
@@ -4576,7 +4589,7 @@ export const commerceBillingWebhookHandler = async ({ type, object, event, reque
|
|
|
4576
4589
|
interaction: {
|
|
4577
4590
|
source: 'order',
|
|
4578
4591
|
refId: String(object.id),
|
|
4579
|
-
summary: `Placed an order (
|
|
4592
|
+
summary: `Placed an order (${saleMoney(Number((_ref84 = object == null ? void 0 : object.amount_total) != null ? _ref84 : 0))})`
|
|
4580
4593
|
}
|
|
4581
4594
|
});
|
|
4582
4595
|
const productRef = hostRef.collection('products').doc(String(productId));
|
|
@@ -4851,7 +4864,7 @@ export const commerceBillingWebhookHandler = async ({ type, object, event, reque
|
|
|
4851
4864
|
hostId,
|
|
4852
4865
|
subjectLabel: `order ${CommerceModel.formatOrderNumber(order, snapshot.id)}`,
|
|
4853
4866
|
// The notice names the sum in question, as the dispute's does.
|
|
4854
|
-
amount: orderCents > 0 ?
|
|
4867
|
+
amount: orderCents > 0 ? CommerceModel.saleMoneyText(orderCents, order.currency) : null,
|
|
4855
4868
|
// The Orders section of the Products hub, with this order's dialog
|
|
4856
4869
|
// open — where Refund lives (`siteRecordLinks().order`).
|
|
4857
4870
|
link: `/${hostId}/products/orders?order=${encodeURIComponent(snapshot.id)}`,
|