1 <?php
2
3 namespace PayPal\Api;
4
5 use PayPal\Common\PayPalModel;
6 use PayPal\Validation\UrlValidator;
7
8 /**
9 * Class RedirectUrls
10 *
11 * Set of redirect URLs you provide only for PayPal-based payments.
12 *
13 * @package PayPal\Api
14 *
15 * @property string return_url
16 * @property string cancel_url
17 */
18 class RedirectUrls extends PayPalModel
19 {
20 /**
21 * Url where the payer would be redirected to after approving the payment. **Required for PayPal account payments.**
22 *
23 * @param string $return_url
24 * @throws \InvalidArgumentException
25 * @return $this
26 */
27 public function setReturnUrl($return_url)
28 {
29 UrlValidator::validate($return_url, "ReturnUrl");
30 $this->return_url = $return_url;
31 return $this;
32 }
33
34 /**
35 * Url where the payer would be redirected to after approving the payment. **Required for PayPal account payments.**
36 *
37 * @return string
38 */
39 public function getReturnUrl()
40 {
41 return $this->return_url;
42 }
43
44 /**
45 * Url where the payer would be redirected to after canceling the payment. **Required for PayPal account payments.**
46 *
47 * @param string $cancel_url
48 * @throws \InvalidArgumentException
49 * @return $this
50 */
51 public function setCancelUrl($cancel_url)
52 {
53 UrlValidator::validate($cancel_url, "CancelUrl");
54 $this->cancel_url = $cancel_url;
55 return $this;
56 }
57
58 /**
59 * Url where the payer would be redirected to after canceling the payment. **Required for PayPal account payments.**
60 *
61 * @return string
62 */
63 public function getCancelUrl()
64 {
65 return $this->cancel_url;
66 }
67
68 }
69