PayPal\Api\CreditCard::all PHP Method

all() public static method

Retrieves a list of Credit Card resources.
public static all ( array $params, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : PayPal\Api\CreditCardList
$params array
$apiContext PayPal\Rest\ApiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
$restCall PayPal\Transport\PayPalRestCall is the Rest Call Service that is used to make rest calls
return PayPal\Api\CreditCardList
    public static function all($params, $apiContext = null, $restCall = null)
    {
        if (is_null($params)) {
            $params = array();
        }
        ArgumentValidator::validate($params, 'params');
        $payLoad = "";
        $allowedParams = array('page_size' => 1, 'page' => 1, 'start_time' => 1, 'end_time' => 1, 'sort_order' => 1, 'sort_by' => 1, 'merchant_id' => 1, 'external_card_id' => 1, 'external_customer_id' => 1, 'total_required' => 1);
        $json = self::executeCall("/v1/vault/credit-cards" . "?" . http_build_query(array_intersect_key($params, $allowedParams)), "GET", $payLoad, null, $apiContext, $restCall);
        $ret = new CreditCardList();
        $ret->fromJson($json);
        return $ret;
    }

Usage Example

 public function getAll($sortBy = CreditCardConst::SORT_BY_CREATE_TIME, $sortOrder = CreditCardConst::SORT_ORDER_DESC)
 {
     $apiContext = $this->connectionService->getApiContext();
     $dispatcher = $this->connectionService->getDispatcher();
     $dispatcher->dispatch(CreditCardEvent::GET_ALL_START);
     $params = array('sort_by' => $sortBy, 'sort_order' => $sortOrder);
     $cards = CreditCard::all($params, $apiContext);
     $dispatcher->dispatch(CreditCardEvent::GET_ALL_END);
     return $cards;
 }
All Usage Examples Of PayPal\Api\CreditCard::all