File tree Expand file tree Collapse file tree 3 files changed +14
-5
lines changed Expand file tree Collapse file tree 3 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,11 @@ public function getData()
5252
5353 public function getEndpoint ()
5454 {
55- return $ this ->endpoint .'/subscriptions/ ' .$ this ->getSubscriptionReference ();
55+ return $ this ->getCustomerReference () ?
56+ $ this ->endpoint
57+ .'/customers/ ' .$ this ->getCustomerReference ()
58+ .'/subscriptions/ ' .$ this ->getSubscriptionReference () :
59+ $ this ->endpoint .'/subscriptions/ ' .$ this ->getSubscriptionReference ();
5660 }
5761
5862 public function getHttpMethod ()
Original file line number Diff line number Diff line change @@ -36,15 +36,17 @@ public function setSubscriptionReference($value)
3636
3737 public function getData ()
3838 {
39- $ this ->validate ('customerReference ' , ' subscriptionReference ' );
39+ $ this ->validate ('subscriptionReference ' );
4040
4141 return array ();
4242 }
4343
4444 public function getEndpoint ()
4545 {
46- return $ this ->endpoint .'/customers/ ' .$ this ->getCustomerReference ()
47- .'/subscriptions/ ' .$ this ->getSubscriptionReference ();
46+ return $ this ->getCustomerReference () ?
47+ $ this ->endpoint .'/customers/ ' .$ this ->getCustomerReference ()
48+ .'/subscriptions/ ' .$ this ->getSubscriptionReference () :
49+ $ this ->endpoint .'/subscriptions/ ' .$ this ->getSubscriptionReference ();
4850 }
4951
5052 public function getHttpMethod ()
Original file line number Diff line number Diff line change @@ -99,6 +99,9 @@ public function getData()
9999
100100 public function getEndpoint ()
101101 {
102- return $ this ->endpoint .'/subscriptions/ ' .$ this ->getSubscriptionReference ();
102+ return $ this ->getCustomerReference () ?
103+ $ this ->endpoint .'/customers/ ' .$ this ->getCustomerReference ()
104+ .'/subscriptions/ ' .$ this ->getSubscriptionReference () :
105+ $ this ->endpoint .'/subscriptions/ ' .$ this ->getSubscriptionReference ();
103106 }
104107}
You can’t perform that action at this time.
0 commit comments