Skip to content

Commit 41d8605

Browse files
authored
Merge pull request #54 from mmorrisson/master
Add option to not serialize payload.
2 parents 984caae + ef34c3e commit 41d8605

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/Mailchimp.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,15 +287,15 @@ public static function oauthExchange(
287287
}
288288

289289
/**
290-
* @param $oath_string
290+
* @param $oauth_string
291291
* @return mixed
292292
* @throws MailchimpException
293293
*/
294-
private static function requestAccessToken($oath_string)
294+
private static function requestAccessToken($oauth_string)
295295
{
296296
$request = self::getStaticRequest();
297297
$request->setMethod("POST");
298-
$request->setPayload($oath_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: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,11 +265,14 @@ 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-
$payload = $this->serializePayload($payload);
273+
if ($shouldSerialize) {
274+
$payload = $this->serializePayload($payload);
275+
}
273276
$this->payload = $payload;
274277
}
275278

0 commit comments

Comments
 (0)