How read paypal plans with different state

petrogromovo
Contributor
Contributor


Hello,
Looking at this doc http://paypal.github.io/PayPal-PHP-SDK/sample/doc/billing/ListPlans.html
in my laravel 5.8 app using "paypal/rest-api-sdk-php": "*",
I read all my paypal plans with :

 

  1. $params = array('page_size' => '20');
    $planList = Plan::all($params, $this->apiContext);

    I read all paypal plans with

 

State = “CREATED”


But paypal plans which were activated before are not in lists above:

In file : vendor/paypal/rest-api-sdk-php/lib/PayPal/Api/Plan.php
I see function :

 

  1. public static function all($params, $apiContext = null, $restCall = null)
    {
    ArgumentValidator::validate($params, 'params');
    $payLoad = "";
    $allowedParams = array(
    'page_size' => 1,
    'status' => 1,
    'page' => 1,
    'total_required' => 1
    );
    $json = self::executeCall(
    "/v1/payments/billing-plans/" . "?" . http_build_query(array_intersect_key($params, $allowedParams)),
    "GET",
    $payLoad,
    null,
    $apiContext,
    $restCall
    );
    $ret = new PlanList();
    $ret->fromJson($json);
    return $ret;
    }


  2. I tried to set state parameter to return all paypal plans, like :

 

  1. $params = array('page_size' => '20', 'state'=>'ACTIVE');
    $planList = Plan::all($params, $this->apiContext);
    return $planList;

 

but failed, anyway only


  1. State = “CREATED”
  2.  

are returned?

How to get listing of all paypal plans ( or only activated ) ?

Thanks!

Login to Me Too
1 REPLY 1

petrogromovo
Contributor
Contributor

Also looking at paypal doc https://developer.paypal.com/docs/api/overview/#list-plans
I do not see any filter state options. Any idea ?

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.