lib/purecloud/models/payment_method.rb in purecloud-0.38.1 vs lib/purecloud/models/payment_method.rb in purecloud-0.39.1
- old
+ new
@@ -27,10 +27,18 @@
attr_accessor :provider_name
attr_accessor :token
+ # for payment methods of type CARD_TOKEN, the card's expiration date in the format YYYY-MM.
+ attr_accessor :card_expiration_date
+
+ attr_accessor :card_last_four_digits
+
+ # for payment methods of type CARD_TOKEN, the type of credit or debit card
+ attr_accessor :card_type
+
# The URI for this object
attr_accessor :self_uri
# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
@@ -44,10 +52,16 @@
:'provider_name' => :'providerName',
:'token' => :'token',
+ :'card_expiration_date' => :'cardExpirationDate',
+
+ :'card_last_four_digits' => :'cardLastFourDigits',
+
+ :'card_type' => :'cardType',
+
:'self_uri' => :'selfUri'
}
end
@@ -57,10 +71,13 @@
:'id' => :'String',
:'name' => :'String',
:'type' => :'String',
:'provider_name' => :'String',
:'token' => :'String',
+ :'card_expiration_date' => :'String',
+ :'card_last_four_digits' => :'String',
+ :'card_type' => :'String',
:'self_uri' => :'String'
}
end
@@ -89,10 +106,22 @@
if attributes[:'token']
self.token = attributes[:'token']
end
+ if attributes[:'cardExpirationDate']
+ self.card_expiration_date = attributes[:'cardExpirationDate']
+ end
+
+ if attributes[:'cardLastFourDigits']
+ self.card_last_four_digits = attributes[:'cardLastFourDigits']
+ end
+
+ if attributes[:'cardType']
+ self.card_type = attributes[:'cardType']
+ end
+
if attributes[:'selfUri']
self.self_uri = attributes[:'selfUri']
end
end
@@ -104,29 +133,41 @@
fail "invalid value for 'type', must be one of #{allowed_values}"
end
@type = type
end
+ # Custom attribute writer method checking allowed values (enum).
+ def card_type=(card_type)
+ allowed_values = ["Visa", "MasterCard", "Discover", "American Express"]
+ if card_type && !allowed_values.include?(card_type)
+ fail "invalid value for 'card_type', must be one of #{allowed_values}"
+ end
+ @card_type = card_type
+ end
+
# Check equality by comparing each attribute.
def ==(o)
return true if self.equal?(o)
self.class == o.class &&
id == o.id &&
name == o.name &&
type == o.type &&
provider_name == o.provider_name &&
token == o.token &&
+ card_expiration_date == o.card_expiration_date &&
+ card_last_four_digits == o.card_last_four_digits &&
+ card_type == o.card_type &&
self_uri == o.self_uri
end
# @see the `==` method
def eql?(o)
self == o
end
# Calculate hash code according to all attributes.
def hash
- [id, name, type, provider_name, token, self_uri].hash
+ [id, name, type, provider_name, token, card_expiration_date, card_last_four_digits, card_type, self_uri].hash
end
# build the object from hash
def build_from_hash(attributes)
return nil unless attributes.is_a?(Hash)