Class: Remitmd::IntentMandate

Inherits:
Object
  • Object
show all
Defined in:
lib/remitmd/a2a.rb

Overview

A mandate authorizing a payment intent.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(mandate_id:, expires_at:, issuer:, max_amount:, currency: "USDC") ⇒ IntentMandate

Returns a new instance of IntentMandate.



115
116
117
118
119
120
121
# File 'lib/remitmd/a2a.rb', line 115

def initialize(mandate_id:, expires_at:, issuer:, max_amount:, currency: "USDC")
  @mandate_id = mandate_id
  @expires_at = expires_at
  @issuer     = issuer
  @max_amount = max_amount
  @currency   = currency
end

Instance Attribute Details

#currencyObject (readonly)

Returns the value of attribute currency.



113
114
115
# File 'lib/remitmd/a2a.rb', line 113

def currency
  @currency
end

#expires_atObject (readonly)

Returns the value of attribute expires_at.



113
114
115
# File 'lib/remitmd/a2a.rb', line 113

def expires_at
  @expires_at
end

#issuerObject (readonly)

Returns the value of attribute issuer.



113
114
115
# File 'lib/remitmd/a2a.rb', line 113

def issuer
  @issuer
end

#mandate_idObject (readonly)

Returns the value of attribute mandate_id.



113
114
115
# File 'lib/remitmd/a2a.rb', line 113

def mandate_id
  @mandate_id
end

#max_amountObject (readonly)

Returns the value of attribute max_amount.



113
114
115
# File 'lib/remitmd/a2a.rb', line 113

def max_amount
  @max_amount
end

Instance Method Details

#to_hObject



123
124
125
126
127
128
129
130
131
132
133
# File 'lib/remitmd/a2a.rb', line 123

def to_h
  {
    mandateId: @mandate_id,
    expiresAt: @expires_at,
    issuer:    @issuer,
    allowance: {
      maxAmount: @max_amount,
      currency:  @currency,
    },
  }
end