Class: OCI::OspGateway::Models::CreditCardPaymentDetail
- Inherits:
-
PaymentDetail
- Object
- PaymentDetail
- OCI::OspGateway::Models::CreditCardPaymentDetail
- Defined in:
- lib/oci/osp_gateway/models/credit_card_payment_detail.rb
Overview
Credit card 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_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
Constants inherited from PaymentDetail
PaymentDetail::PAYMENT_METHOD_ENUM
Instance Attribute Summary collapse
-
#credit_card_type ⇒ String
Credit card type.
-
#last_digits ⇒ String
Last four digits of the card.
-
#name_on_card ⇒ String
Name on the credit card.
-
#time_expiration ⇒ DateTime
Expired date of the credit 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 = {}) ⇒ CreditCardPaymentDetail
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 = {}) ⇒ CreditCardPaymentDetail
Initializes the object
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/oci/osp_gateway/models/credit_card_payment_detail.rb', line 85 def initialize(attributes = {}) return unless attributes.is_a?(Hash) attributes['paymentMethod'] = 'CREDIT_CARD' super(attributes) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } 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
Credit card type
30 31 32 |
# File 'lib/oci/osp_gateway/models/credit_card_payment_detail.rb', line 30 def credit_card_type @credit_card_type end |
#last_digits ⇒ String
Last four digits of the card
34 35 36 |
# File 'lib/oci/osp_gateway/models/credit_card_payment_detail.rb', line 34 def last_digits @last_digits end |
#name_on_card ⇒ String
Name on the credit card
26 27 28 |
# File 'lib/oci/osp_gateway/models/credit_card_payment_detail.rb', line 26 def name_on_card @name_on_card end |
#time_expiration ⇒ DateTime
Expired date of the credit card
38 39 40 |
# File 'lib/oci/osp_gateway/models/credit_card_payment_detail.rb', line 38 def time_expiration @time_expiration end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/oci/osp_gateway/models/credit_card_payment_detail.rb', line 41 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'time_paid_on': :'timePaidOn', 'paid_by': :'paidBy', 'payment_method': :'paymentMethod', 'amount_paid': :'amountPaid', '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.
57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/oci/osp_gateway/models/credit_card_payment_detail.rb', line 57 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'time_paid_on': :'DateTime', 'paid_by': :'String', 'payment_method': :'String', 'amount_paid': :'Float', '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.
140 141 142 143 144 145 146 147 148 149 150 151 152 |
# File 'lib/oci/osp_gateway/models/credit_card_payment_detail.rb', line 140 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 && 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
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 |
# File 'lib/oci/osp_gateway/models/credit_card_payment_detail.rb', line 177 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
157 158 159 |
# File 'lib/oci/osp_gateway/models/credit_card_payment_detail.rb', line 157 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
166 167 168 |
# File 'lib/oci/osp_gateway/models/credit_card_payment_detail.rb', line 166 def hash [time_paid_on, paid_by, payment_method, amount_paid, name_on_card, credit_card_type, last_digits, time_expiration].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
210 211 212 213 214 215 216 217 218 219 |
# File 'lib/oci/osp_gateway/models/credit_card_payment_detail.rb', line 210 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
204 205 206 |
# File 'lib/oci/osp_gateway/models/credit_card_payment_detail.rb', line 204 def to_s to_hash.to_s end |