Class: PaypalServerSdk::P24PaymentRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- PaypalServerSdk::P24PaymentRequest
- Defined in:
- lib/paypal_server_sdk/models/p24_payment_request.rb
Overview
Information needed to pay using P24 (Przelewy24).
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.<blockquote><strong>Note:</strong> The country code for Great Britain is
GB
and notUK
as used in the top-level domain names for that country. -
#email ⇒ String
The internationalized email address.<blockquote><strong>Note:</strong> Up to 64 characters are allowed before and 255 characters are allowed after the
@
sign. -
#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:, email:, country_code:, experience_context: SKIP) ⇒ P24PaymentRequest
constructor
A new instance of P24PaymentRequest.
Methods inherited from BaseModel
Constructor Details
#initialize(name:, email:, country_code:, experience_context: SKIP) ⇒ P24PaymentRequest
Returns a new instance of P24PaymentRequest.
60 61 62 63 64 65 |
# File 'lib/paypal_server_sdk/models/p24_payment_request.rb', line 60 def initialize(name:, email:, country_code:, experience_context: SKIP) @name = name @email = email @country_code = country_code @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.<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>
31 32 33 |
# File 'lib/paypal_server_sdk/models/p24_payment_request.rb', line 31 def country_code @country_code end |
#email ⇒ String
The internationalized email address.<blockquote><strong>Note:</strong> 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.</blockquote>
22 23 24 |
# File 'lib/paypal_server_sdk/models/p24_payment_request.rb', line 22 def email @email end |
#experience_context ⇒ ExperienceContext
Customizes the payer experience during the approval process for the payment.
36 37 38 |
# File 'lib/paypal_server_sdk/models/p24_payment_request.rb', line 36 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/p24_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.
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/paypal_server_sdk/models/p24_payment_request.rb', line 68 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. name = hash.key?('name') ? hash['name'] : nil email = hash.key?('email') ? hash['email'] : 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. P24PaymentRequest.new(name: name, email: email, country_code: country_code, experience_context: experience_context) end |
.names ⇒ Object
A mapping from model property names to API property names.
39 40 41 42 43 44 45 46 |
# File 'lib/paypal_server_sdk/models/p24_payment_request.rb', line 39 def self.names @_hash = {} if @_hash.nil? @_hash['name'] = 'name' @_hash['email'] = 'email' @_hash['country_code'] = 'country_code' @_hash['experience_context'] = 'experience_context' @_hash end |
.nullables ⇒ Object
An array for nullable fields
56 57 58 |
# File 'lib/paypal_server_sdk/models/p24_payment_request.rb', line 56 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
49 50 51 52 53 |
# File 'lib/paypal_server_sdk/models/p24_payment_request.rb', line 49 def self.optionals %w[ experience_context ] end |