agentbbs/internal/payments
Anthony Ettinger d5135cd1fe payments: accept CoinPay crypto_amount as number or string
The live CoinPay API returns crypto_amount as a bare JSON number (e.g.
0.0031), but the struct decoded it as a string, so /payments/create failed
with "cannot unmarshal number into ... crypto_amount of type string" and
join@ showed "Payment is temporarily unavailable". The unit test had hidden
the bug by sending the value quoted.

Add a flexStr type that unmarshals from either a JSON number or string and
use it for crypto_amount; update the test to send a number and add a direct
flexStr decode test for both forms.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-14 11:45:41 +00:00
..
payments.go payments: accept CoinPay crypto_amount as number or string 2026-06-14 11:45:41 +00:00
payments_test.go payments: accept CoinPay crypto_amount as number or string 2026-06-14 11:45:41 +00:00