From 840fa20428ac5c7905a70edb6f1b594c936401f1 Mon Sep 17 00:00:00 2001 From: Raza Mehdi Date: Wed, 4 Jan 2017 16:05:45 +0500 Subject: [PATCH] Fix response error for IPN --- src/Traits/PayPalRequest.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Traits/PayPalRequest.php b/src/Traits/PayPalRequest.php index 7aa37674..06fd1927 100644 --- a/src/Traits/PayPalRequest.php +++ b/src/Traits/PayPalRequest.php @@ -306,14 +306,19 @@ private function doPayPalRequest($method, $params) /** * Parse PayPal NVP Response. * - * @param string $string + * @param string|\GuzzleHttp\Psr7\Request $request * * @return array */ - private function retrieveData($string) + private function retrieveData($request) { $response = []; - parse_str($string, $response); + + if ($request instanceof \GuzzleHttp\Psr7\Request) { + $request = \GuzzleHttp\Psr7\Str($request); + } + + parse_str($request, $response); return $response; }