Class: PaypalServerSdk::BancontactPaymentObject

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

Overview

Information used to pay 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: SKIP, country_code: SKIP, bic: SKIP, iban_last_chars: SKIP, card_last_digits: SKIP) ⇒ BancontactPaymentObject

Returns a new instance of BancontactPaymentObject.



65
66
67
68
69
70
71
72
# File 'lib/paypal_server_sdk/models/bancontact_payment_object.rb', line 65

def initialize(name: SKIP, country_code: SKIP, bic: SKIP,
               iban_last_chars: SKIP, card_last_digits: SKIP)
  @name = name unless name == SKIP
  @country_code = country_code unless country_code == SKIP
  @bic = bic unless bic == SKIP
  @iban_last_chars = iban_last_chars unless iban_last_chars == SKIP
  @card_last_digits = card_last_digits unless card_last_digits == 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)


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

def bic
  @bic
end

#card_last_digitsString

The last digits of the card used to fund the Bancontact payment.

Returns:

  • (String)


36
37
38
# File 'lib/paypal_server_sdk/models/bancontact_payment_object.rb', line 36

def card_last_digits
  @card_last_digits
end

#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_object.rb', line 23

def country_code
  @country_code
end

#iban_last_charsString

The last characters of the IBAN used to pay.

Returns:

  • (String)


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

def iban_last_chars
  @iban_last_chars
end

#nameString

The full name representation like Mr J Smith.

Returns:

  • (String)


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

def name
  @name
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/paypal_server_sdk/models/bancontact_payment_object.rb', line 75

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  name = hash.key?('name') ? hash['name'] : SKIP
  country_code = hash.key?('country_code') ? hash['country_code'] : SKIP
  bic = hash.key?('bic') ? hash['bic'] : SKIP
  iban_last_chars =
    hash.key?('iban_last_chars') ? hash['iban_last_chars'] : SKIP
  card_last_digits =
    hash.key?('card_last_digits') ? hash['card_last_digits'] : SKIP

  # Create object from extracted values.
  BancontactPaymentObject.new(name: name,
                              country_code: country_code,
                              bic: bic,
                              iban_last_chars: iban_last_chars,
                              card_last_digits: card_last_digits)
end

.namesObject

A mapping from model property names to API property names.



39
40
41
42
43
44
45
46
47
# File 'lib/paypal_server_sdk/models/bancontact_payment_object.rb', line 39

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

.nullablesObject

An array for nullable fields



61
62
63
# File 'lib/paypal_server_sdk/models/bancontact_payment_object.rb', line 61

def self.nullables
  []
end

.optionalsObject

An array for optional fields



50
51
52
53
54
55
56
57
58
# File 'lib/paypal_server_sdk/models/bancontact_payment_object.rb', line 50

def self.optionals
  %w[
    name
    country_code
    bic
    iban_last_chars
    card_last_digits
  ]
end