opentool 0.7.6 → 0.7.7
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/cli/index.js +13 -7
- package/dist/cli/index.js.map +1 -1
- package/dist/index.js +13 -7
- package/dist/index.js.map +1 -1
- package/dist/x402/index.js +13 -7
- package/dist/x402/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -543,22 +543,28 @@ async function verifyX402Payment(attempt, definition, options = {}) {
|
|
|
543
543
|
const requirement = toX402Requirement(definition);
|
|
544
544
|
const headers = buildFacilitatorHeaders(facilitator);
|
|
545
545
|
try {
|
|
546
|
-
|
|
546
|
+
const verifyBody = {
|
|
547
|
+
x402Version: attempt.payload.x402Version,
|
|
548
|
+
paymentPayload: attempt.payload,
|
|
549
|
+
paymentRequirements: requirement
|
|
550
|
+
};
|
|
551
|
+
console.log("[x402] Calling facilitator /verify", {
|
|
552
|
+
url: verifierUrl,
|
|
553
|
+
bodyPreview: JSON.stringify(verifyBody).substring(0, 200)
|
|
554
|
+
});
|
|
547
555
|
const verifyResponse = await fetchImpl(verifierUrl, {
|
|
548
556
|
method: "POST",
|
|
549
557
|
headers,
|
|
550
|
-
body: JSON.stringify(
|
|
551
|
-
x402Version: attempt.payload.x402Version,
|
|
552
|
-
paymentPayload: attempt.payload,
|
|
553
|
-
paymentRequirements: requirement
|
|
554
|
-
})
|
|
558
|
+
body: JSON.stringify(verifyBody)
|
|
555
559
|
});
|
|
556
560
|
console.log("[x402] Facilitator /verify response", { status: verifyResponse.status });
|
|
557
561
|
if (!verifyResponse.ok) {
|
|
562
|
+
const errorText = await verifyResponse.text().catch(() => "");
|
|
563
|
+
console.error("[x402] Facilitator /verify error", { status: verifyResponse.status, body: errorText });
|
|
558
564
|
return {
|
|
559
565
|
success: false,
|
|
560
566
|
failure: {
|
|
561
|
-
reason: `Facilitator verify request failed: ${verifyResponse.status}`,
|
|
567
|
+
reason: `Facilitator verify request failed: ${verifyResponse.status}${errorText ? ` - ${errorText}` : ""}`,
|
|
562
568
|
code: "verification_failed"
|
|
563
569
|
}
|
|
564
570
|
};
|