Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions src/PaypalIPN.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

use \Exception;

class PaypalIPN
{
class PaypalIPN {

/** @var bool $useSandbox Indicates if the sandbox endpoint is used. */
private $useSandbox = false;
/** @var bool $useLocalCerts Indicates if the local certificates are used. */
Expand All @@ -28,8 +28,7 @@ class PaypalIPN
* should not be enabled in production).
* @return void
*/
public function useSandbox()
{
public function useSandbox() {
$this->useSandbox = true;
}

Expand All @@ -38,8 +37,7 @@ public function useSandbox()
* environments).
* @return void
*/
public function usePHPCerts()
{
public function usePHPCerts() {
$this->useLocalCerts = false;
}

Expand All @@ -48,8 +46,7 @@ public function usePHPCerts()
* Determine endpoint to post the verification data to.
* @return string
*/
public function getPaypalUri()
{
public function getPaypalUri() {
if ($this->useSandbox) {
return self::SANDBOX_VERIFY_URI;
} else {
Expand All @@ -65,8 +62,7 @@ public function getPaypalUri()
* @return bool
* @throws Exception
*/
function verifyIPN()
{
public function verifyIPN() {
if (!count($_POST)) {
throw new Exception("Missing POST Data");
}
Expand Down Expand Up @@ -135,4 +131,3 @@ function verifyIPN()
}
}
}