Class: PaypalServerSdk::BancontactPaymentRequest

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

Overview

Information needed to pay using Bancontact.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(name:, country_code:, experience_context: SKIP) ⇒ BancontactPaymentRequest

Returns a new instance of BancontactPaymentRequest.



51
52
53
54
55
# File 'lib/paypal_server_sdk/models/bancontact_payment_request.rb', line 51

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

Instance Attribute Details

#country_codeString

The [two-character ISO 3166-1 code](/api/rest/reference/country-codes/) that identifies the country or region.<blockquote><strong>Note:</strong> 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.</blockquote>

Returns:

  • (String)


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

def country_code
  @country_code
end

#experience_contextExperienceContext

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

Returns:



28
29
30
# File 'lib/paypal_server_sdk/models/bancontact_payment_request.rb', line 28

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/bancontact_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.



58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/paypal_server_sdk/models/bancontact_payment_request.rb', line 58

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
  experience_context = ExperienceContext.from_hash(hash['experience_context']) if
    hash['experience_context']

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

.namesObject

A mapping from model property names to API property names.



31
32
33
34
35
36
37
# File 'lib/paypal_server_sdk/models/bancontact_payment_request.rb', line 31

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

.nullablesObject

An array for nullable fields



47
48
49
# File 'lib/paypal_server_sdk/models/bancontact_payment_request.rb', line 47

def self.nullables
  []
end

.optionalsObject

An array for optional fields



40
41
42
43
44
# File 'lib/paypal_server_sdk/models/bancontact_payment_request.rb', line 40

def self.optionals
  %w[
    experience_context
  ]
end