Stripe,PHP api警告:urlencode()要求参数1为字符串,给定对象


Stripe, PHP api Warning: urlencode() expects parameter 1 to be string, object given

我正在使用stripe gateway和他们最新的php-api:

      'Stripe'Stripe::setApiKey($stripe['secret_key']);
      try {
        //Create a token
        $token = 'Stripe'Token::create(array("card" => array(
                "name" => Client Name",
                "number" => 4242424242424242,
                "exp_month" => 12,
                "exp_year" => 2018,
                "cvc" => 123,
                )));
        //Create a client
        $client = 'Stripe'Customer::create(array(
            "description" => "John Doe",
            "source" => $token['id'],
            ));
        //Charge client
        $charge = 'Stripe'Charge::create(array(
            "amount" => round(1.99 * 100, 0),
            "currency" => "USD",
            "customer" => $client['id'],
            "description" => "Membership Access"
            ));
      }
      catch ('Stripe'Error'Card $e) {
           $e->getJsonBody();
      }

一切都很好,客户端在我的条纹仪表板中创建,费用也在那里,但我一直收到警告:urlender()希望参数1是字符串,对象在''lib''HttpClient''CurlClient.php的292行

这可能是由于传递对象作为customer参数而不是字符串ID。