Class: PaypalServerSdk::GooglePayRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- PaypalServerSdk::GooglePayRequest
- Defined in:
- lib/paypal_server_sdk/models/google_pay_request.rb
Overview
Information needed to pay using Google Pay.
Instance Attribute Summary collapse
-
#assurance_details ⇒ AssuranceDetails
Information about cardholder possession validation and cardholder identification and verifications (ID&V).
-
#card ⇒ GooglePayRequestCard
The payment card used to fund a Google Pay payment.
-
#decrypted_token ⇒ GooglePayDecryptedTokenData
Details shared by Google for the merchant to be shared with PayPal.
-
#email_address ⇒ String
The internationalized email address.
-
#experience_context ⇒ GooglePayExperienceContext
Customizes the payer experience during the approval process for the payment.
-
#name ⇒ String
The full name representation like Mr J Smith.
-
#phone_number ⇒ PhoneNumberWithCountryCode
The phone number in its canonical international [E.164 numbering plan format](www.itu.int/rec/T-REC-E.164/en).
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, email_address: SKIP, phone_number: SKIP, card: SKIP, decrypted_token: SKIP, assurance_details: SKIP, experience_context: SKIP) ⇒ GooglePayRequest
constructor
A new instance of GooglePayRequest.
-
#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, email_address: SKIP, phone_number: SKIP, card: SKIP, decrypted_token: SKIP, assurance_details: SKIP, experience_context: SKIP) ⇒ GooglePayRequest
Returns a new instance of GooglePayRequest.
80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/paypal_server_sdk/models/google_pay_request.rb', line 80 def initialize(name: SKIP, email_address: SKIP, phone_number: SKIP, card: SKIP, decrypted_token: SKIP, assurance_details: SKIP, experience_context: SKIP) @name = name unless name == SKIP @email_address = email_address unless email_address == SKIP @phone_number = phone_number unless phone_number == SKIP @card = card unless card == SKIP @decrypted_token = decrypted_token unless decrypted_token == SKIP @assurance_details = assurance_details unless assurance_details == SKIP @experience_context = experience_context unless experience_context == SKIP end |
Instance Attribute Details
#assurance_details ⇒ AssuranceDetails
Information about cardholder possession validation and cardholder identification and verifications (ID&V).
42 43 44 |
# File 'lib/paypal_server_sdk/models/google_pay_request.rb', line 42 def assurance_details @assurance_details end |
#card ⇒ GooglePayRequestCard
The payment card used to fund a Google Pay payment. Can be a credit or debit card.
31 32 33 |
# File 'lib/paypal_server_sdk/models/google_pay_request.rb', line 31 def card @card end |
#decrypted_token ⇒ GooglePayDecryptedTokenData
Details shared by Google for the merchant to be shared with PayPal. This is required to process the transaction using the Google Pay payment method.
37 38 39 |
# File 'lib/paypal_server_sdk/models/google_pay_request.rb', line 37 def decrypted_token @decrypted_token end |
#email_address ⇒ 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.
21 22 23 |
# File 'lib/paypal_server_sdk/models/google_pay_request.rb', line 21 def email_address @email_address end |
#experience_context ⇒ GooglePayExperienceContext
Customizes the payer experience during the approval process for the payment.
47 48 49 |
# File 'lib/paypal_server_sdk/models/google_pay_request.rb', line 47 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/google_pay_request.rb', line 14 def name @name end |
#phone_number ⇒ PhoneNumberWithCountryCode
The phone number in its canonical international [E.164 numbering plan format](www.itu.int/rec/T-REC-E.164/en).
26 27 28 |
# File 'lib/paypal_server_sdk/models/google_pay_request.rb', line 26 def phone_number @phone_number end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/paypal_server_sdk/models/google_pay_request.rb', line 93 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. name = hash.key?('name') ? hash['name'] : SKIP email_address = hash.key?('email_address') ? hash['email_address'] : SKIP phone_number = PhoneNumberWithCountryCode.from_hash(hash['phone_number']) if hash['phone_number'] card = GooglePayRequestCard.from_hash(hash['card']) if hash['card'] decrypted_token = GooglePayDecryptedTokenData.from_hash(hash['decrypted_token']) if hash['decrypted_token'] assurance_details = AssuranceDetails.from_hash(hash['assurance_details']) if hash['assurance_details'] experience_context = GooglePayExperienceContext.from_hash(hash['experience_context']) if hash['experience_context'] # Create object from extracted values. GooglePayRequest.new(name: name, email_address: email_address, phone_number: phone_number, card: card, decrypted_token: decrypted_token, assurance_details: assurance_details, experience_context: experience_context) end |
.names ⇒ Object
A mapping from model property names to API property names.
50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/paypal_server_sdk/models/google_pay_request.rb', line 50 def self.names @_hash = {} if @_hash.nil? @_hash['name'] = 'name' @_hash['email_address'] = 'email_address' @_hash['phone_number'] = 'phone_number' @_hash['card'] = 'card' @_hash['decrypted_token'] = 'decrypted_token' @_hash['assurance_details'] = 'assurance_details' @_hash['experience_context'] = 'experience_context' @_hash end |
.nullables ⇒ Object
An array for nullable fields
76 77 78 |
# File 'lib/paypal_server_sdk/models/google_pay_request.rb', line 76 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/paypal_server_sdk/models/google_pay_request.rb', line 63 def self.optionals %w[ name email_address phone_number card decrypted_token assurance_details experience_context ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
128 129 130 131 132 133 134 |
# File 'lib/paypal_server_sdk/models/google_pay_request.rb', line 128 def inspect class_name = self.class.name.split('::').last "<#{class_name} name: #{@name.inspect}, email_address: #{@email_address.inspect},"\ " phone_number: #{@phone_number.inspect}, card: #{@card.inspect}, decrypted_token:"\ " #{@decrypted_token.inspect}, assurance_details: #{@assurance_details.inspect},"\ " experience_context: #{@experience_context.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
120 121 122 123 124 125 |
# File 'lib/paypal_server_sdk/models/google_pay_request.rb', line 120 def to_s class_name = self.class.name.split('::').last "<#{class_name} name: #{@name}, email_address: #{@email_address}, phone_number:"\ " #{@phone_number}, card: #{@card}, decrypted_token: #{@decrypted_token}, assurance_details:"\ " #{@assurance_details}, experience_context: #{@experience_context}>" end |