Class: PaypalServerSdk::BlikPaymentObject
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- PaypalServerSdk::BlikPaymentObject
- Defined in:
- lib/paypal_server_sdk/models/blik_payment_object.rb
Overview
Information used to pay using BLIK.
Instance Attribute Summary collapse
-
#country_code ⇒ String
The [two-character ISO 3166-1 code](developer.paypal.com/api/rest/reference/country-codes/) that identifies the country or region.
-
#email ⇒ String
The internationalized email address.
-
#name ⇒ String
The full name representation like Mr J Smith.
-
#one_click ⇒ BlikOneClickPaymentObject
Information used to pay using BLIK one-click flow.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(name: SKIP, country_code: SKIP, email: SKIP, one_click: SKIP) ⇒ BlikPaymentObject
constructor
A new instance of BlikPaymentObject.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
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: SKIP, country_code: SKIP, email: SKIP, one_click: SKIP) ⇒ BlikPaymentObject
Returns a new instance of BlikPaymentObject.
61 62 63 64 65 66 |
# File 'lib/paypal_server_sdk/models/blik_payment_object.rb', line 61 def initialize(name: SKIP, country_code: SKIP, email: SKIP, one_click: SKIP) @name = name unless name == SKIP @country_code = country_code unless country_code == SKIP @email = email unless email == SKIP @one_click = one_click unless one_click == SKIP end |
Instance Attribute Details
#country_code ⇒ String
The [two-character ISO 3166-1 code](developer.paypal.com/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.
23 24 25 |
# File 'lib/paypal_server_sdk/models/blik_payment_object.rb', line 23 def country_code @country_code end |
#email ⇒ String
The internationalized email address. Note: Up to 64 characters are allowed before and 255 characters are allowed after the @ sign. However, the generally accepted maximum length for an email address is 254 characters. The pattern verifies that an unquoted @ sign exists.
30 31 32 |
# File 'lib/paypal_server_sdk/models/blik_payment_object.rb', line 30 def email @email end |
#name ⇒ String
The full name representation like Mr J Smith.
14 15 16 |
# File 'lib/paypal_server_sdk/models/blik_payment_object.rb', line 14 def name @name end |
#one_click ⇒ BlikOneClickPaymentObject
Information used to pay using BLIK one-click flow.
34 35 36 |
# File 'lib/paypal_server_sdk/models/blik_payment_object.rb', line 34 def one_click @one_click end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/paypal_server_sdk/models/blik_payment_object.rb', line 69 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 email = hash.key?('email') ? hash['email'] : SKIP one_click = BlikOneClickPaymentObject.from_hash(hash['one_click']) if hash['one_click'] # Create object from extracted values. BlikPaymentObject.new(name: name, country_code: country_code, email: email, one_click: one_click) end |
.names ⇒ Object
A mapping from model property names to API property names.
37 38 39 40 41 42 43 44 |
# File 'lib/paypal_server_sdk/models/blik_payment_object.rb', line 37 def self.names @_hash = {} if @_hash.nil? @_hash['name'] = 'name' @_hash['country_code'] = 'country_code' @_hash['email'] = 'email' @_hash['one_click'] = 'one_click' @_hash end |
.nullables ⇒ Object
An array for nullable fields
57 58 59 |
# File 'lib/paypal_server_sdk/models/blik_payment_object.rb', line 57 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
47 48 49 50 51 52 53 54 |
# File 'lib/paypal_server_sdk/models/blik_payment_object.rb', line 47 def self.optionals %w[ name country_code email one_click ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
93 94 95 96 97 |
# File 'lib/paypal_server_sdk/models/blik_payment_object.rb', line 93 def inspect class_name = self.class.name.split('::').last "<#{class_name} name: #{@name.inspect}, country_code: #{@country_code.inspect}, email:"\ " #{@email.inspect}, one_click: #{@one_click.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
86 87 88 89 90 |
# File 'lib/paypal_server_sdk/models/blik_payment_object.rb', line 86 def to_s class_name = self.class.name.split('::').last "<#{class_name} name: #{@name}, country_code: #{@country_code}, email: #{@email},"\ " one_click: #{@one_click}>" end |