Class: OCI::OspGateway::Models::OtherPaymentDetail
- Inherits:
-
PaymentDetail
- Object
- PaymentDetail
- OCI::OspGateway::Models::OtherPaymentDetail
- Defined in:
- lib/oci/osp_gateway/models/other_payment_detail.rb
Overview
Other Payment related details
Constant Summary collapse
- CREDIT_CARD_TYPE_ENUM =
[ CREDIT_CARD_TYPE_VISA = 'VISA'.freeze, CREDIT_CARD_TYPE_AMEX = 'AMEX'.freeze, CREDIT_CARD_TYPE_MASTERCARD = 'MASTERCARD'.freeze, CREDIT_CARD_TYPE_DISCOVER = 'DISCOVER'.freeze, CREDIT_CARD_TYPE_JCB = 'JCB'.freeze, CREDIT_CARD_TYPE_DINER = 'DINER'.freeze, CREDIT_CARD_TYPE_ELO = 'ELO'.freeze, CREDIT_CARD_TYPE_SAVING = 'SAVING'.freeze, CREDIT_CARD_TYPE_CHECKING = 'CHECKING'.freeze, CREDIT_CARD_TYPE_CORPORATE_CHECKING = 'CORPORATE_CHECKING'.freeze, CREDIT_CARD_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
Constants inherited from PaymentDetail
PaymentDetail::PAYMENT_METHOD_ENUM
Instance Attribute Summary collapse
-
#credit_card_type ⇒ String
Echeck card type.
-
#echeck_routing ⇒ String
Last four routing digits of the card.
-
#last_digits ⇒ String
Last four digits of the card.
-
#name_on_card ⇒ String
Name on the echeck card.
-
#time_expiration ⇒ DateTime
Expired date of the echeck card.
Attributes inherited from PaymentDetail
#amount_paid, #paid_by, #payment_method, #time_paid_on
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ OtherPaymentDetail
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Methods inherited from PaymentDetail
Constructor Details
#initialize(attributes = {}) ⇒ OtherPaymentDetail
Initializes the object
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
# File 'lib/oci/osp_gateway/models/other_payment_detail.rb', line 95 def initialize(attributes = {}) return unless attributes.is_a?(Hash) attributes['paymentMethod'] = 'OTHER' super(attributes) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } self.echeck_routing = attributes[:'echeckRouting'] if attributes[:'echeckRouting'] raise 'You cannot provide both :echeckRouting and :echeck_routing' if attributes.key?(:'echeckRouting') && attributes.key?(:'echeck_routing') self.echeck_routing = attributes[:'echeck_routing'] if attributes[:'echeck_routing'] self.name_on_card = attributes[:'nameOnCard'] if attributes[:'nameOnCard'] raise 'You cannot provide both :nameOnCard and :name_on_card' if attributes.key?(:'nameOnCard') && attributes.key?(:'name_on_card') self.name_on_card = attributes[:'name_on_card'] if attributes[:'name_on_card'] self.credit_card_type = attributes[:'creditCardType'] if attributes[:'creditCardType'] raise 'You cannot provide both :creditCardType and :credit_card_type' if attributes.key?(:'creditCardType') && attributes.key?(:'credit_card_type') self.credit_card_type = attributes[:'credit_card_type'] if attributes[:'credit_card_type'] self.last_digits = attributes[:'lastDigits'] if attributes[:'lastDigits'] raise 'You cannot provide both :lastDigits and :last_digits' if attributes.key?(:'lastDigits') && attributes.key?(:'last_digits') self.last_digits = attributes[:'last_digits'] if attributes[:'last_digits'] self.time_expiration = attributes[:'timeExpiration'] if attributes[:'timeExpiration'] raise 'You cannot provide both :timeExpiration and :time_expiration' if attributes.key?(:'timeExpiration') && attributes.key?(:'time_expiration') self.time_expiration = attributes[:'time_expiration'] if attributes[:'time_expiration'] end |
Instance Attribute Details
#credit_card_type ⇒ String
Echeck card type
37 38 39 |
# File 'lib/oci/osp_gateway/models/other_payment_detail.rb', line 37 def credit_card_type @credit_card_type end |
#echeck_routing ⇒ String
Last four routing digits of the card
29 30 31 |
# File 'lib/oci/osp_gateway/models/other_payment_detail.rb', line 29 def echeck_routing @echeck_routing end |
#last_digits ⇒ String
Last four digits of the card
41 42 43 |
# File 'lib/oci/osp_gateway/models/other_payment_detail.rb', line 41 def last_digits @last_digits end |
#name_on_card ⇒ String
Name on the echeck card
33 34 35 |
# File 'lib/oci/osp_gateway/models/other_payment_detail.rb', line 33 def name_on_card @name_on_card end |
#time_expiration ⇒ DateTime
Expired date of the echeck card
45 46 47 |
# File 'lib/oci/osp_gateway/models/other_payment_detail.rb', line 45 def time_expiration @time_expiration end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/oci/osp_gateway/models/other_payment_detail.rb', line 48 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'time_paid_on': :'timePaidOn', 'paid_by': :'paidBy', 'payment_method': :'paymentMethod', 'amount_paid': :'amountPaid', 'echeck_routing': :'echeckRouting', 'name_on_card': :'nameOnCard', 'credit_card_type': :'creditCardType', 'last_digits': :'lastDigits', 'time_expiration': :'timeExpiration' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/oci/osp_gateway/models/other_payment_detail.rb', line 65 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'time_paid_on': :'DateTime', 'paid_by': :'String', 'payment_method': :'String', 'amount_paid': :'Float', 'echeck_routing': :'String', 'name_on_card': :'String', 'credit_card_type': :'String', 'last_digits': :'String', 'time_expiration': :'DateTime' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
156 157 158 159 160 161 162 163 164 165 166 167 168 169 |
# File 'lib/oci/osp_gateway/models/other_payment_detail.rb', line 156 def ==(other) return true if equal?(other) self.class == other.class && time_paid_on == other.time_paid_on && paid_by == other.paid_by && payment_method == other.payment_method && amount_paid == other.amount_paid && echeck_routing == other.echeck_routing && name_on_card == other.name_on_card && credit_card_type == other.credit_card_type && last_digits == other.last_digits && time_expiration == other.time_expiration end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 |
# File 'lib/oci/osp_gateway/models/other_payment_detail.rb', line 194 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /^Array<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) public_method("#{key}=").call( attributes[self.class.attribute_map[key]] .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? public_method("#{key}=").call( OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]) ) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(other) ⇒ Boolean
174 175 176 |
# File 'lib/oci/osp_gateway/models/other_payment_detail.rb', line 174 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
183 184 185 |
# File 'lib/oci/osp_gateway/models/other_payment_detail.rb', line 183 def hash [time_paid_on, paid_by, payment_method, amount_paid, echeck_routing, name_on_card, credit_card_type, last_digits, time_expiration].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
227 228 229 230 231 232 233 234 235 236 |
# File 'lib/oci/osp_gateway/models/other_payment_detail.rb', line 227 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = public_method(attr).call next if value.nil? && !instance_variable_defined?("@#{attr}") hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
221 222 223 |
# File 'lib/oci/osp_gateway/models/other_payment_detail.rb', line 221 def to_s to_hash.to_s end |