class Cryptopay::InvoiceParams

Constants

ENCODER

Public Class Methods

build_from_hash(data) click to toggle source

Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Cryptopay::InvoiceParams] Returns the model itself

# File lib/cryptopay/models/invoice_params.rb, line 116
def self.build_from_hash(data)
  attributes = ENCODER.build_from_hash(data)
  new(attributes)
end
new(attributes = {}) click to toggle source

Initializes the object @param [Hash] attributes Model attributes in the form of hash

# File lib/cryptopay/models/invoice_params.rb, line 40
def initialize(attributes = {})
  @attributes = ENCODER.sanitize(attributes)
end

Public Instance Methods

custom_id() click to toggle source

The payment reference ID in your system

# File lib/cryptopay/models/invoice_params.rb, line 60
def custom_id
  @attributes[:custom_id]
end
customer_id() click to toggle source

The internal ID of your customer that the invoice relates to. See Customers for more information

# File lib/cryptopay/models/invoice_params.rb, line 65
def customer_id
  @attributes[:customer_id]
end
description() click to toggle source

The invoice description

# File lib/cryptopay/models/invoice_params.rb, line 75
def description
  @attributes[:description]
end
inspect() click to toggle source
# File lib/cryptopay/models/invoice_params.rb, line 127
def inspect
  "#<#{self.class}:0x#{object_id.to_s(16)}> JSON: " + JSON.pretty_generate(to_hash)
end
invalid_properties() click to toggle source

Show invalid properties with the reasons. Usually used together with valid? @return Array for valid properties with the reasons

# File lib/cryptopay/models/invoice_params.rb, line 95
def invalid_properties
  properties = []

  properties.push('invalid value for "price_amount", price_amount cannot be nil.') if price_amount.nil?

  properties.push('invalid value for "price_currency", price_currency cannot be nil.') if price_currency.nil?

  properties.push('invalid value for "pay_currency", pay_currency cannot be nil.') if pay_currency.nil?

  properties
end
metadata() click to toggle source

Custom key-valued data

# File lib/cryptopay/models/invoice_params.rb, line 80
def metadata
  @attributes[:metadata]
end
name() click to toggle source

The invoice name

# File lib/cryptopay/models/invoice_params.rb, line 70
def name
  @attributes[:name]
end
pay_currency() click to toggle source

The cryptocurrency that the invoice must be paid in

# File lib/cryptopay/models/invoice_params.rb, line 55
def pay_currency
  @attributes[:pay_currency]
end
price_amount() click to toggle source

The invoice amount

# File lib/cryptopay/models/invoice_params.rb, line 45
def price_amount
  @attributes[:price_amount]
end
price_currency() click to toggle source

The invoice amount currency

# File lib/cryptopay/models/invoice_params.rb, line 50
def price_currency
  @attributes[:price_currency]
end
success_redirect_url() click to toggle source

The URL that the customer will be redirected to upon transaction confirmation

# File lib/cryptopay/models/invoice_params.rb, line 85
def success_redirect_url
  @attributes[:success_redirect_url]
end
to_hash() click to toggle source

Returns the object in the form of hash @return [Hash] Returns the object in the form of hash

# File lib/cryptopay/models/invoice_params.rb, line 123
def to_hash
  ENCODER.to_hash(@attributes)
end
unsuccess_redirect_url() click to toggle source
# File lib/cryptopay/models/invoice_params.rb, line 89
def unsuccess_redirect_url
  @attributes[:unsuccess_redirect_url]
end
valid?() click to toggle source

Check to see if the all the properties in the model are valid @return true if the model is valid

# File lib/cryptopay/models/invoice_params.rb, line 109
def valid?
  invalid_properties.empty?
end