Created
July 20, 2018 03:36
-
-
Save ChubV/4ff26be4605d1fc0630eed702879407e to your computer and use it in GitHub Desktop.
NotifyUrl workaround
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$agreement = new HackAgreement(); | |
// ... | |
$agreement->create($apiContext); | |
//////////// | |
use PayPal\Api\Agreement; | |
class HackAgreement extends Agreement | |
{ | |
/** | |
* Plan details for this agreement. | |
* | |
* @return \HackNamespace\HackPlan | |
*/ | |
public function getPlan() | |
{ | |
return parent::getPlan(); | |
} | |
} | |
//////////// | |
use PayPal\Api\Plan; | |
class HackPlan extends Plan | |
{ | |
/** | |
* Specific preferences such as: set up fee, max fail attempts, autobill amount, and others that are configured for this billing plan. | |
* | |
* @return \HackNamespace\HackMerch | |
*/ | |
public function getMerchantPreferences() | |
{ | |
return parent::getMerchantPreferences(); // TODO: Change the autogenerated stub | |
} | |
} | |
//////////// | |
use PayPal\Api\MerchantPreferences; | |
class HackMerch extends MerchantPreferences | |
{ | |
public function setNotifyUrl($notifyUrl) | |
{ | |
if (!$notifyUrl) { | |
return $this; | |
} | |
return parent::setNotifyUrl($notifyUrl); | |
} | |
public function setCancelUrl($notifyUrl) | |
{ | |
if (!$notifyUrl) { | |
return $this; | |
} | |
return parent::setCancelUrl($notifyUrl); | |
} | |
public function setReturnUrl($notifyUrl) | |
{ | |
if (!$notifyUrl) { | |
return $this; | |
} | |
return parent::setReturnUrl($notifyUrl); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment