Class: PaypalServerSdk::PaymentSourceResponse

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

Overview

The payment source used to fund the payment.

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, paypal: SKIP, bancontact: SKIP, blik: SKIP, eps: SKIP, giropay: SKIP, ideal: SKIP, mybank: SKIP, p24: SKIP, sofort: SKIP, trustly: SKIP, apple_pay: SKIP, google_pay: SKIP, venmo: SKIP) ⇒ PaymentSourceResponse

Returns a new instance of PaymentSourceResponse.



114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# File 'lib/paypal_server_sdk/models/payment_source_response.rb', line 114

def initialize(card: SKIP, paypal: SKIP, bancontact: SKIP, blik: SKIP,
               eps: SKIP, giropay: SKIP, ideal: SKIP, mybank: SKIP,
               p24: SKIP, sofort: SKIP, trustly: SKIP, apple_pay: SKIP,
               google_pay: SKIP, venmo: SKIP)
  @card = card unless card == SKIP
  @paypal = paypal unless paypal == SKIP
  @bancontact = bancontact unless bancontact == SKIP
  @blik = blik unless blik == SKIP
  @eps = eps unless eps == SKIP
  @giropay = giropay unless giropay == SKIP
  @ideal = ideal unless ideal == SKIP
  @mybank = mybank unless mybank == SKIP
  @p24 = p24 unless p24 == SKIP
  @sofort = sofort unless sofort == SKIP
  @trustly = trustly unless trustly == 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_payApplePayPaymentObject

Information needed to pay using ApplePay.



59
60
61
# File 'lib/paypal_server_sdk/models/payment_source_response.rb', line 59

def apple_pay
  @apple_pay
end

#bancontactBancontactPaymentObject

Information used to pay Bancontact.



23
24
25
# File 'lib/paypal_server_sdk/models/payment_source_response.rb', line 23

def bancontact
  @bancontact
end

#blikBLIKPaymentObject

Information used to pay using BLIK.

Returns:



27
28
29
# File 'lib/paypal_server_sdk/models/payment_source_response.rb', line 27

def blik
  @blik
end

#cardCardResponse

The payment card to use to fund a payment. Card can be a credit or debit card.

Returns:



15
16
17
# File 'lib/paypal_server_sdk/models/payment_source_response.rb', line 15

def card
  @card
end

#epsEPSPaymentObject

Information used to pay using eps.

Returns:



31
32
33
# File 'lib/paypal_server_sdk/models/payment_source_response.rb', line 31

def eps
  @eps
end

#giropayGiropayPaymentObject

Information needed to pay using giropay.



35
36
37
# File 'lib/paypal_server_sdk/models/payment_source_response.rb', line 35

def giropay
  @giropay
end

#google_payGooglePayWalletResponse

Google Pay Wallet payment data.



63
64
65
# File 'lib/paypal_server_sdk/models/payment_source_response.rb', line 63

def google_pay
  @google_pay
end

#idealIDEALPaymentObject

Information used to pay using iDEAL.

Returns:



39
40
41
# File 'lib/paypal_server_sdk/models/payment_source_response.rb', line 39

def ideal
  @ideal
end

#mybankMyBankPaymentObject

Information used to pay using MyBank.

Returns:



43
44
45
# File 'lib/paypal_server_sdk/models/payment_source_response.rb', line 43

def mybank
  @mybank
end

#p24P24PaymentObject

Information used to pay using P24(Przelewy24).

Returns:



47
48
49
# File 'lib/paypal_server_sdk/models/payment_source_response.rb', line 47

def p24
  @p24
end

#paypalPayPalWalletResponse

The PayPal Wallet response.



19
20
21
# File 'lib/paypal_server_sdk/models/payment_source_response.rb', line 19

def paypal
  @paypal
end

#sofortSofortPaymentObject

Information used to pay using Sofort.

Returns:



51
52
53
# File 'lib/paypal_server_sdk/models/payment_source_response.rb', line 51

def sofort
  @sofort
end

#trustlyTrustlyPaymentObject

Information needed to pay using Trustly.



55
56
57
# File 'lib/paypal_server_sdk/models/payment_source_response.rb', line 55

def trustly
  @trustly
end

#venmoVenmoWalletResponse

Venmo wallet response.

Returns:



67
68
69
# File 'lib/paypal_server_sdk/models/payment_source_response.rb', line 67

def venmo
  @venmo
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# File 'lib/paypal_server_sdk/models/payment_source_response.rb', line 135

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  card = CardResponse.from_hash(hash['card']) if hash['card']
  paypal = PayPalWalletResponse.from_hash(hash['paypal']) if hash['paypal']
  bancontact = BancontactPaymentObject.from_hash(hash['bancontact']) if hash['bancontact']
  blik = BLIKPaymentObject.from_hash(hash['blik']) if hash['blik']
  eps = EPSPaymentObject.from_hash(hash['eps']) if hash['eps']
  giropay = GiropayPaymentObject.from_hash(hash['giropay']) if hash['giropay']
  ideal = IDEALPaymentObject.from_hash(hash['ideal']) if hash['ideal']
  mybank = MyBankPaymentObject.from_hash(hash['mybank']) if hash['mybank']
  p24 = P24PaymentObject.from_hash(hash['p24']) if hash['p24']
  sofort = SofortPaymentObject.from_hash(hash['sofort']) if hash['sofort']
  trustly = TrustlyPaymentObject.from_hash(hash['trustly']) if hash['trustly']
  apple_pay = ApplePayPaymentObject.from_hash(hash['apple_pay']) if hash['apple_pay']
  google_pay = GooglePayWalletResponse.from_hash(hash['google_pay']) if hash['google_pay']
  venmo = VenmoWalletResponse.from_hash(hash['venmo']) if hash['venmo']

  # Create object from extracted values.
  PaymentSourceResponse.new(card: card,
                            paypal: paypal,
                            bancontact: bancontact,
                            blik: blik,
                            eps: eps,
                            giropay: giropay,
                            ideal: ideal,
                            mybank: mybank,
                            p24: p24,
                            sofort: sofort,
                            trustly: trustly,
                            apple_pay: apple_pay,
                            google_pay: google_pay,
                            venmo: venmo)
end

.namesObject

A mapping from model property names to API property names.



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/paypal_server_sdk/models/payment_source_response.rb', line 70

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['card'] = 'card'
  @_hash['paypal'] = 'paypal'
  @_hash['bancontact'] = 'bancontact'
  @_hash['blik'] = 'blik'
  @_hash['eps'] = 'eps'
  @_hash['giropay'] = 'giropay'
  @_hash['ideal'] = 'ideal'
  @_hash['mybank'] = 'mybank'
  @_hash['p24'] = 'p24'
  @_hash['sofort'] = 'sofort'
  @_hash['trustly'] = 'trustly'
  @_hash['apple_pay'] = 'apple_pay'
  @_hash['google_pay'] = 'google_pay'
  @_hash['venmo'] = 'venmo'
  @_hash
end

.nullablesObject

An array for nullable fields



110
111
112
# File 'lib/paypal_server_sdk/models/payment_source_response.rb', line 110

def self.nullables
  []
end

.optionalsObject

An array for optional fields



90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/paypal_server_sdk/models/payment_source_response.rb', line 90

def self.optionals
  %w[
    card
    paypal
    bancontact
    blik
    eps
    giropay
    ideal
    mybank
    p24
    sofort
    trustly
    apple_pay
    google_pay
    venmo
  ]
end