Class: PaypalServerSdk::OrderAuthorizeRequestPaymentSource
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- PaypalServerSdk::OrderAuthorizeRequestPaymentSource
- Defined in:
- lib/paypal_server_sdk/models/order_authorize_request_payment_source.rb
Overview
The payment source definition.
Instance Attribute Summary collapse
-
#apple_pay ⇒ ApplePayRequest
Information needed to pay using ApplePay.
-
#card ⇒ CardRequest
The payment card to use to fund a payment.
-
#google_pay ⇒ GooglePayRequest
Information needed to pay using Google Pay.
-
#paypal ⇒ PaypalWallet
A resource that identifies a PayPal Wallet is used for payment.
-
#token ⇒ Token
The tokenized payment source to fund a payment.
-
#venmo ⇒ VenmoWalletRequest
Information needed to pay using Venmo.
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(card: SKIP, token: SKIP, paypal: SKIP, apple_pay: SKIP, google_pay: SKIP, venmo: SKIP) ⇒ OrderAuthorizeRequestPaymentSource
constructor
A new instance of OrderAuthorizeRequestPaymentSource.
-
#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(card: SKIP, token: SKIP, paypal: SKIP, apple_pay: SKIP, google_pay: SKIP, venmo: SKIP) ⇒ OrderAuthorizeRequestPaymentSource
Returns a new instance of OrderAuthorizeRequestPaymentSource.
69 70 71 72 73 74 75 76 77 |
# File 'lib/paypal_server_sdk/models/order_authorize_request_payment_source.rb', line 69 def initialize(card: SKIP, token: SKIP, paypal: SKIP, apple_pay: SKIP, google_pay: SKIP, venmo: SKIP) @card = card unless card == SKIP @token = token unless token == SKIP @paypal = paypal unless paypal == SKIP @apple_pay = apple_pay unless apple_pay == SKIP @google_pay = google_pay unless google_pay == SKIP @venmo = venmo unless venmo == SKIP end |
Instance Attribute Details
#apple_pay ⇒ ApplePayRequest
Information needed to pay using ApplePay.
30 31 32 |
# File 'lib/paypal_server_sdk/models/order_authorize_request_payment_source.rb', line 30 def apple_pay @apple_pay end |
#card ⇒ CardRequest
The payment card to use to fund a payment. Can be a credit or debit card. Note: Passing card number, cvv and expiry directly via the API requires PCI SAQ D compliance. *PayPal offers a mechanism by which you do not have to take on the PCI SAQ D burden by using hosted fields - refer to this Integration Guide*.
18 19 20 |
# File 'lib/paypal_server_sdk/models/order_authorize_request_payment_source.rb', line 18 def card @card end |
#google_pay ⇒ GooglePayRequest
Information needed to pay using Google Pay.
34 35 36 |
# File 'lib/paypal_server_sdk/models/order_authorize_request_payment_source.rb', line 34 def google_pay @google_pay end |
#paypal ⇒ PaypalWallet
A resource that identifies a PayPal Wallet is used for payment.
26 27 28 |
# File 'lib/paypal_server_sdk/models/order_authorize_request_payment_source.rb', line 26 def paypal @paypal end |
#token ⇒ Token
The tokenized payment source to fund a payment.
22 23 24 |
# File 'lib/paypal_server_sdk/models/order_authorize_request_payment_source.rb', line 22 def token @token end |
#venmo ⇒ VenmoWalletRequest
Information needed to pay using Venmo.
38 39 40 |
# File 'lib/paypal_server_sdk/models/order_authorize_request_payment_source.rb', line 38 def venmo @venmo end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/paypal_server_sdk/models/order_authorize_request_payment_source.rb', line 80 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. card = CardRequest.from_hash(hash['card']) if hash['card'] token = Token.from_hash(hash['token']) if hash['token'] paypal = PaypalWallet.from_hash(hash['paypal']) if hash['paypal'] apple_pay = ApplePayRequest.from_hash(hash['apple_pay']) if hash['apple_pay'] google_pay = GooglePayRequest.from_hash(hash['google_pay']) if hash['google_pay'] venmo = VenmoWalletRequest.from_hash(hash['venmo']) if hash['venmo'] # Create object from extracted values. OrderAuthorizeRequestPaymentSource.new(card: card, token: token, paypal: paypal, apple_pay: apple_pay, google_pay: google_pay, venmo: venmo) end |
.names ⇒ Object
A mapping from model property names to API property names.
41 42 43 44 45 46 47 48 49 50 |
# File 'lib/paypal_server_sdk/models/order_authorize_request_payment_source.rb', line 41 def self.names @_hash = {} if @_hash.nil? @_hash['card'] = 'card' @_hash['token'] = 'token' @_hash['paypal'] = 'paypal' @_hash['apple_pay'] = 'apple_pay' @_hash['google_pay'] = 'google_pay' @_hash['venmo'] = 'venmo' @_hash end |
.nullables ⇒ Object
An array for nullable fields
65 66 67 |
# File 'lib/paypal_server_sdk/models/order_authorize_request_payment_source.rb', line 65 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
53 54 55 56 57 58 59 60 61 62 |
# File 'lib/paypal_server_sdk/models/order_authorize_request_payment_source.rb', line 53 def self.optionals %w[ card token paypal apple_pay google_pay venmo ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
108 109 110 111 112 113 |
# File 'lib/paypal_server_sdk/models/order_authorize_request_payment_source.rb', line 108 def inspect class_name = self.class.name.split('::').last "<#{class_name} card: #{@card.inspect}, token: #{@token.inspect}, paypal:"\ " #{@paypal.inspect}, apple_pay: #{@apple_pay.inspect}, google_pay: #{@google_pay.inspect},"\ " venmo: #{@venmo.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
101 102 103 104 105 |
# File 'lib/paypal_server_sdk/models/order_authorize_request_payment_source.rb', line 101 def to_s class_name = self.class.name.split('::').last "<#{class_name} card: #{@card}, token: #{@token}, paypal: #{@paypal}, apple_pay:"\ " #{@apple_pay}, google_pay: #{@google_pay}, venmo: #{@venmo}>" end |