Class: PAYJPv2::SetupFlowResponse
- Inherits:
-
Object
- Object
- PAYJPv2::SetupFlowResponse
- Defined in:
- lib/payjpv2/models/setup_flow_response.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#cancellation_reason ⇒ Object
Returns the value of attribute cancellation_reason.
-
#client_secret ⇒ Object
この SetupFlow のクライアントシークレットです。フロントエンドで公開鍵と合わせて使用し、SetupFlow の取得や支払い方法の登録処理を行います。**この値はこの SetupFlow を利用する顧客以外へ公開しないでください。.
-
#created_at ⇒ Object
作成日時 (UTC, ISO 8601 形式).
-
#customer_id ⇒ Object
Returns the value of attribute customer_id.
-
#description ⇒ Object
Returns the value of attribute description.
-
#id ⇒ Object
ID.
-
#last_setup_error ⇒ Object
Returns the value of attribute last_setup_error.
-
#livemode ⇒ Object
本番環境かどうか.
-
#metadata ⇒ Object
メタデータ.
-
#next_action ⇒ Object
Returns the value of attribute next_action.
-
#object ⇒ Object
Returns the value of attribute object.
-
#payment_method_id ⇒ Object
Returns the value of attribute payment_method_id.
-
#payment_method_options ⇒ Object
Returns the value of attribute payment_method_options.
-
#payment_method_types ⇒ Object
この SetupFlow で使用できる支払い方法の種類のリスト.
-
#return_url ⇒ Object
Returns the value of attribute return_url.
-
#status ⇒ Object
この SetupFlow のステータスです。<a href="docs.pay.jp/v2/guide/payments/setupflow#setup-flow-%E3%81%AE%E3%82%B9%E3%83%86%E3%83%BC%E3%82%BF%E3%82%B9" target="_blank">ステータスの詳細についてはこちらをご覧ください。</a> | 値 | |:—| | requires_payment_method: 支払い方法が必要です。 | | requires_confirmation: 確認が必要です。 | | requires_action: 顧客のアクションが必要です。 | | processing: 処理中です。 | | succeeded: 成功しました。 | | canceled: キャンセルされました。 |.
-
#updated_at ⇒ Object
更新日時 (UTC, ISO 8601 形式).
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 = {}) ⇒ SetupFlowResponse
constructor
Initializes the object.
-
#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.
Constructor Details
#initialize(attributes = {}) ⇒ SetupFlowResponse
Initializes the object
154 155 156 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 187 188 189 190 191 192 193 194 195 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 |
# File 'lib/payjpv2/models/setup_flow_response.rb', line 154 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) raise ArgumentError, "The input argument (attributes) must be a hash in `PAYJPv2::SetupFlowResponse` 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)) raise ArgumentError, "`#{k}` is not a valid attribute in `PAYJPv2::SetupFlowResponse`. 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?(:object) self.object = attributes[:object] else self.object = 'setup_flow' end if attributes.key?(:id) self.id = attributes[:id] else self.id = nil end if attributes.key?(:livemode) self.livemode = attributes[:livemode] else self.livemode = nil end if attributes.key?(:client_secret) self.client_secret = attributes[:client_secret] else self.client_secret = nil end if attributes.key?(:customer_id) self.customer_id = attributes[:customer_id] else self.customer_id = nil end if attributes.key?(:description) self.description = attributes[:description] else self.description = nil end if attributes.key?(:metadata) if (value = attributes[:metadata]).is_a?(Hash) self. = value end else self. = nil end if attributes.key?(:payment_method_id) self.payment_method_id = attributes[:payment_method_id] else self.payment_method_id = nil end if attributes.key?(:payment_method_options) if (value = attributes[:payment_method_options]).is_a?(Hash) self. = value end else self. = nil end if attributes.key?(:payment_method_types) if (value = attributes[:payment_method_types]).is_a?(Array) self.payment_method_types = value end else self.payment_method_types = nil end if attributes.key?(:status) self.status = attributes[:status] else self.status = nil end if attributes.key?(:next_action) if (value = attributes[:next_action]).is_a?(Hash) self.next_action = value end else self.next_action = nil end if attributes.key?(:return_url) self.return_url = attributes[:return_url] else self.return_url = nil end if attributes.key?(:last_setup_error) if (value = attributes[:last_setup_error]).is_a?(Hash) self.last_setup_error = value end else self.last_setup_error = nil end if attributes.key?(:cancellation_reason) self.cancellation_reason = attributes[:cancellation_reason] else self.cancellation_reason = nil end if attributes.key?(:created_at) self.created_at = attributes[:created_at] else self.created_at = nil end if attributes.key?(:updated_at) self.updated_at = attributes[:updated_at] else self.updated_at = nil end end |
Instance Attribute Details
#cancellation_reason ⇒ Object
Returns the value of attribute cancellation_reason.
52 53 54 |
# File 'lib/payjpv2/models/setup_flow_response.rb', line 52 def cancellation_reason @cancellation_reason end |
#client_secret ⇒ Object
この SetupFlow のクライアントシークレットです。フロントエンドで公開鍵と合わせて使用し、SetupFlow の取得や支払い方法の登録処理を行います。**この値はこの SetupFlow を利用する顧客以外へ公開しないでください。
27 28 29 |
# File 'lib/payjpv2/models/setup_flow_response.rb', line 27 def client_secret @client_secret end |
#created_at ⇒ Object
作成日時 (UTC, ISO 8601 形式)
55 56 57 |
# File 'lib/payjpv2/models/setup_flow_response.rb', line 55 def created_at @created_at end |
#customer_id ⇒ Object
Returns the value of attribute customer_id.
29 30 31 |
# File 'lib/payjpv2/models/setup_flow_response.rb', line 29 def customer_id @customer_id end |
#description ⇒ Object
Returns the value of attribute description.
31 32 33 |
# File 'lib/payjpv2/models/setup_flow_response.rb', line 31 def description @description end |
#id ⇒ Object
ID
21 22 23 |
# File 'lib/payjpv2/models/setup_flow_response.rb', line 21 def id @id end |
#last_setup_error ⇒ Object
Returns the value of attribute last_setup_error.
50 51 52 |
# File 'lib/payjpv2/models/setup_flow_response.rb', line 50 def last_setup_error @last_setup_error end |
#livemode ⇒ Object
本番環境かどうか
24 25 26 |
# File 'lib/payjpv2/models/setup_flow_response.rb', line 24 def livemode @livemode end |
#metadata ⇒ Object
メタデータ
34 35 36 |
# File 'lib/payjpv2/models/setup_flow_response.rb', line 34 def @metadata end |
#next_action ⇒ Object
Returns the value of attribute next_action.
46 47 48 |
# File 'lib/payjpv2/models/setup_flow_response.rb', line 46 def next_action @next_action end |
#object ⇒ Object
Returns the value of attribute object.
18 19 20 |
# File 'lib/payjpv2/models/setup_flow_response.rb', line 18 def object @object end |
#payment_method_id ⇒ Object
Returns the value of attribute payment_method_id.
36 37 38 |
# File 'lib/payjpv2/models/setup_flow_response.rb', line 36 def payment_method_id @payment_method_id end |
#payment_method_options ⇒ Object
Returns the value of attribute payment_method_options.
38 39 40 |
# File 'lib/payjpv2/models/setup_flow_response.rb', line 38 def @payment_method_options end |
#payment_method_types ⇒ Object
この SetupFlow で使用できる支払い方法の種類のリスト
41 42 43 |
# File 'lib/payjpv2/models/setup_flow_response.rb', line 41 def payment_method_types @payment_method_types end |
#return_url ⇒ Object
Returns the value of attribute return_url.
48 49 50 |
# File 'lib/payjpv2/models/setup_flow_response.rb', line 48 def return_url @return_url end |
#status ⇒ Object
この SetupFlow のステータスです。<a href="docs.pay.jp/v2/guide/payments/setupflow#setup-flow-%E3%81%AE%E3%82%B9%E3%83%86%E3%83%BC%E3%82%BF%E3%82%B9" target="_blank">ステータスの詳細についてはこちらをご覧ください。</a> | 値 | |:—| | requires_payment_method: 支払い方法が必要です。 | | requires_confirmation: 確認が必要です。 | | requires_action: 顧客のアクションが必要です。 | | processing: 処理中です。 | | succeeded: 成功しました。 | | canceled: キャンセルされました。 |
44 45 46 |
# File 'lib/payjpv2/models/setup_flow_response.rb', line 44 def status @status end |
#updated_at ⇒ Object
更新日時 (UTC, ISO 8601 形式)
58 59 60 |
# File 'lib/payjpv2/models/setup_flow_response.rb', line 58 def updated_at @updated_at end |
Class Method Details
._deserialize(type, value) ⇒ Object
Deserializes the data based on type
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 |
# File 'lib/payjpv2/models/setup_flow_response.rb', line 434 def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) when :Date Date.parse(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 = PAYJPv2.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
106 107 108 |
# File 'lib/payjpv2/models/setup_flow_response.rb', line 106 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
111 112 113 |
# File 'lib/payjpv2/models/setup_flow_response.rb', line 111 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/payjpv2/models/setup_flow_response.rb', line 83 def self.attribute_map { :object => :object, :id => :id, :livemode => :livemode, :client_secret => :client_secret, :customer_id => :customer_id, :description => :description, :metadata => :metadata, :payment_method_id => :payment_method_id, :payment_method_options => :payment_method_options, :payment_method_types => :payment_method_types, :status => :status, :next_action => :next_action, :return_url => :return_url, :last_setup_error => :last_setup_error, :cancellation_reason => :cancellation_reason, :created_at => :created_at, :updated_at => :updated_at } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 |
# File 'lib/payjpv2/models/setup_flow_response.rb', line 410 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 new(transformed_hash) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
139 140 141 142 143 144 145 146 147 148 149 150 |
# File 'lib/payjpv2/models/setup_flow_response.rb', line 139 def self.openapi_nullable Set.new([ :customer_id, :description, :payment_method_id, :payment_method_options, :next_action, :return_url, :last_setup_error, :cancellation_reason, ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
# File 'lib/payjpv2/models/setup_flow_response.rb', line 116 def self.openapi_types { :object => :'String', :id => :'String', :livemode => :'Boolean', :client_secret => :'String', :customer_id => :'String', :description => :'String', :metadata => :'Hash<String, MetadataValue>', :payment_method_id => :'String', :payment_method_options => :'Hash<String, Object>', :payment_method_types => :'Array<PaymentMethodTypes>', :status => :'SetupFlowStatus', :next_action => :'Hash<String, Object>', :return_url => :'String', :last_setup_error => :'Hash<String, Object>', :cancellation_reason => :'SetupFlowCancellationReason', :created_at => :'Time', :updated_at => :'Time' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 |
# File 'lib/payjpv2/models/setup_flow_response.rb', line 373 def ==(o) return true if self.equal?(o) self.class == o.class && object == o.object && id == o.id && livemode == o.livemode && client_secret == o.client_secret && customer_id == o.customer_id && description == o.description && == o. && payment_method_id == o.payment_method_id && == o. && payment_method_types == o.payment_method_types && status == o.status && next_action == o.next_action && return_url == o.return_url && last_setup_error == o.last_setup_error && cancellation_reason == o.cancellation_reason && created_at == o.created_at && updated_at == o.updated_at end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
505 506 507 508 509 510 511 512 513 514 515 516 517 |
# File 'lib/payjpv2/models/setup_flow_response.rb', line 505 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
397 398 399 |
# File 'lib/payjpv2/models/setup_flow_response.rb', line 397 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
403 404 405 |
# File 'lib/payjpv2/models/setup_flow_response.rb', line 403 def hash [object, id, livemode, client_secret, customer_id, description, , payment_method_id, , payment_method_types, status, next_action, return_url, last_setup_error, cancellation_reason, created_at, updated_at].hash end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
481 482 483 |
# File 'lib/payjpv2/models/setup_flow_response.rb', line 481 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
487 488 489 490 491 492 493 494 495 496 497 498 499 |
# File 'lib/payjpv2/models/setup_flow_response.rb', line 487 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
475 476 477 |
# File 'lib/payjpv2/models/setup_flow_response.rb', line 475 def to_s to_hash.to_s end |