Class: Komoju::PlatformPayment
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- Komoju::PlatformPayment
- Defined in:
- lib/komoju-sdk/models/platform_payment.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#amount ⇒ Object
Amount greater than or equal to 0, in the lowest denomination of the currency (e.g. cents for USD).
-
#amount_refunded ⇒ Object
Amount greater than or equal to 0, in the lowest denomination of the currency (e.g. cents for USD).
-
#captured_at ⇒ Object
Timestamp when the payment was captured, or null if not yet captured.
-
#created_at ⇒ Object
Timestamp when the payment was created.
-
#currency ⇒ Object
Returns the value of attribute currency.
-
#customer ⇒ Object
Customer UUID if associated with a customer, otherwise null.
-
#customer_family_name ⇒ Object
Customer's family name.
-
#customer_given_name ⇒ Object
Customer's given name.
-
#description ⇒ Object
Optional description for the payment.
-
#external_order_num ⇒ Object
External order reference from the merchant's system.
-
#id ⇒ Object
A unique 25-character alphanumeric resource identifier.
-
#locale ⇒ Object
Returns the value of attribute locale.
-
#mcc ⇒ Object
Merchant Category Code used for this payment.
-
#metadata ⇒ Object
Arbitrary key-value metadata attached to the payment.
-
#payment_deadline ⇒ Object
Deadline by which the payment must be completed, or null.
-
#payment_details ⇒ Object
Serialized payment method details for this payment.
-
#payment_method_fee ⇒ Object
Amount greater than or equal to 0, in the lowest denomination of the currency (e.g. cents for USD).
-
#platform_details ⇒ Object
Returns the value of attribute platform_details.
-
#refund_requests ⇒ Object
Array of refund request objects associated with this payment.
-
#refunds ⇒ Object
Array of refund objects associated with this payment.
-
#resource ⇒ Object
Resource type name, always "payment".
-
#session ⇒ Object
A unique 25-character alphanumeric resource identifier.
-
#statement_descriptor ⇒ Object
Statement descriptor shown to the customer on their bank statement.
-
#status ⇒ Object
Returns the value of attribute status.
-
#tax ⇒ Object
Amount greater than or equal to 0, in the lowest denomination of the currency (e.g. cents for USD).
-
#total ⇒ Object
Amount greater than or equal to 0, in the lowest denomination of the currency (e.g. cents for USD).
Class Method Summary collapse
-
._deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ PlatformPayment
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ PlatformPayment
Initializes the object
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 |
# File 'lib/komoju-sdk/models/platform_payment.rb', line 196 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Komoju::PlatformPayment` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `Komoju::PlatformPayment`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'id') self.id = attributes[:'id'] else self.id = nil end if attributes.key?(:'resource') self.resource = attributes[:'resource'] else self.resource = nil end if attributes.key?(:'status') self.status = attributes[:'status'] else self.status = nil end if attributes.key?(:'amount') self.amount = attributes[:'amount'] else self.amount = nil end if attributes.key?(:'tax') self.tax = attributes[:'tax'] else self.tax = nil end if attributes.key?(:'customer') self.customer = attributes[:'customer'] else self.customer = nil end if attributes.key?(:'payment_deadline') self.payment_deadline = attributes[:'payment_deadline'] else self.payment_deadline = nil end if attributes.key?(:'payment_details') self.payment_details = attributes[:'payment_details'] else self.payment_details = nil end if attributes.key?(:'payment_method_fee') self.payment_method_fee = attributes[:'payment_method_fee'] else self.payment_method_fee = nil end if attributes.key?(:'total') self.total = attributes[:'total'] else self.total = nil end if attributes.key?(:'currency') self.currency = attributes[:'currency'] else self.currency = nil end if attributes.key?(:'description') self.description = attributes[:'description'] else self.description = nil end if attributes.key?(:'captured_at') self.captured_at = attributes[:'captured_at'] else self.captured_at = nil end if attributes.key?(:'external_order_num') self.external_order_num = attributes[:'external_order_num'] else self.external_order_num = nil end if attributes.key?(:'metadata') self. = attributes[:'metadata'] else self. = nil end if attributes.key?(:'created_at') self.created_at = attributes[:'created_at'] else self.created_at = nil end if attributes.key?(:'amount_refunded') self.amount_refunded = attributes[:'amount_refunded'] else self.amount_refunded = nil end if attributes.key?(:'locale') self.locale = attributes[:'locale'] else self.locale = nil end if attributes.key?(:'session') self.session = attributes[:'session'] else self.session = nil end if attributes.key?(:'customer_family_name') self.customer_family_name = attributes[:'customer_family_name'] else self.customer_family_name = nil end if attributes.key?(:'customer_given_name') self.customer_given_name = attributes[:'customer_given_name'] else self.customer_given_name = nil end if attributes.key?(:'platform_details') self.platform_details = attributes[:'platform_details'] else self.platform_details = nil end if attributes.key?(:'mcc') self.mcc = attributes[:'mcc'] else self.mcc = nil end if attributes.key?(:'statement_descriptor') self.statement_descriptor = attributes[:'statement_descriptor'] else self.statement_descriptor = nil end if attributes.key?(:'refunds') if (value = attributes[:'refunds']).is_a?(Array) self.refunds = value end else self.refunds = nil end if attributes.key?(:'refund_requests') if (value = attributes[:'refund_requests']).is_a?(Array) self.refund_requests = value end else self.refund_requests = nil end end |
Instance Attribute Details
#amount ⇒ Object
Amount greater than or equal to 0, in the lowest denomination of the currency (e.g. cents for USD).
27 28 29 |
# File 'lib/komoju-sdk/models/platform_payment.rb', line 27 def amount @amount end |
#amount_refunded ⇒ Object
Amount greater than or equal to 0, in the lowest denomination of the currency (e.g. cents for USD).
65 66 67 |
# File 'lib/komoju-sdk/models/platform_payment.rb', line 65 def amount_refunded @amount_refunded end |
#captured_at ⇒ Object
Timestamp when the payment was captured, or null if not yet captured.
53 54 55 |
# File 'lib/komoju-sdk/models/platform_payment.rb', line 53 def captured_at @captured_at end |
#created_at ⇒ Object
Timestamp when the payment was created.
62 63 64 |
# File 'lib/komoju-sdk/models/platform_payment.rb', line 62 def created_at @created_at end |
#currency ⇒ Object
Returns the value of attribute currency.
47 48 49 |
# File 'lib/komoju-sdk/models/platform_payment.rb', line 47 def currency @currency end |
#customer ⇒ Object
Customer UUID if associated with a customer, otherwise null.
33 34 35 |
# File 'lib/komoju-sdk/models/platform_payment.rb', line 33 def customer @customer end |
#customer_family_name ⇒ Object
Customer's family name.
73 74 75 |
# File 'lib/komoju-sdk/models/platform_payment.rb', line 73 def customer_family_name @customer_family_name end |
#customer_given_name ⇒ Object
Customer's given name.
76 77 78 |
# File 'lib/komoju-sdk/models/platform_payment.rb', line 76 def customer_given_name @customer_given_name end |
#description ⇒ Object
Optional description for the payment.
50 51 52 |
# File 'lib/komoju-sdk/models/platform_payment.rb', line 50 def description @description end |
#external_order_num ⇒ Object
External order reference from the merchant's system.
56 57 58 |
# File 'lib/komoju-sdk/models/platform_payment.rb', line 56 def external_order_num @external_order_num end |
#id ⇒ Object
A unique 25-character alphanumeric resource identifier.
19 20 21 |
# File 'lib/komoju-sdk/models/platform_payment.rb', line 19 def id @id end |
#locale ⇒ Object
Returns the value of attribute locale.
67 68 69 |
# File 'lib/komoju-sdk/models/platform_payment.rb', line 67 def locale @locale end |
#mcc ⇒ Object
Merchant Category Code used for this payment.
81 82 83 |
# File 'lib/komoju-sdk/models/platform_payment.rb', line 81 def mcc @mcc end |
#metadata ⇒ Object
Arbitrary key-value metadata attached to the payment.
59 60 61 |
# File 'lib/komoju-sdk/models/platform_payment.rb', line 59 def @metadata end |
#payment_deadline ⇒ Object
Deadline by which the payment must be completed, or null.
36 37 38 |
# File 'lib/komoju-sdk/models/platform_payment.rb', line 36 def payment_deadline @payment_deadline end |
#payment_details ⇒ Object
Serialized payment method details for this payment.
39 40 41 |
# File 'lib/komoju-sdk/models/platform_payment.rb', line 39 def payment_details @payment_details end |
#payment_method_fee ⇒ Object
Amount greater than or equal to 0, in the lowest denomination of the currency (e.g. cents for USD).
42 43 44 |
# File 'lib/komoju-sdk/models/platform_payment.rb', line 42 def payment_method_fee @payment_method_fee end |
#platform_details ⇒ Object
Returns the value of attribute platform_details.
78 79 80 |
# File 'lib/komoju-sdk/models/platform_payment.rb', line 78 def platform_details @platform_details end |
#refund_requests ⇒ Object
Array of refund request objects associated with this payment.
90 91 92 |
# File 'lib/komoju-sdk/models/platform_payment.rb', line 90 def refund_requests @refund_requests end |
#refunds ⇒ Object
Array of refund objects associated with this payment.
87 88 89 |
# File 'lib/komoju-sdk/models/platform_payment.rb', line 87 def refunds @refunds end |
#resource ⇒ Object
Resource type name, always "payment".
22 23 24 |
# File 'lib/komoju-sdk/models/platform_payment.rb', line 22 def resource @resource end |
#session ⇒ Object
A unique 25-character alphanumeric resource identifier.
70 71 72 |
# File 'lib/komoju-sdk/models/platform_payment.rb', line 70 def session @session end |
#statement_descriptor ⇒ Object
Statement descriptor shown to the customer on their bank statement.
84 85 86 |
# File 'lib/komoju-sdk/models/platform_payment.rb', line 84 def statement_descriptor @statement_descriptor end |
#status ⇒ Object
Returns the value of attribute status.
24 25 26 |
# File 'lib/komoju-sdk/models/platform_payment.rb', line 24 def status @status end |
#tax ⇒ Object
Amount greater than or equal to 0, in the lowest denomination of the currency (e.g. cents for USD).
30 31 32 |
# File 'lib/komoju-sdk/models/platform_payment.rb', line 30 def tax @tax end |
#total ⇒ Object
Amount greater than or equal to 0, in the lowest denomination of the currency (e.g. cents for USD).
45 46 47 |
# File 'lib/komoju-sdk/models/platform_payment.rb', line 45 def total @total end |
Class Method Details
._deserialize(type, value) ⇒ Object
Deserializes the data based on type
935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 |
# File 'lib/komoju-sdk/models/platform_payment.rb', line 935 def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) rescue value when :Date Date.parse(value) rescue value when :String value.to_s when :Integer value.to_i when :Float value.to_f when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model # models (e.g. Pet) or oneOf klass = Komoju.const_get(type) klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end |
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
147 148 149 |
# File 'lib/komoju-sdk/models/platform_payment.rb', line 147 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
152 153 154 |
# File 'lib/komoju-sdk/models/platform_payment.rb', line 152 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
# File 'lib/komoju-sdk/models/platform_payment.rb', line 115 def self.attribute_map { :'id' => :'id', :'resource' => :'resource', :'status' => :'status', :'amount' => :'amount', :'tax' => :'tax', :'customer' => :'customer', :'payment_deadline' => :'payment_deadline', :'payment_details' => :'payment_details', :'payment_method_fee' => :'payment_method_fee', :'total' => :'total', :'currency' => :'currency', :'description' => :'description', :'captured_at' => :'captured_at', :'external_order_num' => :'external_order_num', :'metadata' => :'metadata', :'created_at' => :'created_at', :'amount_refunded' => :'amount_refunded', :'locale' => :'locale', :'session' => :'session', :'customer_family_name' => :'customer_family_name', :'customer_given_name' => :'customer_given_name', :'platform_details' => :'platform_details', :'mcc' => :'mcc', :'statement_descriptor' => :'statement_descriptor', :'refunds' => :'refunds', :'refund_requests' => :'refund_requests' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 |
# File 'lib/komoju-sdk/models/platform_payment.rb', line 905 def self.build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) transformed_hash = {} openapi_types.each_pair do |key, type| if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[attribute_map[key]].is_a?(Array) transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end elsif !attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end begin new(transformed_hash) rescue ArgumentError => e obj = allocate transformed_hash.each { |k, v| obj.instance_variable_set(:"@#{k}", v) } obj end end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
189 190 191 192 |
# File 'lib/komoju-sdk/models/platform_payment.rb', line 189 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 |
# File 'lib/komoju-sdk/models/platform_payment.rb', line 157 def self.openapi_types { :'id' => :'String', :'resource' => :'String', :'status' => :'PaymentStatus', :'amount' => :'Integer', :'tax' => :'Integer', :'customer' => :'String', :'payment_deadline' => :'String', :'payment_details' => :'String', :'payment_method_fee' => :'Integer', :'total' => :'Integer', :'currency' => :'Currency', :'description' => :'String', :'captured_at' => :'Time', :'external_order_num' => :'String', :'metadata' => :'Object', :'created_at' => :'Time', :'amount_refunded' => :'Integer', :'locale' => :'Locale', :'session' => :'String', :'customer_family_name' => :'String', :'customer_given_name' => :'String', :'platform_details' => :'PlatformDetails', :'mcc' => :'String', :'statement_descriptor' => :'String', :'refunds' => :'Array<Object>', :'refund_requests' => :'Array<Object>' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 |
# File 'lib/komoju-sdk/models/platform_payment.rb', line 859 def ==(o) return true if self.equal?(o) self.class == o.class && id == o.id && resource == o.resource && status == o.status && amount == o.amount && tax == o.tax && customer == o.customer && payment_deadline == o.payment_deadline && payment_details == o.payment_details && payment_method_fee == o.payment_method_fee && total == o.total && currency == o.currency && description == o.description && captured_at == o.captured_at && external_order_num == o.external_order_num && == o. && created_at == o.created_at && amount_refunded == o.amount_refunded && locale == o.locale && session == o.session && customer_family_name == o.customer_family_name && customer_given_name == o.customer_given_name && platform_details == o.platform_details && mcc == o.mcc && statement_descriptor == o.statement_descriptor && refunds == o.refunds && refund_requests == o.refund_requests end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 |
# File 'lib/komoju-sdk/models/platform_payment.rb', line 1006 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#eql?(o) ⇒ Boolean
892 893 894 |
# File 'lib/komoju-sdk/models/platform_payment.rb', line 892 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
898 899 900 |
# File 'lib/komoju-sdk/models/platform_payment.rb', line 898 def hash [id, resource, status, amount, tax, customer, payment_deadline, payment_details, payment_method_fee, total, currency, description, captured_at, external_order_num, , created_at, amount_refunded, locale, session, customer_family_name, customer_given_name, platform_details, mcc, statement_descriptor, refunds, refund_requests].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 |
# File 'lib/komoju-sdk/models/platform_payment.rb', line 373 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @id.nil? invalid_properties.push('invalid value for "id", id cannot be nil.') end if @id.to_s.length > 25 invalid_properties.push('invalid value for "id", the character length must be smaller than or equal to 25.') end if @id.to_s.length < 25 invalid_properties.push('invalid value for "id", the character length must be greater than or equal to 25.') end if @resource.nil? invalid_properties.push('invalid value for "resource", resource cannot be nil.') end if @status.nil? invalid_properties.push('invalid value for "status", status cannot be nil.') end if @amount.nil? invalid_properties.push('invalid value for "amount", amount cannot be nil.') end if @amount < 0 invalid_properties.push('invalid value for "amount", must be greater than or equal to 0.') end if @tax.nil? invalid_properties.push('invalid value for "tax", tax cannot be nil.') end if @tax < 0 invalid_properties.push('invalid value for "tax", must be greater than or equal to 0.') end if @customer.nil? invalid_properties.push('invalid value for "customer", customer cannot be nil.') end if @payment_deadline.nil? invalid_properties.push('invalid value for "payment_deadline", payment_deadline cannot be nil.') end if @payment_details.nil? invalid_properties.push('invalid value for "payment_details", payment_details cannot be nil.') end if @payment_method_fee.nil? invalid_properties.push('invalid value for "payment_method_fee", payment_method_fee cannot be nil.') end if @payment_method_fee < 0 invalid_properties.push('invalid value for "payment_method_fee", must be greater than or equal to 0.') end if @total.nil? invalid_properties.push('invalid value for "total", total cannot be nil.') end if @total < 0 invalid_properties.push('invalid value for "total", must be greater than or equal to 0.') end if @currency.nil? invalid_properties.push('invalid value for "currency", currency cannot be nil.') end if @description.nil? invalid_properties.push('invalid value for "description", description cannot be nil.') end if @captured_at.nil? invalid_properties.push('invalid value for "captured_at", captured_at cannot be nil.') end if @external_order_num.nil? invalid_properties.push('invalid value for "external_order_num", external_order_num cannot be nil.') end if @metadata.nil? invalid_properties.push('invalid value for "metadata", metadata cannot be nil.') end if @created_at.nil? invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') end if @amount_refunded.nil? invalid_properties.push('invalid value for "amount_refunded", amount_refunded cannot be nil.') end if @amount_refunded < 0 invalid_properties.push('invalid value for "amount_refunded", must be greater than or equal to 0.') end if @locale.nil? invalid_properties.push('invalid value for "locale", locale cannot be nil.') end if @session.nil? invalid_properties.push('invalid value for "session", session cannot be nil.') end if @session.to_s.length > 25 invalid_properties.push('invalid value for "session", the character length must be smaller than or equal to 25.') end if @session.to_s.length < 25 invalid_properties.push('invalid value for "session", the character length must be greater than or equal to 25.') end if @customer_family_name.nil? invalid_properties.push('invalid value for "customer_family_name", customer_family_name cannot be nil.') end if @customer_given_name.nil? invalid_properties.push('invalid value for "customer_given_name", customer_given_name cannot be nil.') end if @platform_details.nil? invalid_properties.push('invalid value for "platform_details", platform_details cannot be nil.') end if @mcc.nil? invalid_properties.push('invalid value for "mcc", mcc cannot be nil.') end if @statement_descriptor.nil? invalid_properties.push('invalid value for "statement_descriptor", statement_descriptor cannot be nil.') end if @refunds.nil? invalid_properties.push('invalid value for "refunds", refunds cannot be nil.') end if @refund_requests.nil? invalid_properties.push('invalid value for "refund_requests", refund_requests cannot be nil.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
982 983 984 |
# File 'lib/komoju-sdk/models/platform_payment.rb', line 982 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
988 989 990 991 992 993 994 995 996 997 998 999 1000 |
# File 'lib/komoju-sdk/models/platform_payment.rb', line 988 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
976 977 978 |
# File 'lib/komoju-sdk/models/platform_payment.rb', line 976 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 |
# File 'lib/komoju-sdk/models/platform_payment.rb', line 521 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @id.nil? return false if @id.to_s.length > 25 return false if @id.to_s.length < 25 return false if @resource.nil? return false if @status.nil? return false if @amount.nil? return false if @amount < 0 return false if @tax.nil? return false if @tax < 0 return false if @customer.nil? return false if @payment_deadline.nil? return false if @payment_details.nil? return false if @payment_method_fee.nil? return false if @payment_method_fee < 0 return false if @total.nil? return false if @total < 0 return false if @currency.nil? return false if @description.nil? return false if @captured_at.nil? return false if @external_order_num.nil? return false if @metadata.nil? return false if @created_at.nil? return false if @amount_refunded.nil? return false if @amount_refunded < 0 return false if @locale.nil? return false if @session.nil? return false if @session.to_s.length > 25 return false if @session.to_s.length < 25 return false if @customer_family_name.nil? return false if @customer_given_name.nil? return false if @platform_details.nil? return false if @mcc.nil? return false if @statement_descriptor.nil? return false if @refunds.nil? return false if @refund_requests.nil? true end |