Class: PaypalServerSdk::IdealPaymentRequest

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

Overview

Information needed to pay using iDEAL.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(name:, country_code:, bic: SKIP, experience_context: SKIP) ⇒ IdealPaymentRequest

Returns a new instance of IdealPaymentRequest.



57
58
59
60
61
62
# File 'lib/paypal_server_sdk/models/ideal_payment_request.rb', line 57

def initialize(name:, country_code:, bic: SKIP, experience_context: SKIP)
  @name = name
  @country_code = country_code
  @bic = bic unless bic == SKIP
  @experience_context = experience_context unless experience_context == SKIP
end

Instance Attribute Details

#bicString

The business identification code (BIC). In payments systems, a BIC is used to identify a specific business, most commonly a bank.

Returns:

  • (String)


27
28
29
# File 'lib/paypal_server_sdk/models/ideal_payment_request.rb', line 27

def bic
  @bic
end

#country_codeString

The [two-character ISO 3166-1 code](/api/rest/reference/country-codes/) that identifies the country or region. Note: The country code for Great Britain is GB and not UK as used in the top-level domain names for that country. Use the ‘C2` country code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border transactions.

Returns:

  • (String)


22
23
24
# File 'lib/paypal_server_sdk/models/ideal_payment_request.rb', line 22

def country_code
  @country_code
end

#experience_contextExperienceContext

Customizes the payer experience during the approval process for the payment.

Returns:



32
33
34
# File 'lib/paypal_server_sdk/models/ideal_payment_request.rb', line 32

def experience_context
  @experience_context
end

#nameString

The full name representation like Mr J Smith.

Returns:

  • (String)


14
15
16
# File 'lib/paypal_server_sdk/models/ideal_payment_request.rb', line 14

def name
  @name
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/paypal_server_sdk/models/ideal_payment_request.rb', line 65

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  name = hash.key?('name') ? hash['name'] : nil
  country_code = hash.key?('country_code') ? hash['country_code'] : nil
  bic = hash.key?('bic') ? hash['bic'] : SKIP
  experience_context = ExperienceContext.from_hash(hash['experience_context']) if
    hash['experience_context']

  # Create object from extracted values.
  IdealPaymentRequest.new(name: name,
                          country_code: country_code,
                          bic: bic,
                          experience_context: experience_context)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['name'] = 'name'
  @_hash['country_code'] = 'country_code'
  @_hash['bic'] = 'bic'
  @_hash['experience_context'] = 'experience_context'
  @_hash
end

.nullablesObject

An array for nullable fields



53
54
55
# File 'lib/paypal_server_sdk/models/ideal_payment_request.rb', line 53

def self.nullables
  []
end

.optionalsObject

An array for optional fields



45
46
47
48
49
50
# File 'lib/paypal_server_sdk/models/ideal_payment_request.rb', line 45

def self.optionals
  %w[
    bic
    experience_context
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



90
91
92
93
94
# File 'lib/paypal_server_sdk/models/ideal_payment_request.rb', line 90

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} name: #{@name.inspect}, country_code: #{@country_code.inspect}, bic:"\
  " #{@bic.inspect}, experience_context: #{@experience_context.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



83
84
85
86
87
# File 'lib/paypal_server_sdk/models/ideal_payment_request.rb', line 83

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} name: #{@name}, country_code: #{@country_code}, bic: #{@bic},"\
  " experience_context: #{@experience_context}>"
end