This repository has been archived by the owner on Sep 29, 2023. It is now read-only.
/
Payer.php
288 lines (263 loc) · 7.65 KB
/
Payer.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
<?php
namespace PayPal\Api;
use PayPal\Common\PayPalModel;
/**
* Class Payer
*
* A resource representing a Payer that funds a payment.
*
* @package PayPal\Api
*
* @property string payment_method
* @property string status
* @property \PayPal\Api\FundingInstrument[] funding_instruments
* @property string external_selected_funding_instrument_type
* @property \PayPal\Api\PayerInfo payer_info
*/
class Payer extends PayPalModel
{
/**
* Payment method being used. "credit_card" is not available for general use.
* Please ensure that you have acquired the approval for using "credit_card" for your live
* credentials.
* Valid Values: ["credit_card", "paypal"]
*
* @param string $payment_method
*
* @return $this
*/
public function setPaymentMethod($payment_method)
{
$this->payment_method = $payment_method;
return $this;
}
/**
* Payment method being used - PayPal Wallet payment, Bank Direct Debit or Direct Credit card.
*
* @return string
*/
public function getPaymentMethod()
{
return $this->payment_method;
}
/**
* Status of payer's PayPal Account.
* Valid Values: ["VERIFIED", "UNVERIFIED"]
*
* @param string $status
*
* @return $this
*/
public function setStatus($status)
{
$this->status = $status;
return $this;
}
/**
* Status of payer's PayPal Account.
*
* @return string
*/
public function getStatus()
{
return $this->status;
}
/**
* Type of account relationship payer has with PayPal.
* Valid Values: ["BUSINESS", "PERSONAL", "PREMIER"]
* @deprecated Not publicly available
* @param string $account_type
*
* @return $this
*/
public function setAccountType($account_type)
{
$this->account_type = $account_type;
return $this;
}
/**
* Type of account relationship payer has with PayPal.
* @deprecated Not publicly available
* @return string
*/
public function getAccountType()
{
return $this->account_type;
}
/**
* Duration since the payer established account relationship with PayPal in days.
* @deprecated Not publicly available
* @param string $account_age
*
* @return $this
*/
public function setAccountAge($account_age)
{
$this->account_age = $account_age;
return $this;
}
/**
* Duration since the payer established account relationship with PayPal in days.
* @deprecated Not publicly available
* @return string
*/
public function getAccountAge()
{
return $this->account_age;
}
/**
* List of funding instruments to fund the payment. 'OneOf' funding_instruments,funding_option_id to be used to identify the specifics of payment method passed.
*
* @param \PayPal\Api\FundingInstrument[] $funding_instruments
*
* @return $this
*/
public function setFundingInstruments($funding_instruments)
{
$this->funding_instruments = $funding_instruments;
return $this;
}
/**
* List of funding instruments to fund the payment. 'OneOf' funding_instruments,funding_option_id to be used to identify the specifics of payment method passed.
*
* @return \PayPal\Api\FundingInstrument[]
*/
public function getFundingInstruments()
{
return $this->funding_instruments;
}
/**
* Append FundingInstruments to the list.
*
* @param \PayPal\Api\FundingInstrument $fundingInstrument
* @return $this
*/
public function addFundingInstrument($fundingInstrument)
{
if (!$this->getFundingInstruments()) {
return $this->setFundingInstruments(array($fundingInstrument));
} else {
return $this->setFundingInstruments(
array_merge($this->getFundingInstruments(), array($fundingInstrument))
);
}
}
/**
* Remove FundingInstruments from the list.
*
* @param \PayPal\Api\FundingInstrument $fundingInstrument
* @return $this
*/
public function removeFundingInstrument($fundingInstrument)
{
return $this->setFundingInstruments(
array_diff($this->getFundingInstruments(), array($fundingInstrument))
);
}
/**
* Id of user selected funding option for the payment.'OneOf' funding_instruments,funding_option_id to be used to identify the specifics of payment method passed.
* @deprecated Not publicly available
* @param string $funding_option_id
*
* @return $this
*/
public function setFundingOptionId($funding_option_id)
{
$this->funding_option_id = $funding_option_id;
return $this;
}
/**
* Id of user selected funding option for the payment.'OneOf' funding_instruments,funding_option_id to be used to identify the specifics of payment method passed.
* @deprecated Not publicly available
* @return string
*/
public function getFundingOptionId()
{
return $this->funding_option_id;
}
/**
* Default funding option available for the payment
* @deprecated Not publicly available
* @param \PayPal\Api\FundingOption $funding_option
*
* @return $this
*/
public function setFundingOption($funding_option)
{
$this->funding_option = $funding_option;
return $this;
}
/**
* Default funding option available for the payment
* @deprecated Not publicly available
* @return \PayPal\Api\FundingOption
*/
public function getFundingOption()
{
return $this->funding_option;
}
/**
* Instrument type pre-selected by the user outside of PayPal and passed along the payment creation. This param is used in cases such as PayPal Credit Second Button
* Valid Values: ["CREDIT", "PAY_UPON_INVOICE"]
*
* @param string $external_selected_funding_instrument_type
*
* @return $this
*/
public function setExternalSelectedFundingInstrumentType($external_selected_funding_instrument_type)
{
$this->external_selected_funding_instrument_type = $external_selected_funding_instrument_type;
return $this;
}
/**
* Instrument type pre-selected by the user outside of PayPal and passed along the payment creation. This param is used in cases such as PayPal Credit Second Button
*
* @return string
*/
public function getExternalSelectedFundingInstrumentType()
{
return $this->external_selected_funding_instrument_type;
}
/**
* Funding option related to default funding option.
* @deprecated Not publicly available
* @param \PayPal\Api\FundingOption $related_funding_option
*
* @return $this
*/
public function setRelatedFundingOption($related_funding_option)
{
$this->related_funding_option = $related_funding_option;
return $this;
}
/**
* Funding option related to default funding option.
* @deprecated Not publicly available
* @return \PayPal\Api\FundingOption
*/
public function getRelatedFundingOption()
{
return $this->related_funding_option;
}
/**
* Information related to the Payer.
*
* @param \PayPal\Api\PayerInfo $payer_info
*
* @return $this
*/
public function setPayerInfo($payer_info)
{
$this->payer_info = $payer_info;
return $this;
}
/**
* Information related to the Payer.
*
* @return \PayPal\Api\PayerInfo
*/
public function getPayerInfo()
{
return $this->payer_info;
}
}