@blocklet/payment-react 1.13.184 → 1.13.186

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.
@@ -135,7 +135,7 @@ export default function MiniInvoiceList() {
135
135
  variant: "contained",
136
136
  sx: { color: "#fff!important", width: subscription.service_actions?.length ? "auto" : "100%" },
137
137
  href: joinURL(window.location.origin, getPrefix(), `/customer/subscription/${subscription.id}`),
138
- children: t("payment.customer.subscriptions.title")
138
+ children: t("payment.customer.subscriptions.view")
139
139
  }
140
140
  )
141
141
  ] })
package/es/locales/en.js CHANGED
@@ -242,6 +242,7 @@ export default flat({
242
242
  plan: "Plan",
243
243
  nextInvoice: "Next Invoice",
244
244
  title: "Manage subscriptions",
245
+ view: "View Subscription",
245
246
  current: "Current subscription",
246
247
  empty: "There are no subscriptions here",
247
248
  changePayment: "Change payment method"
package/es/locales/zh.js CHANGED
@@ -242,6 +242,7 @@ export default flat({
242
242
  plan: "\u8BA2\u9605",
243
243
  nextInvoice: "\u4E0B\u4E00\u5F20\u8D26\u5355",
244
244
  title: "\u8BA2\u9605\u7BA1\u7406",
245
+ view: "\u7BA1\u7406\u8BA2\u9605",
245
246
  current: "\u5F53\u524D\u8BA2\u9605",
246
247
  empty: "\u6CA1\u6709\u4EFB\u4F55\u8BA2\u9605",
247
248
  changePayment: "\u5207\u6362\u652F\u4ED8\u65B9\u5F0F"
package/es/util.js CHANGED
@@ -139,7 +139,8 @@ export function getPriceUintAmountByCurrency(price, currency) {
139
139
  if (price.currency_id === currency.id) {
140
140
  return price.unit_amount;
141
141
  }
142
- throw new Error(`Currency option ${currency.id} not configured for price ${price.id}`);
142
+ console.warn(`Currency ${currency.id} not configured for price`, price);
143
+ return "0";
143
144
  }
144
145
  export function getPriceCurrencyOptions(price) {
145
146
  if (Array.isArray(price.currency_options)) {
@@ -212,7 +212,7 @@ function MiniInvoiceList() {
212
212
  width: subscription.service_actions?.length ? "auto" : "100%"
213
213
  },
214
214
  href: (0, _ufo.joinURL)(window.location.origin, (0, _util.getPrefix)(), `/customer/subscription/${subscription.id}`),
215
- children: t("payment.customer.subscriptions.title")
215
+ children: t("payment.customer.subscriptions.view")
216
216
  })]
217
217
  })]
218
218
  })]
package/lib/locales/en.js CHANGED
@@ -249,6 +249,7 @@ module.exports = (0, _flat.default)({
249
249
  plan: "Plan",
250
250
  nextInvoice: "Next Invoice",
251
251
  title: "Manage subscriptions",
252
+ view: "View Subscription",
252
253
  current: "Current subscription",
253
254
  empty: "There are no subscriptions here",
254
255
  changePayment: "Change payment method"
package/lib/locales/zh.js CHANGED
@@ -249,6 +249,7 @@ module.exports = (0, _flat.default)({
249
249
  plan: "\u8BA2\u9605",
250
250
  nextInvoice: "\u4E0B\u4E00\u5F20\u8D26\u5355",
251
251
  title: "\u8BA2\u9605\u7BA1\u7406",
252
+ view: "\u7BA1\u7406\u8BA2\u9605",
252
253
  current: "\u5F53\u524D\u8BA2\u9605",
253
254
  empty: "\u6CA1\u6709\u4EFB\u4F55\u8BA2\u9605",
254
255
  changePayment: "\u5207\u6362\u652F\u4ED8\u65B9\u5F0F"
package/lib/util.js CHANGED
@@ -194,7 +194,8 @@ function getPriceUintAmountByCurrency(price, currency) {
194
194
  if (price.currency_id === currency.id) {
195
195
  return price.unit_amount;
196
196
  }
197
- throw new Error(`Currency option ${currency.id} not configured for price ${price.id}`);
197
+ console.warn(`Currency ${currency.id} not configured for price`, price);
198
+ return "0";
198
199
  }
199
200
  function getPriceCurrencyOptions(price) {
200
201
  if (Array.isArray(price.currency_options)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/payment-react",
3
- "version": "1.13.184",
3
+ "version": "1.13.186",
4
4
  "description": "Reusable react components for payment kit v2",
5
5
  "keywords": [
6
6
  "react",
@@ -90,7 +90,7 @@
90
90
  "@babel/core": "^7.23.9",
91
91
  "@babel/preset-env": "^7.23.9",
92
92
  "@babel/preset-react": "^7.23.3",
93
- "@blocklet/payment-types": "1.13.184",
93
+ "@blocklet/payment-types": "1.13.186",
94
94
  "@storybook/addon-essentials": "^7.6.13",
95
95
  "@storybook/addon-interactions": "^7.6.13",
96
96
  "@storybook/addon-links": "^7.6.13",
@@ -119,5 +119,5 @@
119
119
  "vite-plugin-babel": "^1.2.0",
120
120
  "vite-plugin-node-polyfills": "^0.19.0"
121
121
  },
122
- "gitHead": "bdd821f69f453dfeabad61eceaef521e17e2c4cf"
122
+ "gitHead": "1200eebf624b5d09fce59f718490e321409f4b44"
123
123
  }
@@ -170,7 +170,7 @@ export default function MiniInvoiceList() {
170
170
  variant="contained"
171
171
  sx={{ color: '#fff!important', width: subscription.service_actions?.length ? 'auto' : '100%' }}
172
172
  href={joinURL(window.location.origin, getPrefix(), `/customer/subscription/${subscription.id}`)}>
173
- {t('payment.customer.subscriptions.title')}
173
+ {t('payment.customer.subscriptions.view')}
174
174
  </Button>
175
175
  </Stack>
176
176
  </Box>
@@ -251,6 +251,7 @@ export default flat({
251
251
  plan: 'Plan',
252
252
  nextInvoice: 'Next Invoice',
253
253
  title: 'Manage subscriptions',
254
+ view: 'View Subscription',
254
255
  current: 'Current subscription',
255
256
  empty: 'There are no subscriptions here',
256
257
  changePayment: 'Change payment method',
@@ -244,6 +244,7 @@ export default flat({
244
244
  plan: '订阅',
245
245
  nextInvoice: '下一张账单',
246
246
  title: '订阅管理',
247
+ view: '管理订阅',
247
248
  current: '当前订阅',
248
249
  empty: '没有任何订阅',
249
250
  changePayment: '切换支付方式',
package/src/util.ts CHANGED
@@ -213,7 +213,9 @@ export function getPriceUintAmountByCurrency(price: TPrice, currency: TPaymentCu
213
213
  if (price.currency_id === currency.id) {
214
214
  return price.unit_amount;
215
215
  }
216
- throw new Error(`Currency option ${currency.id} not configured for price ${price.id}`);
216
+
217
+ console.warn(`Currency ${currency.id} not configured for price`, price);
218
+ return '0';
217
219
  }
218
220
 
219
221
  export function getPriceCurrencyOptions(price: TPrice): PriceCurrency[] {