Skip to content

Instantly share code, notes, and snippets.

@ChubV ChubV/Paypal.php
Created Jul 20, 2018

Embed
What would you like to do?
NotifyUrl workaround
<?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
You can’t perform that action at this time.