Class: PAYJPv2::PaymentFlowResponse
- Inherits:
-
Object
- Object
- PAYJPv2::PaymentFlowResponse
- Defined in:
- lib/payjpv2/models/payment_flow_response.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#amount ⇒ Object
支払い予定の金額.
-
#amount_capturable ⇒ Object
Returns the value of attribute amount_capturable.
-
#amount_received ⇒ Object
Returns the value of attribute amount_received.
-
#canceled_at ⇒ Object
Returns the value of attribute canceled_at.
-
#cancellation_reason ⇒ Object
Returns the value of attribute cancellation_reason.
-
#capture_method ⇒ Object
支払いの確定方法 | 値 | |:—| | automatic: (デフォルト) 顧客が支払いを承認すると、自動的に確定させます。 | | manual: 顧客が支払いを承認すると一旦確定を保留し、後で Capture API を使用して確定します。(すべての支払い方法がこれをサポートしているわけではありません)。 |.
-
#client_secret ⇒ Object
この PaymentFlow のクライアントシークレットです。フロントエンドで公開 API キーと合わせて使用し PaymentFlow の情報を取得や支払い処理を行います。**この値はこの PaymentFlow の支払いを行う顧客以外へ公開しないでください。**また保存やログへの記録なども行わないでください。.
-
#created_at ⇒ Object
作成日時 (UTC, ISO 8601 形式).
-
#currency ⇒ Object
価格の通貨。現在は ‘jpy` のみサポートしています。.
-
#customer_id ⇒ Object
Returns the value of attribute customer_id.
-
#description ⇒ Object
Returns the value of attribute description.
-
#expired_at ⇒ Object
Returns the value of attribute expired_at.
-
#id ⇒ Object
支払いフロー ID.
-
#last_payment_error ⇒ Object
Returns the value of attribute last_payment_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
この PaymentFlow で使用できる支払い方法の種類のリスト.
-
#return_url ⇒ Object
Returns the value of attribute return_url.
-
#status ⇒ Object
この PaymentFlow のステータス。 | 値 | |:—| | requires_payment_method: 支払い方法が必要です。 | | requires_confirmation: 確認が必要です。 | | requires_action: 顧客のアクションが必要です。 | | processing: 処理中です。 | | requires_capture: 確定が必要です。 | | canceled: キャンセルされました。 | | succeeded: 成功しました。 |.
-
#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 = {}) ⇒ PaymentFlowResponse
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 = {}) ⇒ PaymentFlowResponse
Initializes the object
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 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 |
# File 'lib/payjpv2/models/payment_flow_response.rb', line 189 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) raise ArgumentError, "The input argument (attributes) must be a hash in `PAYJPv2::PaymentFlowResponse` 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::PaymentFlowResponse`. 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 = 'payment_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?(:amount) self.amount = attributes[:amount] else self.amount = nil end if attributes.key?(:currency) self.currency = attributes[:currency] else self.currency = nil end if attributes.key?(:amount_capturable) self.amount_capturable = attributes[:amount_capturable] else self.amount_capturable = nil end if attributes.key?(:amount_received) self.amount_received = attributes[:amount_received] else self.amount_received = 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?(: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?(:capture_method) self.capture_method = attributes[:capture_method] else self.capture_method = nil end if attributes.key?(:last_payment_error) if (value = attributes[:last_payment_error]).is_a?(Hash) self.last_payment_error = value end else self.last_payment_error = nil end if attributes.key?(:cancellation_reason) self.cancellation_reason = attributes[:cancellation_reason] else self.cancellation_reason = nil end if attributes.key?(:canceled_at) self.canceled_at = attributes[:canceled_at] else self.canceled_at = nil end if attributes.key?(:expired_at) self.expired_at = attributes[:expired_at] end if attributes.key?(:metadata) if (value = attributes[:metadata]).is_a?(Hash) self. = value end else self. = 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
#amount ⇒ Object
支払い予定の金額
27 28 29 |
# File 'lib/payjpv2/models/payment_flow_response.rb', line 27 def amount @amount end |
#amount_capturable ⇒ Object
Returns the value of attribute amount_capturable.
32 33 34 |
# File 'lib/payjpv2/models/payment_flow_response.rb', line 32 def amount_capturable @amount_capturable end |
#amount_received ⇒ Object
Returns the value of attribute amount_received.
34 35 36 |
# File 'lib/payjpv2/models/payment_flow_response.rb', line 34 def amount_received @amount_received end |
#canceled_at ⇒ Object
Returns the value of attribute canceled_at.
64 65 66 |
# File 'lib/payjpv2/models/payment_flow_response.rb', line 64 def canceled_at @canceled_at end |
#cancellation_reason ⇒ Object
Returns the value of attribute cancellation_reason.
62 63 64 |
# File 'lib/payjpv2/models/payment_flow_response.rb', line 62 def cancellation_reason @cancellation_reason end |
#capture_method ⇒ Object
支払いの確定方法 | 値 | |:—| | automatic: (デフォルト) 顧客が支払いを承認すると、自動的に確定させます。 | | manual: 顧客が支払いを承認すると一旦確定を保留し、後で Capture API を使用して確定します。(すべての支払い方法がこれをサポートしているわけではありません)。 |
58 59 60 |
# File 'lib/payjpv2/models/payment_flow_response.rb', line 58 def capture_method @capture_method end |
#client_secret ⇒ Object
この PaymentFlow のクライアントシークレットです。フロントエンドで公開 API キーと合わせて使用し PaymentFlow の情報を取得や支払い処理を行います。**この値はこの PaymentFlow の支払いを行う顧客以外へ公開しないでください。**また保存やログへの記録なども行わないでください。
37 38 39 |
# File 'lib/payjpv2/models/payment_flow_response.rb', line 37 def client_secret @client_secret end |
#created_at ⇒ Object
作成日時 (UTC, ISO 8601 形式)
72 73 74 |
# File 'lib/payjpv2/models/payment_flow_response.rb', line 72 def created_at @created_at end |
#currency ⇒ Object
価格の通貨。現在は ‘jpy` のみサポートしています。
30 31 32 |
# File 'lib/payjpv2/models/payment_flow_response.rb', line 30 def currency @currency end |
#customer_id ⇒ Object
Returns the value of attribute customer_id.
39 40 41 |
# File 'lib/payjpv2/models/payment_flow_response.rb', line 39 def customer_id @customer_id end |
#description ⇒ Object
Returns the value of attribute description.
41 42 43 |
# File 'lib/payjpv2/models/payment_flow_response.rb', line 41 def description @description end |
#expired_at ⇒ Object
Returns the value of attribute expired_at.
66 67 68 |
# File 'lib/payjpv2/models/payment_flow_response.rb', line 66 def expired_at @expired_at end |
#id ⇒ Object
支払いフロー ID
21 22 23 |
# File 'lib/payjpv2/models/payment_flow_response.rb', line 21 def id @id end |
#last_payment_error ⇒ Object
Returns the value of attribute last_payment_error.
60 61 62 |
# File 'lib/payjpv2/models/payment_flow_response.rb', line 60 def last_payment_error @last_payment_error end |
#livemode ⇒ Object
本番環境かどうか
24 25 26 |
# File 'lib/payjpv2/models/payment_flow_response.rb', line 24 def livemode @livemode end |
#metadata ⇒ Object
メタデータ
69 70 71 |
# File 'lib/payjpv2/models/payment_flow_response.rb', line 69 def @metadata end |
#next_action ⇒ Object
Returns the value of attribute next_action.
53 54 55 |
# File 'lib/payjpv2/models/payment_flow_response.rb', line 53 def next_action @next_action end |
#object ⇒ Object
Returns the value of attribute object.
18 19 20 |
# File 'lib/payjpv2/models/payment_flow_response.rb', line 18 def object @object end |
#payment_method_id ⇒ Object
Returns the value of attribute payment_method_id.
43 44 45 |
# File 'lib/payjpv2/models/payment_flow_response.rb', line 43 def payment_method_id @payment_method_id end |
#payment_method_options ⇒ Object
Returns the value of attribute payment_method_options.
45 46 47 |
# File 'lib/payjpv2/models/payment_flow_response.rb', line 45 def @payment_method_options end |
#payment_method_types ⇒ Object
この PaymentFlow で使用できる支払い方法の種類のリスト
48 49 50 |
# File 'lib/payjpv2/models/payment_flow_response.rb', line 48 def payment_method_types @payment_method_types end |
#return_url ⇒ Object
Returns the value of attribute return_url.
55 56 57 |
# File 'lib/payjpv2/models/payment_flow_response.rb', line 55 def return_url @return_url end |
#status ⇒ Object
この PaymentFlow のステータス。 | 値 | |:—| | requires_payment_method: 支払い方法が必要です。 | | requires_confirmation: 確認が必要です。 | | requires_action: 顧客のアクションが必要です。 | | processing: 処理中です。 | | requires_capture: 確定が必要です。 | | canceled: キャンセルされました。 | | succeeded: 成功しました。 |
51 52 53 |
# File 'lib/payjpv2/models/payment_flow_response.rb', line 51 def status @status end |
#updated_at ⇒ Object
更新日時 (UTC, ISO 8601 形式)
75 76 77 |
# File 'lib/payjpv2/models/payment_flow_response.rb', line 75 def updated_at @updated_at end |
Class Method Details
._deserialize(type, value) ⇒ Object
Deserializes the data based on type
546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 |
# File 'lib/payjpv2/models/payment_flow_response.rb', line 546 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
130 131 132 |
# File 'lib/payjpv2/models/payment_flow_response.rb', line 130 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
135 136 137 |
# File 'lib/payjpv2/models/payment_flow_response.rb', line 135 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
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 |
# File 'lib/payjpv2/models/payment_flow_response.rb', line 100 def self.attribute_map { :object => :object, :id => :id, :livemode => :livemode, :amount => :amount, :currency => :currency, :amount_capturable => :amount_capturable, :amount_received => :amount_received, :client_secret => :client_secret, :customer_id => :customer_id, :description => :description, :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, :capture_method => :capture_method, :last_payment_error => :last_payment_error, :cancellation_reason => :cancellation_reason, :canceled_at => :canceled_at, :expired_at => :expired_at, :metadata => :metadata, :created_at => :created_at, :updated_at => :updated_at } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 |
# File 'lib/payjpv2/models/payment_flow_response.rb', line 522 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
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 |
# File 'lib/payjpv2/models/payment_flow_response.rb', line 170 def self.openapi_nullable Set.new([ :amount_capturable, :amount_received, :customer_id, :description, :payment_method_id, :payment_method_options, :next_action, :return_url, :last_payment_error, :cancellation_reason, :canceled_at, :expired_at, ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 |
# File 'lib/payjpv2/models/payment_flow_response.rb', line 140 def self.openapi_types { :object => :'String', :id => :'String', :livemode => :'Boolean', :amount => :'Integer', :currency => :'Currency', :amount_capturable => :'Integer', :amount_received => :'Integer', :client_secret => :'String', :customer_id => :'String', :description => :'String', :payment_method_id => :'String', :payment_method_options => :'Hash<String, Object>', :payment_method_types => :'Array<PaymentMethodTypes>', :status => :'PaymentFlowStatus', :next_action => :'Hash<String, Object>', :return_url => :'String', :capture_method => :'CaptureMethod', :last_payment_error => :'Hash<String, Object>', :cancellation_reason => :'PaymentFlowCancellationReason', :canceled_at => :'Time', :expired_at => :'Time', :metadata => :'Hash<String, MetadataValue>', :created_at => :'Time', :updated_at => :'Time' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
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 |
# File 'lib/payjpv2/models/payment_flow_response.rb', line 478 def ==(o) return true if self.equal?(o) self.class == o.class && object == o.object && id == o.id && livemode == o.livemode && amount == o.amount && currency == o.currency && amount_capturable == o.amount_capturable && amount_received == o.amount_received && client_secret == o.client_secret && customer_id == o.customer_id && description == o.description && 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 && capture_method == o.capture_method && last_payment_error == o.last_payment_error && cancellation_reason == o.cancellation_reason && canceled_at == o.canceled_at && expired_at == o.expired_at && == o. && 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
617 618 619 620 621 622 623 624 625 626 627 628 629 |
# File 'lib/payjpv2/models/payment_flow_response.rb', line 617 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
509 510 511 |
# File 'lib/payjpv2/models/payment_flow_response.rb', line 509 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
515 516 517 |
# File 'lib/payjpv2/models/payment_flow_response.rb', line 515 def hash [object, id, livemode, amount, currency, amount_capturable, amount_received, client_secret, customer_id, description, payment_method_id, , payment_method_types, status, next_action, return_url, capture_method, last_payment_error, cancellation_reason, canceled_at, expired_at, , created_at, updated_at].hash end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
593 594 595 |
# File 'lib/payjpv2/models/payment_flow_response.rb', line 593 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
599 600 601 602 603 604 605 606 607 608 609 610 611 |
# File 'lib/payjpv2/models/payment_flow_response.rb', line 599 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
587 588 589 |
# File 'lib/payjpv2/models/payment_flow_response.rb', line 587 def to_s to_hash.to_s end |