class Cryptopay::InvoiceParams
Constants
- ENCODER
Public Class Methods
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
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
The payment reference ID in your system
# File lib/cryptopay/models/invoice_params.rb, line 60 def custom_id @attributes[:custom_id] end
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
The invoice description
# File lib/cryptopay/models/invoice_params.rb, line 75 def description @attributes[:description] end
# 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
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
Custom key-valued data
# File lib/cryptopay/models/invoice_params.rb, line 80 def metadata @attributes[:metadata] end
The invoice name
# File lib/cryptopay/models/invoice_params.rb, line 70 def name @attributes[:name] end
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
The invoice amount
# File lib/cryptopay/models/invoice_params.rb, line 45 def price_amount @attributes[:price_amount] end
The invoice amount currency
# File lib/cryptopay/models/invoice_params.rb, line 50 def price_currency @attributes[:price_currency] end
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
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
# File lib/cryptopay/models/invoice_params.rb, line 89 def unsuccess_redirect_url @attributes[:unsuccess_redirect_url] end
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