arky-sdk 0.3.52 → 0.3.54
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 +32 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +32 -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 +40 -12
- package/dist/types.d.ts +40 -12
- 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,25 @@ var createBusinessApi = (apiConfig) => {
|
|
|
373
373
|
payload,
|
|
374
374
|
options
|
|
375
375
|
);
|
|
376
|
+
},
|
|
377
|
+
async getRefundSummary(params, options) {
|
|
378
|
+
return apiConfig.httpClient.get(
|
|
379
|
+
`/v1/businesses/${params.id}/refund-summary`,
|
|
380
|
+
{
|
|
381
|
+
...options,
|
|
382
|
+
params: {
|
|
383
|
+
entity: params.entity
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
);
|
|
387
|
+
},
|
|
388
|
+
async processRefund(params, options) {
|
|
389
|
+
const { id, ...payload } = params;
|
|
390
|
+
return apiConfig.httpClient.post(
|
|
391
|
+
`/v1/businesses/${id}/refund`,
|
|
392
|
+
payload,
|
|
393
|
+
options
|
|
394
|
+
);
|
|
376
395
|
}
|
|
377
396
|
};
|
|
378
397
|
};
|
|
@@ -1293,7 +1312,8 @@ function formatPayment(payment, options = {}) {
|
|
|
1293
1312
|
if (showBreakdown) {
|
|
1294
1313
|
const subtotal = formatMinor(payment.subtotal, payment.currency, { showSymbols, decimalPlaces });
|
|
1295
1314
|
const discount = (payment.discount ?? 0) > 0 ? formatMinor(payment.discount, payment.currency, { showSymbols, decimalPlaces }) : null;
|
|
1296
|
-
const
|
|
1315
|
+
const taxAmount = payment.tax?.amount ?? 0;
|
|
1316
|
+
const tax = taxAmount > 0 ? formatMinor(taxAmount, payment.currency, { showSymbols, decimalPlaces }) : null;
|
|
1297
1317
|
const total = formatMinor(payment.total, payment.currency, { showSymbols, decimalPlaces });
|
|
1298
1318
|
let result = `Subtotal: ${subtotal}`;
|
|
1299
1319
|
if (discount) result += `, Discount: -${discount}`;
|
|
@@ -1361,18 +1381,24 @@ function getPriceAmount(prices, marketId, fallbackMarket) {
|
|
|
1361
1381
|
return price?.amount || 0;
|
|
1362
1382
|
}
|
|
1363
1383
|
function createPaymentForCheckout(subtotalMinor, marketId, currency, paymentMethod, options = {}) {
|
|
1364
|
-
const { discount = 0,
|
|
1365
|
-
const total = subtotalMinor - discount +
|
|
1384
|
+
const { discount = 0, taxAmount = 0, taxRateBps = 0, promoCode } = options;
|
|
1385
|
+
const total = subtotalMinor - discount + taxAmount;
|
|
1366
1386
|
return {
|
|
1367
1387
|
currency,
|
|
1368
1388
|
market: marketId,
|
|
1369
1389
|
subtotal: subtotalMinor,
|
|
1370
1390
|
shipping: 0,
|
|
1371
1391
|
discount,
|
|
1372
|
-
tax,
|
|
1373
1392
|
total,
|
|
1374
|
-
|
|
1375
|
-
|
|
1393
|
+
type: paymentMethod,
|
|
1394
|
+
...taxAmount > 0 && {
|
|
1395
|
+
tax: {
|
|
1396
|
+
amount: taxAmount,
|
|
1397
|
+
rateBps: taxRateBps,
|
|
1398
|
+
lines: []
|
|
1399
|
+
}
|
|
1400
|
+
},
|
|
1401
|
+
...promoCode && { promoCode }
|
|
1376
1402
|
};
|
|
1377
1403
|
}
|
|
1378
1404
|
|