@retaila/shared-types 2.0.25 → 2.0.27

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.mjs CHANGED
@@ -309,6 +309,28 @@ function getAccountPaymentMethodStatusInfo(status) {
309
309
  return map[status] ?? { text: String(status), class: "secondary" };
310
310
  }
311
311
 
312
+ // src/accountPaymentMethod/resolveChargeCurrency.ts
313
+ function normalizedAccountCurrency(accountCurrency) {
314
+ const t = accountCurrency?.trim();
315
+ if (!t) return void 0;
316
+ return t;
317
+ }
318
+ function resolveChargeCurrency(params) {
319
+ const pk = params.providerKey?.toUpperCase();
320
+ if (pk === "PAYPAL") {
321
+ return "USD" /* USD */;
322
+ }
323
+ const accountCur = normalizedAccountCurrency(params.accountCurrency);
324
+ if (pk === "MANUAL_PAYMENT") {
325
+ return accountCur;
326
+ }
327
+ const raw = params.settingsCurrency?.trim();
328
+ if (!raw) {
329
+ return accountCur;
330
+ }
331
+ return raw;
332
+ }
333
+
312
334
  // src/cart/types.ts
313
335
  var CartStatus = /* @__PURE__ */ ((CartStatus2) => {
314
336
  CartStatus2["ACTIVE"] = "ACTIVE";
@@ -1301,6 +1323,7 @@ export {
1301
1323
  isZonedLayout,
1302
1324
  parsePriceFormatPattern,
1303
1325
  paymentFrequencyMonths,
1326
+ resolveChargeCurrency,
1304
1327
  resolveEffectivePaymentFrequency,
1305
1328
  subscriptionAmountPerInstallment,
1306
1329
  subscriptionInstallmentCount