1 <?php
2
3 namespace PayPal\Api;
4
5 use PayPal\Common\PayPalModel;
6
7 /**
8 * Class FundingSource
9 *
10 * specifies the funding source details.
11 *
12 * @package PayPal\Api
13 *
14 * @property string funding_mode
15 * @property string funding_instrument_type
16 * @property string soft_descriptor
17 * @property \PayPal\Api\Currency amount
18 * @property \PayPal\Api\Currency negative_balance_amount
19 * @property string legal_text
20 * @property \PayPal\Api\FundingDetail funding_detail
21 * @property string additional_text
22 * @property \PayPal\Api\Links[] links
23 */
24 class FundingSource extends FundingInstrument
25 {
26 /**
27 * specifies funding mode of the instrument
28 * Valid Values: ["INSTANT_TRANSFER", "MANUAL_BANK_TRANSFER", "DELAYED_TRANSFER", "ECHECK", "PAY_UPON_INVOICE"]
29 *
30 * @param string $funding_mode
31 *
32 * @return $this
33 */
34 public function setFundingMode($funding_mode)
35 {
36 $this->funding_mode = $funding_mode;
37 return $this;
38 }
39
40 /**
41 * specifies funding mode of the instrument
42 *
43 * @return string
44 */
45 public function getFundingMode()
46 {
47 return $this->funding_mode;
48 }
49
50 /**
51 * Instrument type for this funding source
52 * Valid Values: ["BALANCE", "PAYMENT_CARD", "BANK_ACCOUNT", "CREDIT", "INCENTIVE", "EXTERNAL_FUNDING", "TAB"]
53 *
54 * @param string $funding_instrument_type
55 *
56 * @return $this
57 */
58 public function setFundingInstrumentType($funding_instrument_type)
59 {
60 $this->funding_instrument_type = $funding_instrument_type;
61 return $this;
62 }
63
64 /**
65 * Instrument type for this funding source
66 *
67 * @return string
68 */
69 public function getFundingInstrumentType()
70 {
71 return $this->funding_instrument_type;
72 }
73
74 /**
75 * Soft descriptor used when charging this funding source.
76 *
77 * @param string $soft_descriptor
78 *
79 * @return $this
80 */
81 public function setSoftDescriptor($soft_descriptor)
82 {
83 $this->soft_descriptor = $soft_descriptor;
84 return $this;
85 }
86
87 /**
88 * Soft descriptor used when charging this funding source.
89 *
90 * @return string
91 */
92 public function getSoftDescriptor()
93 {
94 return $this->soft_descriptor;
95 }
96
97 /**
98 * Total anticipated amount of money to be pulled from instrument.
99 *
100 * @param \PayPal\Api\Currency $amount
101 *
102 * @return $this
103 */
104 public function setAmount($amount)
105 {
106 $this->amount = $amount;
107 return $this;
108 }
109
110 /**
111 * Total anticipated amount of money to be pulled from instrument.
112 *
113 * @return \PayPal\Api\Currency
114 */
115 public function getAmount()
116 {
117 return $this->amount;
118 }
119
120 /**
121 * Additional amount to be pulled from the instrument to recover a negative balance on the buyer's account that is owed to PayPal.
122 *
123 * @param \PayPal\Api\Currency $negative_balance_amount
124 *
125 * @return $this
126 */
127 public function setNegativeBalanceAmount($negative_balance_amount)
128 {
129 $this->negative_balance_amount = $negative_balance_amount;
130 return $this;
131 }
132
133 /**
134 * Additional amount to be pulled from the instrument to recover a negative balance on the buyer's account that is owed to PayPal.
135 *
136 * @return \PayPal\Api\Currency
137 */
138 public function getNegativeBalanceAmount()
139 {
140 return $this->negative_balance_amount;
141 }
142
143 /**
144 * Localized legal text relevant to funding source.
145 *
146 * @param string $legal_text
147 *
148 * @return $this
149 */
150 public function setLegalText($legal_text)
151 {
152 $this->legal_text = $legal_text;
153 return $this;
154 }
155
156 /**
157 * Localized legal text relevant to funding source.
158 *
159 * @return string
160 */
161 public function getLegalText()
162 {
163 return $this->legal_text;
164 }
165
166 /**
167 * Additional detail of the funding.
168 *
169 * @param \PayPal\Api\FundingDetail $funding_detail
170 *
171 * @return $this
172 */
173 public function setFundingDetail($funding_detail)
174 {
175 $this->funding_detail = $funding_detail;
176 return $this;
177 }
178
179 /**
180 * Additional detail of the funding.
181 *
182 * @return \PayPal\Api\FundingDetail
183 */
184 public function getFundingDetail()
185 {
186 return $this->funding_detail;
187 }
188
189 /**
190 * Additional text relevant to funding source.
191 *
192 * @param string $additional_text
193 *
194 * @return $this
195 */
196 public function setAdditionalText($additional_text)
197 {
198 $this->additional_text = $additional_text;
199 return $this;
200 }
201
202 /**
203 * Additional text relevant to funding source.
204 *
205 * @return string
206 */
207 public function getAdditionalText()
208 {
209 return $this->additional_text;
210 }
211
212 /**
213 * Sets Extends
214 *
215 * @param \PayPal\Api\FundingInstrument $extends
216 *
217 * @deprecated Unused
218 *
219 * @return $this
220 */
221 public function setExtends($extends)
222 {
223 $this->extends = $extends;
224 return $this;
225 }
226
227 /**
228 * Gets Extends
229 *
230 * @deprecated Unused
231 *
232 * @return \PayPal\Api\FundingInstrument
233 */
234 public function getExtends()
235 {
236 return $this->extends;
237 }
238
239 /**
240 * Sets Links
241 *
242 * @param \PayPal\Api\Links[] $links
243 *
244 * @return $this
245 */
246 public function setLinks($links)
247 {
248 $this->links = $links;
249 return $this;
250 }
251
252 /**
253 * Gets Links
254 *
255 * @return \PayPal\Api\Links[]
256 */
257 public function getLinks()
258 {
259 return $this->links;
260 }
261
262 /**
263 * Append Links to the list.
264 *
265 * @param \PayPal\Api\Links $links
266 * @return $this
267 */
268 public function addLink($links)
269 {
270 if (!$this->getLinks()) {
271 return $this->setLinks(array($links));
272 } else {
273 return $this->setLinks(
274 array_merge($this->getLinks(), array($links))
275 );
276 }
277 }
278
279 /**
280 * Remove Links from the list.
281 *
282 * @param \PayPal\Api\Links $links
283 * @return $this
284 */
285 public function removeLink($links)
286 {
287 return $this->setLinks(
288 array_diff($this->getLinks(), array($links))
289 );
290 }
291
292 }
293