payment-kit 1.22.18 → 1.22.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.
|
@@ -379,16 +379,7 @@ export class DidnamesAdapter implements VendorAdapter {
|
|
|
379
379
|
|
|
380
380
|
const didNamesResult = await response.json();
|
|
381
381
|
|
|
382
|
-
|
|
383
|
-
url,
|
|
384
|
-
orderId: params.orderId,
|
|
385
|
-
status: didNamesResult.status,
|
|
386
|
-
});
|
|
387
|
-
|
|
388
|
-
return {
|
|
389
|
-
status: didNamesResult.status || 'requested',
|
|
390
|
-
message: didNamesResult.message || 'Domain unbinding requested',
|
|
391
|
-
};
|
|
382
|
+
return didNamesResult;
|
|
392
383
|
} catch (error: any) {
|
|
393
384
|
logger.error('Failed to process return request', {
|
|
394
385
|
error: error.message,
|
|
@@ -852,6 +852,7 @@ async function requestReturnFromSingleVendor(
|
|
|
852
852
|
throw new Error(`No adapter found for vendor: ${vendor.vendor_id}`);
|
|
853
853
|
}
|
|
854
854
|
|
|
855
|
+
// revenue has not been split yet, so no refund operation is needed.
|
|
855
856
|
const returnResult = await vendorAdapter.requestReturn({
|
|
856
857
|
orderId: vendor.order_id,
|
|
857
858
|
reason: `Return request due to: ${reason}`,
|
|
@@ -861,11 +862,10 @@ async function requestReturnFromSingleVendor(
|
|
|
861
862
|
},
|
|
862
863
|
});
|
|
863
864
|
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
status = 'rejected' as 'rejected';
|
|
865
|
+
const { code } = returnResult;
|
|
866
|
+
let status: 'pending' | 'rejected' = 'pending';
|
|
867
|
+
if (code) {
|
|
868
|
+
status = 'rejected';
|
|
869
869
|
}
|
|
870
870
|
|
|
871
871
|
await updateSingleVendorInfo(checkoutSession.id, vendor.vendor_id, {
|
|
@@ -873,7 +873,7 @@ async function requestReturnFromSingleVendor(
|
|
|
873
873
|
returnRequest: {
|
|
874
874
|
reason,
|
|
875
875
|
requestedAt: new Date().toISOString(),
|
|
876
|
-
status
|
|
876
|
+
status,
|
|
877
877
|
returnDetails: returnResult.message,
|
|
878
878
|
},
|
|
879
879
|
});
|
|
@@ -881,7 +881,7 @@ async function requestReturnFromSingleVendor(
|
|
|
881
881
|
logger.info('Return request submitted successfully', {
|
|
882
882
|
vendorId: vendor.vendor_id,
|
|
883
883
|
orderId: vendor.order_id,
|
|
884
|
-
|
|
884
|
+
returnResult,
|
|
885
885
|
});
|
|
886
886
|
} catch (error: any) {
|
|
887
887
|
logger.error('Return request failed', {
|
|
@@ -188,12 +188,12 @@ router.get('/mine', sessionMiddleware({ accessKey: true }), async (req, res) =>
|
|
|
188
188
|
const syncPayoutRequestSchema = Joi.object({
|
|
189
189
|
// Payout creation required fields
|
|
190
190
|
livemode: Joi.number().required().description('Testnet (0) or mainnet (1)'),
|
|
191
|
-
amount: Joi.
|
|
191
|
+
amount: Joi.string().required().description('Transfer amount in unit format'),
|
|
192
192
|
destination: Joi.string().required().description('Output account address (to address)'),
|
|
193
193
|
|
|
194
194
|
// Transfer execution required fields
|
|
195
195
|
contract: Joi.string().required().description('Token contract address for transfer'),
|
|
196
|
-
chainType: Joi.string().
|
|
196
|
+
chainType: Joi.string().required().description('Chain type, e.g. "arcblock", "ethereum", "base", "bitcoin"'),
|
|
197
197
|
chainApiHost: Joi.string().required().description('RPC API endpoint for the chain'),
|
|
198
198
|
|
|
199
199
|
// Optional fields
|
|
@@ -387,7 +387,7 @@ router.post('/sync', async (req, res) => {
|
|
|
387
387
|
try {
|
|
388
388
|
// Convert and validate input types
|
|
389
389
|
const livemodeBoolean = !!livemode;
|
|
390
|
-
const amountString =
|
|
390
|
+
const amountString = String(amount);
|
|
391
391
|
const amountBN = new BN(amountString);
|
|
392
392
|
if (amountBN.lte(new BN('0'))) {
|
|
393
393
|
throw new Error('Payout amount must be greater than 0');
|
package/blocklet.yml
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "payment-kit",
|
|
3
|
-
"version": "1.22.
|
|
3
|
+
"version": "1.22.20",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "blocklet dev --open",
|
|
6
6
|
"lint": "tsc --noEmit && eslint src api/src --ext .mjs,.js,.jsx,.ts,.tsx",
|
|
@@ -57,9 +57,9 @@
|
|
|
57
57
|
"@blocklet/error": "^0.3.3",
|
|
58
58
|
"@blocklet/js-sdk": "^1.17.3-beta-20251119-102907-28b69b76",
|
|
59
59
|
"@blocklet/logger": "^1.17.3-beta-20251119-102907-28b69b76",
|
|
60
|
-
"@blocklet/payment-broker-client": "1.22.
|
|
61
|
-
"@blocklet/payment-react": "1.22.
|
|
62
|
-
"@blocklet/payment-vendor": "1.22.
|
|
60
|
+
"@blocklet/payment-broker-client": "1.22.20",
|
|
61
|
+
"@blocklet/payment-react": "1.22.20",
|
|
62
|
+
"@blocklet/payment-vendor": "1.22.20",
|
|
63
63
|
"@blocklet/sdk": "^1.17.3-beta-20251119-102907-28b69b76",
|
|
64
64
|
"@blocklet/ui-react": "^3.2.7",
|
|
65
65
|
"@blocklet/uploader": "^0.3.11",
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
"devDependencies": {
|
|
130
130
|
"@abtnode/types": "^1.17.3-beta-20251119-102907-28b69b76",
|
|
131
131
|
"@arcblock/eslint-config-ts": "^0.3.3",
|
|
132
|
-
"@blocklet/payment-types": "1.22.
|
|
132
|
+
"@blocklet/payment-types": "1.22.20",
|
|
133
133
|
"@types/cookie-parser": "^1.4.9",
|
|
134
134
|
"@types/cors": "^2.8.19",
|
|
135
135
|
"@types/debug": "^4.1.12",
|
|
@@ -176,5 +176,5 @@
|
|
|
176
176
|
"parser": "typescript"
|
|
177
177
|
}
|
|
178
178
|
},
|
|
179
|
-
"gitHead": "
|
|
179
|
+
"gitHead": "2928d141aea59ed8c5b332a017b40d639fafd976"
|
|
180
180
|
}
|