Card.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace Stripe\Error;
  3. class Card extends Base
  4. {
  5. public function __construct(
  6. $message,
  7. $stripeParam,
  8. $stripeCode,
  9. $httpStatus,
  10. $httpBody,
  11. $jsonBody,
  12. $httpHeaders = null
  13. ) {
  14. parent::__construct($message, $httpStatus, $httpBody, $jsonBody, $httpHeaders);
  15. $this->stripeParam = $stripeParam;
  16. $this->stripeCode = $stripeCode;
  17. // This one is not like the others because it was added later and we're
  18. // trying to do our best not to change the public interface of this class'
  19. // constructor. We should consider changing its implementation on the
  20. // next major version bump of this library.
  21. $this->declineCode = isset($jsonBody["error"]["decline_code"]) ? $jsonBody["error"]["decline_code"] : null;
  22. }
  23. public function getDeclineCode()
  24. {
  25. return $this->declineCode;
  26. }
  27. public function getStripeCode()
  28. {
  29. return $this->stripeCode;
  30. }
  31. public function getStripeParam()
  32. {
  33. return $this->stripeParam;
  34. }
  35. }