From 52c01532d0b61c9f7fca3963be766149129189fd Mon Sep 17 00:00:00 2001 From: Jon Waldstein Date: Fri, 28 Jul 2023 08:17:58 -0400 Subject: [PATCH] docs: add since tag and descriptions --- .../PaymentGateways/Traits/HandleHttpResponses.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Framework/PaymentGateways/Traits/HandleHttpResponses.php b/src/Framework/PaymentGateways/Traits/HandleHttpResponses.php index a3735e682d..d57e4af889 100644 --- a/src/Framework/PaymentGateways/Traits/HandleHttpResponses.php +++ b/src/Framework/PaymentGateways/Traits/HandleHttpResponses.php @@ -11,6 +11,7 @@ trait HandleHttpResponses /** * Handle Response * + * @unreleased add support for multipart/form-data content-type * @since 2.27.0 add support for json content-type * @since 2.18.0 * @@ -62,6 +63,11 @@ public function handleExceptionResponse(\Exception $exception, string $message) } /** + * This checks the server content-type to determine how to respond. + * + * v2 GiveWP forms uses content-type application/x-www-form-urlencoded + * v3 GiveWP forms uses content-type application/json and/or multipart/form-data + * * @unreleased * * @return bool @@ -71,7 +77,7 @@ protected function shouldSendAsJson(): bool if (!isset($_SERVER['CONTENT_TYPE'])) { return false; } - + $contentType = isset($_SERVER['CONTENT_TYPE']); return str_contains($contentType, "application/json") || str_contains($contentType, "multipart/form-data");