Class: PaypalServerSdk::OrderAuthorizeRequestPaymentSource

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/paypal_server_sdk/models/order_authorize_request_payment_source.rb

Overview

The payment source definition.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#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.



73
74
75
76
77
78
79
80
81
# File 'lib/paypal_server_sdk/models/order_authorize_request_payment_source.rb', line 73

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_payApplePayRequest

Information needed to pay using ApplePay.

Returns:



34
35
36
# File 'lib/paypal_server_sdk/models/order_authorize_request_payment_source.rb', line 34

def apple_pay
  @apple_pay
end

#cardCardRequest

The payment card to use to fund a payment. Can be a credit or debit card.<blockquote><strong>Note:</strong> Passing card number, cvv and expiry directly via the API requires <a href=“www.pcisecuritystandards.org/pci_security/completing_self_as sessment”> PCI SAQ D compliance</a>.
*PayPal offers a mechanism by which you do not have to take on the <strong>PCI SAQ D</strong> burden by using hosted fields - refer to <a href=“developer.paypal.com/docs/checkout/advanced/integrate/”>this Integration Guide</a>*.</blockquote>

Returns:



22
23
24
# File 'lib/paypal_server_sdk/models/order_authorize_request_payment_source.rb', line 22

def card
  @card
end

#google_payGooglePayRequest

Information needed to pay using Google Pay.

Returns:



38
39
40
# File 'lib/paypal_server_sdk/models/order_authorize_request_payment_source.rb', line 38

def google_pay
  @google_pay
end

#paypalPaypalWallet

A resource that identifies a PayPal Wallet is used for payment.

Returns:



30
31
32
# File 'lib/paypal_server_sdk/models/order_authorize_request_payment_source.rb', line 30

def paypal
  @paypal
end

#tokenToken

The tokenized payment source to fund a payment.

Returns:



26
27
28
# File 'lib/paypal_server_sdk/models/order_authorize_request_payment_source.rb', line 26

def token
  @token
end

#venmoVenmoWalletRequest

Information needed to pay using Venmo.

Returns:



42
43
44
# File 'lib/paypal_server_sdk/models/order_authorize_request_payment_source.rb', line 42

def venmo
  @venmo
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/paypal_server_sdk/models/order_authorize_request_payment_source.rb', line 84

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

.namesObject

A mapping from model property names to API property names.



45
46
47
48
49
50
51
52
53
54
# File 'lib/paypal_server_sdk/models/order_authorize_request_payment_source.rb', line 45

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

.nullablesObject

An array for nullable fields



69
70
71
# File 'lib/paypal_server_sdk/models/order_authorize_request_payment_source.rb', line 69

def self.nullables
  []
end

.optionalsObject

An array for optional fields



57
58
59
60
61
62
63
64
65
66
# File 'lib/paypal_server_sdk/models/order_authorize_request_payment_source.rb', line 57

def self.optionals
  %w[
    card
    token
    paypal
    apple_pay
    google_pay
    venmo
  ]
end