Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ the other three is the **holding's** id, not the token address.

```ruby
client.payments.create(params, idempotency_key: nil) # or keyword fields
# Reusing a key for DIFFERENT terms raises Rail0::ApiError with code
# "idempotency_key_reused" (422) instead of returning the first payment.
client.payments.get(id)
client.payments.list(status: "authorized", disputed: false, chain_id: 84532, sort: "-created_at")
client.payments.transactions(id, operation: "capture")
Expand Down
1 change: 1 addition & 0 deletions lib/rail0/error_hints.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ module Rail0
"payment_already_exists" => "a payment with this id already exists on-chain",
# Ported from rail0-go, which had drifted five codes ahead of this table (#13).
"unsupported_payment_method" => "the payee (merchant) doesn't accept this token/chain — check the merchant's payment methods",
"idempotency_key_reused" => "that Idempotency-Key was already used for a payment with different terms — reuse it only to retry the same request, or pick a new key",
"unknown_token" => "the token isn't configured on this chain",
"no_active_contract" => "no active RAIL0 contract on that chain",
"missing_param" => "a required parameter is missing from the request",
Expand Down
Loading