<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ryan Gillespie</title>
    <description>The latest articles on DEV Community by Ryan Gillespie (@mgillr).</description>
    <link>https://dev.to/mgillr</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4196930%2F99074c75-d7b9-4ae4-b49a-d10bfc49c446.png</url>
      <title>DEV Community: Ryan Gillespie</title>
      <link>https://dev.to/mgillr</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mgillr"/>
    <language>en</language>
    <item>
      <title>Five ways an x402 paid endpoint can serve content it wasn't paid for, and a CI check for each</title>
      <dc:creator>Ryan Gillespie</dc:creator>
      <pubDate>Tue, 20 Oct 2026 21:30:36 +0000</pubDate>
      <link>https://dev.to/mgillr/five-ways-an-x402-paid-endpoint-can-serve-content-it-wasnt-paid-for-and-a-ci-check-for-each-1717</link>
      <guid>https://dev.to/mgillr/five-ways-an-x402-paid-endpoint-can-serve-content-it-wasnt-paid-for-and-a-ci-check-for-each-1717</guid>
      <description>&lt;p&gt;x402 turns HTTP 402 into a real payment flow: your server answers 402 with payment requirements, the client pays, and a facilitator verifies and settles. The happy path is easy. Money is lost in the unhappy paths. Here are five I test for, and how to check your own server in one CI step.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. A /settle call that times out.&lt;/strong&gt; If your middleware treats "no answer" as "probably fine", anyone can get content by making settlement slow. Fix: serve only after a well-formed &lt;code&gt;success: true&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. A 503 with a success body.&lt;/strong&gt; Proxies return error pages, and sometimes success-looking bodies with a 5xx status. Fix: check the status code before you read the body, and keep the payment retryable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. &lt;code&gt;settlement_pending&lt;/code&gt; treated as paid.&lt;/strong&gt; In x402 V2 (§9), &lt;code&gt;settlement_pending&lt;/code&gt; is non-terminal: the transaction may still fail. Fix: don't serve until it's final; keep the transaction and reconcile.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. The same payment presented twice.&lt;/strong&gt; Fix: the facilitator must answer &lt;code&gt;duplicate_settlement&lt;/code&gt; for a payload it already settled, and your check-and-insert must be atomic.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. A reused memo in a new transaction.&lt;/strong&gt; On Solana devnet the reference facilitator dedupes by transaction, not by memo: two different transactions with the same memo both settled. If your app maps one memo to one purchase, you must enforce single use yourself. (Devnet transactions and hashes: &lt;a href="https://atsp-protocol.github.io/x402-conformance/" rel="noopener noreferrer"&gt;https://atsp-protocol.github.io/x402-conformance/&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check your server.&lt;/strong&gt; x402-conformance is an open-source (Apache-2.0) GitHub Action that puts a facilitator double in front of your server and requests your paid route under each fault:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;atsp-protocol/x402-conformance@v1&lt;/span&gt;
  &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;x402&lt;/span&gt;
  &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;resource-url&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;http://127.0.0.1:4020/paid&lt;/span&gt;
    &lt;span class="na"&gt;start&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;node server.js&lt;/span&gt;   &lt;span class="c1"&gt;# your server must use X402_FACILITATOR_URL&lt;/span&gt;
    &lt;span class="na"&gt;fail-on-error&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;github/codeql-action/upload-sarif@v3&lt;/span&gt;
  &lt;span class="na"&gt;if&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;always()&lt;/span&gt;
  &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;sarif_file&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ steps.x402.outputs.sarif }}&lt;/span&gt;
    &lt;span class="na"&gt;category&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;x402-conformance&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Failures show up in your repo's Security tab, and each one links to a "what failed and how to fix it" entry in the fix guide. There's a JUnit report too. For facilitators, live mode only sends &lt;code&gt;GET /supported&lt;/code&gt;. No install needed: &lt;code&gt;pipx run --spec "git+https://github.com/atsp-protocol/x402-conformance@v1" x402conf offline&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;It's experimental and Solana-first; issues and check proposals are welcome: &lt;a href="https://github.com/atsp-protocol/x402-conformance" rel="noopener noreferrer"&gt;https://github.com/atsp-protocol/x402-conformance&lt;/a&gt;&lt;/p&gt;

</description>
      <category>100daysofsolana</category>
      <category>testing</category>
      <category>opensource</category>
      <category>web3</category>
    </item>
  </channel>
</rss>
