Class: PaypalServerSdk::ConfirmOrderRequest

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/paypal_server_sdk/models/confirm_order_request.rb

Overview

Payer confirms the intent to pay for the Order using the provided payment source.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(payment_source:, processing_instruction: SKIP, application_context: SKIP) ⇒ ConfirmOrderRequest

Returns a new instance of ConfirmOrderRequest.



47
48
49
50
51
52
# File 'lib/paypal_server_sdk/models/confirm_order_request.rb', line 47

def initialize(payment_source:, processing_instruction: SKIP,
               application_context: SKIP)
  @payment_source = payment_source
  @processing_instruction = processing_instruction unless processing_instruction == SKIP
  @application_context = application_context unless application_context == SKIP
end

Instance Attribute Details

#application_contextOrderConfirmApplicationContext

Customizes the payer confirmation experience.



23
24
25
# File 'lib/paypal_server_sdk/models/confirm_order_request.rb', line 23

def application_context
  @application_context
end

#payment_sourcePaymentSource

The payment source definition.

Returns:



15
16
17
# File 'lib/paypal_server_sdk/models/confirm_order_request.rb', line 15

def payment_source
  @payment_source
end

#processing_instructionObject

The payment source definition.

Returns:

  • (Object)


19
20
21
# File 'lib/paypal_server_sdk/models/confirm_order_request.rb', line 19

def processing_instruction
  @processing_instruction
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/paypal_server_sdk/models/confirm_order_request.rb', line 55

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  payment_source = PaymentSource.from_hash(hash['payment_source']) if hash['payment_source']
  processing_instruction =
    hash.key?('processing_instruction') ? hash['processing_instruction'] : SKIP
  application_context = OrderConfirmApplicationContext.from_hash(hash['application_context']) if
    hash['application_context']

  # Create object from extracted values.
  ConfirmOrderRequest.new(payment_source: payment_source,
                          processing_instruction: processing_instruction,
                          application_context: application_context)
end

.namesObject

A mapping from model property names to API property names.



26
27
28
29
30
31
32
# File 'lib/paypal_server_sdk/models/confirm_order_request.rb', line 26

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['payment_source'] = 'payment_source'
  @_hash['processing_instruction'] = 'processing_instruction'
  @_hash['application_context'] = 'application_context'
  @_hash
end

.nullablesObject

An array for nullable fields



43
44
45
# File 'lib/paypal_server_sdk/models/confirm_order_request.rb', line 43

def self.nullables
  []
end

.optionalsObject

An array for optional fields



35
36
37
38
39
40
# File 'lib/paypal_server_sdk/models/confirm_order_request.rb', line 35

def self.optionals
  %w[
    processing_instruction
    application_context
  ]
end