fix: only print "Paid" on successful x402 payment response#191
fix: only print "Paid" on successful x402 payment response#191Sertug17 wants to merge 2 commits intoopen-wallet-standard:mainfrom
Conversation
Fixes open-wallet-standard#129 Previously 'Paid' was printed before checking the HTTP status, causing contradictory output when server rejected the payment. Now 'Paid' only prints when status < 400. On rejection, prints 'HTTP {status} — payment rejected by server' instead.
|
@Sertug17 is attempting to deploy a commit to the MoonPay Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2f14365. Configure here.
When status >= 400 and payment was attempted (result.payment.is_some),
print 'payment rejected by server'. For plain HTTP errors where no
payment flow occurred (404, 500, etc.), print just 'HTTP {status}'.
|
Fixed the Cursor Bugbot finding: The error branch now distinguishes between a genuine payment rejection |

Fixes #129
Previously
ows pay requestprinted "Paid $X via x402" immediately after signing, before checking whether the server accepted the payment. If the server rejected with HTTP 402, the user saw both "Paid" and an error — contradictory and misleading.Fix
Move the status check before the "Paid" print. Now:
status < 400→ prints "Paid $X on {network} via {protocol}" as beforestatus >= 400→ prints "HTTP {status} — payment rejected by server"Changes
ows-cli/src/commands/pay.rs— reorder status check and payment confirmation printNote
Low Risk
Low risk: changes only CLI output ordering/wording based on HTTP status, with no effect on payment signing or request execution.
Overview
Adjusts
ows pay requestoutput to avoid claiming a payment succeeded when the server returns an error.The command now checks
result.statusbefore printing "Paid" and, on>= 400, printsHTTP {status}(orHTTP {status} — payment rejected by serverwhen a payment was attempted) while still printing the response body.Reviewed by Cursor Bugbot for commit bfef1f8. Bugbot is set up for automated code reviews on this repo. Configure here.