Payer.php 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. <?php
  2. namespace PayPal\Api;
  3. use PayPal\Common\PayPalModel;
  4. /**
  5. * Class Payer
  6. *
  7. * A resource representing a Payer that funds a payment.
  8. *
  9. * @package PayPal\Api
  10. *
  11. * @property string payment_method
  12. * @property string status
  13. * @property \PayPal\Api\FundingInstrument[] funding_instruments
  14. * @property string external_selected_funding_instrument_type
  15. * @property \PayPal\Api\PayerInfo payer_info
  16. */
  17. class Payer extends PayPalModel
  18. {
  19. /**
  20. * Payment method being used - PayPal Wallet payment, Bank Direct Debit or Direct Credit card.
  21. * Valid Values: ["credit_card", "bank", "paypal", "pay_upon_invoice", "carrier", "alternate_payment"]
  22. *
  23. * @param string $payment_method
  24. *
  25. * @return $this
  26. */
  27. public function setPaymentMethod($payment_method)
  28. {
  29. $this->payment_method = $payment_method;
  30. return $this;
  31. }
  32. /**
  33. * Payment method being used - PayPal Wallet payment, Bank Direct Debit or Direct Credit card.
  34. *
  35. * @return string
  36. */
  37. public function getPaymentMethod()
  38. {
  39. return $this->payment_method;
  40. }
  41. /**
  42. * Status of payer's PayPal Account.
  43. * Valid Values: ["VERIFIED", "UNVERIFIED"]
  44. *
  45. * @param string $status
  46. *
  47. * @return $this
  48. */
  49. public function setStatus($status)
  50. {
  51. $this->status = $status;
  52. return $this;
  53. }
  54. /**
  55. * Status of payer's PayPal Account.
  56. *
  57. * @return string
  58. */
  59. public function getStatus()
  60. {
  61. return $this->status;
  62. }
  63. /**
  64. * Type of account relationship payer has with PayPal.
  65. * Valid Values: ["BUSINESS", "PERSONAL", "PREMIER"]
  66. * @deprecated Not publicly available
  67. * @param string $account_type
  68. *
  69. * @return $this
  70. */
  71. public function setAccountType($account_type)
  72. {
  73. $this->account_type = $account_type;
  74. return $this;
  75. }
  76. /**
  77. * Type of account relationship payer has with PayPal.
  78. * @deprecated Not publicly available
  79. * @return string
  80. */
  81. public function getAccountType()
  82. {
  83. return $this->account_type;
  84. }
  85. /**
  86. * Duration since the payer established account relationship with PayPal in days.
  87. * @deprecated Not publicly available
  88. * @param string $account_age
  89. *
  90. * @return $this
  91. */
  92. public function setAccountAge($account_age)
  93. {
  94. $this->account_age = $account_age;
  95. return $this;
  96. }
  97. /**
  98. * Duration since the payer established account relationship with PayPal in days.
  99. * @deprecated Not publicly available
  100. * @return string
  101. */
  102. public function getAccountAge()
  103. {
  104. return $this->account_age;
  105. }
  106. /**
  107. * 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.
  108. *
  109. * @param \PayPal\Api\FundingInstrument[] $funding_instruments
  110. *
  111. * @return $this
  112. */
  113. public function setFundingInstruments($funding_instruments)
  114. {
  115. $this->funding_instruments = $funding_instruments;
  116. return $this;
  117. }
  118. /**
  119. * 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.
  120. *
  121. * @return \PayPal\Api\FundingInstrument[]
  122. */
  123. public function getFundingInstruments()
  124. {
  125. return $this->funding_instruments;
  126. }
  127. /**
  128. * Append FundingInstruments to the list.
  129. *
  130. * @param \PayPal\Api\FundingInstrument $fundingInstrument
  131. * @return $this
  132. */
  133. public function addFundingInstrument($fundingInstrument)
  134. {
  135. if (!$this->getFundingInstruments()) {
  136. return $this->setFundingInstruments(array($fundingInstrument));
  137. } else {
  138. return $this->setFundingInstruments(
  139. array_merge($this->getFundingInstruments(), array($fundingInstrument))
  140. );
  141. }
  142. }
  143. /**
  144. * Remove FundingInstruments from the list.
  145. *
  146. * @param \PayPal\Api\FundingInstrument $fundingInstrument
  147. * @return $this
  148. */
  149. public function removeFundingInstrument($fundingInstrument)
  150. {
  151. return $this->setFundingInstruments(
  152. array_diff($this->getFundingInstruments(), array($fundingInstrument))
  153. );
  154. }
  155. /**
  156. * 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.
  157. * @deprecated Not publicly available
  158. * @param string $funding_option_id
  159. *
  160. * @return $this
  161. */
  162. public function setFundingOptionId($funding_option_id)
  163. {
  164. $this->funding_option_id = $funding_option_id;
  165. return $this;
  166. }
  167. /**
  168. * 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.
  169. * @deprecated Not publicly available
  170. * @return string
  171. */
  172. public function getFundingOptionId()
  173. {
  174. return $this->funding_option_id;
  175. }
  176. /**
  177. * Default funding option available for the payment
  178. * @deprecated Not publicly available
  179. * @param \PayPal\Api\FundingOption $funding_option
  180. *
  181. * @return $this
  182. */
  183. public function setFundingOption($funding_option)
  184. {
  185. $this->funding_option = $funding_option;
  186. return $this;
  187. }
  188. /**
  189. * Default funding option available for the payment
  190. * @deprecated Not publicly available
  191. * @return \PayPal\Api\FundingOption
  192. */
  193. public function getFundingOption()
  194. {
  195. return $this->funding_option;
  196. }
  197. /**
  198. * 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
  199. * Valid Values: ["CREDIT", "PAY_UPON_INVOICE"]
  200. *
  201. * @param string $external_selected_funding_instrument_type
  202. *
  203. * @return $this
  204. */
  205. public function setExternalSelectedFundingInstrumentType($external_selected_funding_instrument_type)
  206. {
  207. $this->external_selected_funding_instrument_type = $external_selected_funding_instrument_type;
  208. return $this;
  209. }
  210. /**
  211. * 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
  212. *
  213. * @return string
  214. */
  215. public function getExternalSelectedFundingInstrumentType()
  216. {
  217. return $this->external_selected_funding_instrument_type;
  218. }
  219. /**
  220. * Funding option related to default funding option.
  221. * @deprecated Not publicly available
  222. * @param \PayPal\Api\FundingOption $related_funding_option
  223. *
  224. * @return $this
  225. */
  226. public function setRelatedFundingOption($related_funding_option)
  227. {
  228. $this->related_funding_option = $related_funding_option;
  229. return $this;
  230. }
  231. /**
  232. * Funding option related to default funding option.
  233. * @deprecated Not publicly available
  234. * @return \PayPal\Api\FundingOption
  235. */
  236. public function getRelatedFundingOption()
  237. {
  238. return $this->related_funding_option;
  239. }
  240. /**
  241. * Information related to the Payer.
  242. *
  243. * @param \PayPal\Api\PayerInfo $payer_info
  244. *
  245. * @return $this
  246. */
  247. public function setPayerInfo($payer_info)
  248. {
  249. $this->payer_info = $payer_info;
  250. return $this;
  251. }
  252. /**
  253. * Information related to the Payer.
  254. *
  255. * @return \PayPal\Api\PayerInfo
  256. */
  257. public function getPayerInfo()
  258. {
  259. return $this->payer_info;
  260. }
  261. }