From 137adbc707ed914121f3b725860498315e3cc35e Mon Sep 17 00:00:00 2001 From: Olivier Bellone Date: Thu, 4 Apr 2019 23:24:35 -0700 Subject: [PATCH] Fix encoding of nested parameters in multipart requests --- lib/File.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/File.php b/lib/File.php index ae4253d539..c4d3b68a7f 100644 --- a/lib/File.php +++ b/lib/File.php @@ -50,6 +50,9 @@ public static function create($params = null, $options = null) if (is_null($opts->apiBase)) { $opts->apiBase = Stripe::$apiUploadBase; } + // Manually flatten params, otherwise curl's multipart encoder will + // choke on nested arrays. + $params = array_column(\Stripe\Util\Util::flattenParams($params), 1, 0); return static::_create($params, $opts); } }