Skip to content

Commit

Permalink
docs: add since tag and descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Waldstein committed Jul 28, 2023
1 parent 57b0975 commit 52c0153
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Framework/PaymentGateways/Traits/HandleHttpResponses.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down Expand Up @@ -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
Expand All @@ -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");
Expand Down

0 comments on commit 52c0153

Please sign in to comment.