Class: Cryptopay::CustomerUpdateParams
- Inherits:
-
Object
- Object
- Cryptopay::CustomerUpdateParams
- Defined in:
- lib/cryptopay/models/customer_update_params.rb
Class Method Summary collapse
-
.build_from_hash(data) ⇒ Cryptopay::CustomerUpdateParams
Builds the object from hash.
Instance Method Summary collapse
-
#addresses ⇒ Object
This array allows you to specify 1 cryptocurrency address for each type of supported cryptocurrencies i.e.
-
#currency ⇒ Object
The customer’s currency in your system.
-
#initialize(attributes = {}) ⇒ CustomerUpdateParams
constructor
Initializes the object.
- #inspect ⇒ Object
-
#invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ CustomerUpdateParams
Initializes the object
32 33 34 |
# File 'lib/cryptopay/models/customer_update_params.rb', line 32 def initialize(attributes = {}) @attributes = ENCODER.sanitize(attributes) end |
Class Method Details
.build_from_hash(data) ⇒ Cryptopay::CustomerUpdateParams
Builds the object from hash
25 26 27 28 |
# File 'lib/cryptopay/models/customer_update_params.rb', line 25 def self.build_from_hash(data) attributes = ENCODER.build_from_hash(data) new(attributes) end |
Instance Method Details
#addresses ⇒ Object
This array allows you to specify 1 cryptocurrency address for each type of supported cryptocurrencies i.e. BTC, ETH, XRP, LTC and BCH. In case Cryptopay detects a High-Risk transaction, such transaction will not be processed. Instead, it will be sent to the address specified for respective cryptocurrency. If you do not specify any addresses here, High-Risk payments will be put on hold
42 43 44 |
# File 'lib/cryptopay/models/customer_update_params.rb', line 42 def addresses @attributes[:addresses] end |
#currency ⇒ Object
The customer’s currency in your system
37 38 39 |
# File 'lib/cryptopay/models/customer_update_params.rb', line 37 def currency @attributes[:currency] end |
#inspect ⇒ Object
72 73 74 |
# File 'lib/cryptopay/models/customer_update_params.rb', line 72 def inspect "#<#{self.class}:0x#{object_id.to_s(16)}> JSON: " + JSON.pretty_generate(to_hash) end |
#invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/cryptopay/models/customer_update_params.rb', line 48 def invalid_properties properties = [] addresses&.each_with_index do |item, index| item.invalid_properties.each do |prop| properties.push("invalid value for \"addresses.#{index}\": #{prop}") end end properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
68 69 70 |
# File 'lib/cryptopay/models/customer_update_params.rb', line 68 def to_hash ENCODER.to_hash(@attributes) end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
62 63 64 |
# File 'lib/cryptopay/models/customer_update_params.rb', line 62 def valid? invalid_properties.empty? end |