Show / Hide Table of Contents

Class X402PaymentBuilder

Constructs an XRPL Payment transaction from an x402 PaymentRequirement, ready to be autofilled and signed by an IX402Signer.

Inheritance
object
X402PaymentBuilder
Namespace: Xrpl.X402
Assembly: Xrpl.X402.dll
Syntax
public static class X402PaymentBuilder

Methods

| Edit this page View Source

Build(PaymentRequirement, string, X402ClientOptions?)

Builds a Payment transaction. Convenience overload that discards the resolved invoice id.

Declaration
public static Payment Build(PaymentRequirement req, string payerAddress, X402ClientOptions? options = null)
Parameters
Type Name Description
PaymentRequirement req
string payerAddress
X402ClientOptions options
Returns
Type Description
Payment
| Edit this page View Source

BuildWithInvoiceId(PaymentRequirement, string, X402ClientOptions?)

Builds a Payment transaction for the given requirement and payer address.

Reads invoiceId (or the configured InvoiceIdExtraKey), sourceTag, and destinationTag from Extra. The invoice id may be any non-empty string; it does not need to be a 64-hex value.

Binding behaviour (t54 reference payer, default Both):

  • InvoiceID field = SHA-256(UTF-8(invoiceId)), uppercase hex.
  • Memo MemoData = UTF-8 hex of the raw invoiceId string, uppercase. No MemoType / MemoFormat.
Declaration
public static (Payment Payment, string InvoiceId) BuildWithInvoiceId(PaymentRequirement req, string payerAddress, X402ClientOptions? options = null)
Parameters
Type Name Description
PaymentRequirement req

The payment requirement that specifies the destination, amount, and extra data.

string payerAddress

Classic XRPL address of the account that will sign and fund the payment.

X402ClientOptions options

Client options controlling binding mode; uses defaults when null.

Returns
Type Description
(Payment Payment, string InvoiceId)

An unsigned Payment transaction ready for autofill and signing, and the resolved raw invoice id string.

Exceptions
Type Condition
X402PaymentException

Thrown when extra.invoiceId (or the configured key) is missing or empty.

  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX