0 Replies - 729 Views - Last Post: 30 July 2019 - 05:50 AM Rate Topic: -----

#1 Petro Gromovo   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 14-February 19

How read paypal plans with different state

Posted 30 July 2019 - 05:50 AM

Hello,
Looking at this doc http://paypal.github.../ListPlans.html
in my laravel 5.8 app using "paypal/rest-api-sdk-php": "*",
I read all my paypal plans with :
        $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 :
    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;
    }


I tried to set state parameter to return all paypal plans, like :
        $params   = array('page_size' => '20', 'state'=>'ACTIVE');
        $planList = Plan::all($params, $this->apiContext);
        return $planList;

but failed, anyway only
State = “CREATED”

are returned?

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

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

Thanks!

Is This A Good Question/Topic? 0
  • +

Page 1 of 1