ApiOperations/Request.php

stripe-php · lib/ApiOperations/Request.php · php · MIT
payments

Stripe PHP trait providing request helpers for API resources, handling auth, pagination, and errors.

// Source: https://github.com/stripe/stripe-php | License: MIT | Copyright 2010-2019 Stripe, Inc. (https://stripe.com)
// Provided via justclaw.it.com; keep this notice with the code.
<?php

namespace Stripe\ApiOperations;

/**
 * Trait for resources that need to make API requests.
 *
 * This trait should only be applied to classes that derive from StripeObject.
 */
trait Request
{
    /**
     * @param null|array|mixed $params The list of parameters to validate
     *
     * @throws \Stripe\Exception\InvalidArgumentException if $params exists and is not an array
     */
    protected static function _validateParams($params = null)
    {
        if ($params && !\is_array($params)) {
            $message = 'You must pass an array as the first argument to Stripe API '
                . 'meth

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key