Class: PaypalServerSdk::TrustlyPaymentRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- PaypalServerSdk::TrustlyPaymentRequest
- Defined in:
- lib/paypal_server_sdk/models/trustly_payment_request.rb
Overview
Information needed to pay using Trustly.
Instance Attribute Summary collapse
-
#country_code ⇒ String
The [two-character ISO 3166-1 code](/api/rest/reference/country-codes/) that identifies the country or region.
-
#email ⇒ String
The internationalized email address.
-
#experience_context ⇒ ExperienceContext
Customizes the payer experience during the approval process for the payment.
-
#name ⇒ String
The full name representation like Mr J Smith.
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:, country_code:, email:, experience_context: SKIP) ⇒ TrustlyPaymentRequest
constructor
A new instance of TrustlyPaymentRequest.
-
#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:, country_code:, email:, experience_context: SKIP) ⇒ TrustlyPaymentRequest
Returns a new instance of TrustlyPaymentRequest.
58 59 60 61 62 63 |
# File 'lib/paypal_server_sdk/models/trustly_payment_request.rb', line 58 def initialize(name:, country_code:, email:, experience_context: SKIP) @name = name @country_code = country_code @email = email @experience_context = experience_context unless experience_context == SKIP end |
Instance Attribute Details
#country_code ⇒ String
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.
22 23 24 |
# File 'lib/paypal_server_sdk/models/trustly_payment_request.rb', line 22 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.
29 30 31 |
# File 'lib/paypal_server_sdk/models/trustly_payment_request.rb', line 29 def email @email end |
#experience_context ⇒ ExperienceContext
Customizes the payer experience during the approval process for the payment.
34 35 36 |
# File 'lib/paypal_server_sdk/models/trustly_payment_request.rb', line 34 def experience_context @experience_context end |
#name ⇒ String
The full name representation like Mr J Smith.
14 15 16 |
# File 'lib/paypal_server_sdk/models/trustly_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.
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/paypal_server_sdk/models/trustly_payment_request.rb', line 66 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 email = hash.key?('email') ? hash['email'] : nil experience_context = ExperienceContext.from_hash(hash['experience_context']) if hash['experience_context'] # Create object from extracted values. TrustlyPaymentRequest.new(name: name, country_code: country_code, email: email, experience_context: experience_context) 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/trustly_payment_request.rb', line 37 def self.names @_hash = {} if @_hash.nil? @_hash['name'] = 'name' @_hash['country_code'] = 'country_code' @_hash['email'] = 'email' @_hash['experience_context'] = 'experience_context' @_hash end |
.nullables ⇒ Object
An array for nullable fields
54 55 56 |
# File 'lib/paypal_server_sdk/models/trustly_payment_request.rb', line 54 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
47 48 49 50 51 |
# File 'lib/paypal_server_sdk/models/trustly_payment_request.rb', line 47 def self.optionals %w[ experience_context ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
91 92 93 94 95 |
# File 'lib/paypal_server_sdk/models/trustly_payment_request.rb', line 91 def inspect class_name = self.class.name.split('::').last "<#{class_name} name: #{@name.inspect}, country_code: #{@country_code.inspect}, email:"\ " #{@email.inspect}, experience_context: #{@experience_context.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
84 85 86 87 88 |
# File 'lib/paypal_server_sdk/models/trustly_payment_request.rb', line 84 def to_s class_name = self.class.name.split('::').last "<#{class_name} name: #{@name}, country_code: #{@country_code}, email: #{@email},"\ " experience_context: #{@experience_context}>" end |