PPPStripeErrorBase

The Gravity Forms + Stripe PPP Stripe Error Base class.

Defined (1)

The class is defined in the following location(s).

/includes/api/stripe-php/lib/Error/Base.php  
  1. abstract class Base extends Exception 
  2. public function __construct( 
  3. $message,  
  4. $httpStatus = null,  
  5. $httpBody = null,  
  6. $jsonBody = null,  
  7. $httpHeaders = null 
  8. ) { 
  9. parent::__construct($message); 
  10. $this->httpStatus = $httpStatus; 
  11. $this->httpBody = $httpBody; 
  12. $this->jsonBody = $jsonBody; 
  13. $this->httpHeaders = $httpHeaders; 
  14. $this->requestId = null; 
  15.  
  16. if ($httpHeaders && isset($httpHeaders['Request-Id'])) { 
  17. $this->requestId = $httpHeaders['Request-Id']; 
  18.  
  19. public function getHttpStatus() 
  20. return $this->httpStatus; 
  21.  
  22. public function getHttpBody() 
  23. return $this->httpBody; 
  24.  
  25. public function getJsonBody() 
  26. return $this->jsonBody; 
  27.  
  28. public function getHttpHeaders() 
  29. return $this->httpHeaders; 
  30.  
  31. public function getRequestId() 
  32. return $this->requestId; 
  33.  
  34. public function __toString() 
  35. $id = $this->requestId ? " from API request '{$this->requestId}'": ""; 
  36. $message = explode("\n", parent::__toString()); 
  37. $message[0] .= $id; 
  38. return implode("\n", $message);