Skip to content

Commit bf6ee07

Browse files
committed
use a boolean switch to decide if we should serialize
1 parent ab259e0 commit bf6ee07

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/Mailchimp.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ private static function requestAccessToken($oauth_string)
295295
{
296296
$request = self::getStaticRequest();
297297
$request->setMethod("POST");
298-
$request->setPayload($oauth_string);
298+
$request->setPayload($oauth_string, false);
299299
$request->setBaseUrl(MailchimpConnection::TOKEN_REQUEST_URL);
300300

301301
$connection = self::getStaticConnection($request);

src/Requests/MailchimpRequest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,11 +265,12 @@ public function setAuth()
265265
/**
266266
* Sets the payload for a request
267267
* @param mixed $payload
268+
* @param boolean $shouldSerialize
268269
* @throws MailchimpException when cant serialize payload
269270
*/
270-
public function setPayload($payload)
271+
public function setPayload($payload, $shouldSerialize = true))
271272
{
272-
if (is_array($payload)) {
273+
if ($shouldSerialize) {
273274
$payload = $this->serializePayload($payload);
274275
}
275276
$this->payload = $payload;

0 commit comments

Comments
 (0)