Class: X402::SettlementResult

Inherits:
Struct
  • Object
show all
Defined in:
lib/x402/settlement_result.rb

Overview

Returned by Gateway#settle! on successful settlement.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(receipt_headers: {}, txid: nil, network: nil) ⇒ SettlementResult

Returns a new instance of SettlementResult.



10
11
12
# File 'lib/x402/settlement_result.rb', line 10

def initialize(receipt_headers: {}, txid: nil, network: nil)
  super
end

Instance Attribute Details

#networkString?

CAIP-2 network identifier (e.g. "bsv:mainnet")

Returns:

  • (String, nil)

    the current value of network



9
10
11
# File 'lib/x402/settlement_result.rb', line 9

def network
  @network
end

#receipt_headersHash

HTTP headers to include in the 200 response

Returns:

  • (Hash)

    the current value of receipt_headers



9
10
11
# File 'lib/x402/settlement_result.rb', line 9

def receipt_headers
  @receipt_headers
end

#txidString?

transaction identifier

Returns:

  • (String, nil)

    the current value of txid



9
10
11
# File 'lib/x402/settlement_result.rb', line 9

def txid
  @txid
end