@misiki/gocommerce-connector 0.26.0 → 0.28.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/dist/{index-BWwh1d1q.d.cts → index-BaFtBtaA.d.cts} +10 -1
- package/dist/{index-BWwh1d1q.d.ts → index-BaFtBtaA.d.ts} +10 -1
- package/dist/index.cjs +12 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +12 -3
- package/dist/index.js.map +1 -1
- package/dist/services/index.cjs +12 -3
- package/dist/services/index.cjs.map +1 -1
- package/dist/services/index.d.cts +1 -1
- package/dist/services/index.d.ts +1 -1
- package/dist/services/index.js +12 -3
- package/dist/services/index.js.map +1 -1
- package/package.json +1 -1
package/dist/services/index.cjs
CHANGED
|
@@ -367,12 +367,19 @@ var BaseService = class _BaseService {
|
|
|
367
367
|
* Prices a cart at the signed-in shopper's customer-group prices. The
|
|
368
368
|
* engine does this only for an account whose email is confirmed (403
|
|
369
369
|
* otherwise), and the cart stays the shopper's either way — so a refusal
|
|
370
|
-
* is not an error, and neither is a build without ext/identity.
|
|
370
|
+
* is not an error, and neither is a build without ext/identity. A refused
|
|
371
|
+
* claim still gives the cart the account's email, which the claim would
|
|
372
|
+
* have set, or the checkout asks the shopper for it again.
|
|
371
373
|
*/
|
|
372
374
|
async claimCartForAccount(cartId) {
|
|
373
375
|
try {
|
|
374
376
|
await this.engine("/x/identity/me/carts", { method: "POST", body: { cart_id: cartId }, auth: true });
|
|
375
377
|
} catch {
|
|
378
|
+
const email = currentMe()?.email;
|
|
379
|
+
if (email)
|
|
380
|
+
await this.engine(`/api/carts/${encodeURIComponent(cartId)}/email`, { method: "PUT", body: { email } }).catch(
|
|
381
|
+
() => void 0
|
|
382
|
+
);
|
|
376
383
|
}
|
|
377
384
|
}
|
|
378
385
|
// ------------------------------------------------------------ Litekart verbs
|
|
@@ -961,7 +968,7 @@ function toOrder(o) {
|
|
|
961
968
|
taxIncluded: o.tax_inclusive,
|
|
962
969
|
total: toMajor(o.total),
|
|
963
970
|
refunded: toMajor(o.refunded),
|
|
964
|
-
codCharges:
|
|
971
|
+
codCharges: toMajor(o.payment_fee),
|
|
965
972
|
coupon: code ? { code } : null,
|
|
966
973
|
userEmail: o.email,
|
|
967
974
|
email: o.email,
|
|
@@ -2365,6 +2372,7 @@ var PaymentMethodService = class extends BaseService {
|
|
|
2365
2372
|
title: m.name,
|
|
2366
2373
|
description: "",
|
|
2367
2374
|
img: drive(m.code).img ?? null,
|
|
2375
|
+
fee: toMajor(m.fee),
|
|
2368
2376
|
rank: i,
|
|
2369
2377
|
active: true,
|
|
2370
2378
|
isActive: true
|
|
@@ -3232,7 +3240,8 @@ var StoreService = class extends BaseService {
|
|
|
3232
3240
|
currency: {
|
|
3233
3241
|
...base.currency ?? {},
|
|
3234
3242
|
code,
|
|
3235
|
-
symbol: sameCurrency ? base.currency?.symbol ?? symbolFor(code) : symbolFor(code)
|
|
3243
|
+
symbol: sameCurrency ? base.currency?.symbol ?? symbolFor(code) : symbolFor(code),
|
|
3244
|
+
includesTax: profile?.prices_include_tax
|
|
3236
3245
|
},
|
|
3237
3246
|
language: ready.language,
|
|
3238
3247
|
plugins: {
|