payment-kit 1.13.103 → 1.13.105
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/api/src/routes/connect/shared.ts +2 -6
- package/blocklet.yml +1 -1
- package/package.json +3 -3
|
@@ -321,15 +321,11 @@ export async function ensureInvoiceAndItems({
|
|
|
321
321
|
trailing: boolean; // do we have trailing
|
|
322
322
|
metered: boolean; // is the quantity metered
|
|
323
323
|
applyCredit?: boolean; // should we apply customer credit?
|
|
324
|
-
}): Promise<{ invoice: Invoice; items: InvoiceItem[] }> {
|
|
325
|
-
if (props.total === '0') {
|
|
326
|
-
throw new Error('Invoice total should not be 0');
|
|
327
|
-
}
|
|
328
|
-
|
|
324
|
+
}): Promise<{ invoice: Invoice; items: InvoiceItem[] }> {
|
|
329
325
|
// apply possible balance to invoice
|
|
330
326
|
let remaining = props.total;
|
|
331
327
|
let result = { starting: {}, ending: {} };
|
|
332
|
-
if (applyCredit) {
|
|
328
|
+
if (applyCredit && props.total > '0') {
|
|
333
329
|
const balance = customer.getBalanceToApply(currency.id, props.total);
|
|
334
330
|
result = await customer.decreaseTokenBalance(currency.id, balance);
|
|
335
331
|
remaining = new BN(props.total).sub(new BN(balance)).toString();
|
package/blocklet.yml
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "payment-kit",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.105",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "COMPONENT_STORE_URL=https://test.store.blocklet.dev blocklet dev",
|
|
6
6
|
"eject": "vite eject",
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
"@abtnode/types": "1.16.21",
|
|
111
111
|
"@arcblock/eslint-config": "^0.2.4",
|
|
112
112
|
"@arcblock/eslint-config-ts": "^0.2.4",
|
|
113
|
-
"@did-pay/types": "1.13.
|
|
113
|
+
"@did-pay/types": "1.13.105",
|
|
114
114
|
"@types/cookie-parser": "^1.4.6",
|
|
115
115
|
"@types/cors": "^2.8.17",
|
|
116
116
|
"@types/dotenv-flow": "^3.3.3",
|
|
@@ -149,5 +149,5 @@
|
|
|
149
149
|
"parser": "typescript"
|
|
150
150
|
}
|
|
151
151
|
},
|
|
152
|
-
"gitHead": "
|
|
152
|
+
"gitHead": "5ab36347f90bfd3077b5b0dae33a06fccc864aa6"
|
|
153
153
|
}
|