arky-sdk 0.3.53 → 0.3.55
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.cjs +21 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +21 -6
- package/dist/index.js.map +1 -1
- package/dist/{svg-DKAX97qt.d.cts → svg-D_ajyHnG.d.cts} +8 -2
- package/dist/{svg-CR0zPGOt.d.ts → svg-WKQadzp2.d.ts} +8 -2
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +35 -11
- package/dist/types.d.ts +35 -11
- package/dist/types.js.map +1 -1
- package/dist/utils.cjs +13 -6
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +13 -6
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -373,6 +373,14 @@ var createBusinessApi = (apiConfig) => {
|
|
|
373
373
|
payload,
|
|
374
374
|
options
|
|
375
375
|
);
|
|
376
|
+
},
|
|
377
|
+
async processRefund(params, options) {
|
|
378
|
+
const { id, ...payload } = params;
|
|
379
|
+
return apiConfig.httpClient.post(
|
|
380
|
+
`/v1/businesses/${id}/refund`,
|
|
381
|
+
payload,
|
|
382
|
+
options
|
|
383
|
+
);
|
|
376
384
|
}
|
|
377
385
|
};
|
|
378
386
|
};
|
|
@@ -1293,7 +1301,8 @@ function formatPayment(payment, options = {}) {
|
|
|
1293
1301
|
if (showBreakdown) {
|
|
1294
1302
|
const subtotal = formatMinor(payment.subtotal, payment.currency, { showSymbols, decimalPlaces });
|
|
1295
1303
|
const discount = (payment.discount ?? 0) > 0 ? formatMinor(payment.discount, payment.currency, { showSymbols, decimalPlaces }) : null;
|
|
1296
|
-
const
|
|
1304
|
+
const taxAmount = payment.tax?.amount ?? 0;
|
|
1305
|
+
const tax = taxAmount > 0 ? formatMinor(taxAmount, payment.currency, { showSymbols, decimalPlaces }) : null;
|
|
1297
1306
|
const total = formatMinor(payment.total, payment.currency, { showSymbols, decimalPlaces });
|
|
1298
1307
|
let result = `Subtotal: ${subtotal}`;
|
|
1299
1308
|
if (discount) result += `, Discount: -${discount}`;
|
|
@@ -1361,18 +1370,24 @@ function getPriceAmount(prices, marketId, fallbackMarket) {
|
|
|
1361
1370
|
return price?.amount || 0;
|
|
1362
1371
|
}
|
|
1363
1372
|
function createPaymentForCheckout(subtotalMinor, marketId, currency, paymentMethod, options = {}) {
|
|
1364
|
-
const { discount = 0,
|
|
1365
|
-
const total = subtotalMinor - discount +
|
|
1373
|
+
const { discount = 0, taxAmount = 0, taxRateBps = 0, promoCode } = options;
|
|
1374
|
+
const total = subtotalMinor - discount + taxAmount;
|
|
1366
1375
|
return {
|
|
1367
1376
|
currency,
|
|
1368
1377
|
market: marketId,
|
|
1369
1378
|
subtotal: subtotalMinor,
|
|
1370
1379
|
shipping: 0,
|
|
1371
1380
|
discount,
|
|
1372
|
-
tax,
|
|
1373
1381
|
total,
|
|
1374
|
-
|
|
1375
|
-
|
|
1382
|
+
type: paymentMethod,
|
|
1383
|
+
...taxAmount > 0 && {
|
|
1384
|
+
tax: {
|
|
1385
|
+
amount: taxAmount,
|
|
1386
|
+
rateBps: taxRateBps,
|
|
1387
|
+
lines: []
|
|
1388
|
+
}
|
|
1389
|
+
},
|
|
1390
|
+
...promoCode && { promoCode }
|
|
1376
1391
|
};
|
|
1377
1392
|
}
|
|
1378
1393
|
|