@reactionary/commercetools 0.9.19 → 0.9.20

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.
@@ -103,15 +103,16 @@ class CommercetoolsCheckoutFactory {
103
103
  const identifier = {
104
104
  key: data.key || ""
105
105
  };
106
+ const rate = data.zoneRates[0]?.shippingRates.find((x) => x.isMatching);
106
107
  const result = {
107
108
  deliveryTime: "",
108
109
  description: data.localizedDescription?.[getLanguageCodeFromLocale(context.languageContext.locale)] || "",
109
110
  identifier,
110
111
  name: data.name,
111
- price: data.zoneRates[0].shippingRates[0].price ? {
112
- value: (data.zoneRates[0].shippingRates[0].price.centAmount || 0) / 100,
113
- currency: data.zoneRates[0].shippingRates[0].price.currencyCode || context.languageContext.currencyCode
114
- } : { value: 0, currency: context.languageContext.currencyCode }
112
+ price: {
113
+ value: (rate?.price.centAmount || 0) / 100,
114
+ currency: rate?.price.currencyCode
115
+ }
115
116
  };
116
117
  return this.shippingMethodSchema.parse(result);
117
118
  }
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@reactionary/commercetools",
3
- "version": "0.9.19",
3
+ "version": "0.9.20",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "types": "./src/index.d.ts",
7
7
  "dependencies": {
8
- "@reactionary/core": "0.9.19",
8
+ "@reactionary/core": "0.9.20",
9
9
  "zod": "4.1.9",
10
10
  "@commercetools/ts-client": "^4.9.1",
11
11
  "@commercetools/platform-sdk": "^8.25.0",