Beispiel #1
0
 /**
  * CardException constructor.
  *
  * @param  string       $message
  * @param  int          $code
  * @param  string|null  $type
  * @param  string|null  $stripeCode
  * @param  string|null  $httpBody
  * @param  array        $jsonBody
  * @param  array        $params
  * @param  array        $headers
  */
 public function __construct($message, $code, $type, $stripeCode, $httpBody, array $jsonBody, array $params = [], array $headers = [])
 {
     parent::__construct($message, $code, $type, $stripeCode, $httpBody, $jsonBody, $params, $headers);
     // This one is not like the others because it was added later and we're trying to do our best
     // not to change the public interface of this class' constructor.
     // We should consider changing its implementation on the next major version bump of this library.
     $this->setDeclineCode(isset($jsonBody['error']['decline_code']) ? $jsonBody['error']['decline_code'] : null);
 }
 /**
  * {@inheritDoc}
  */
 public function __construct()
 {
     parent::__construct('You have reached the Stripe Api rate limit!');
 }
Beispiel #3
0
 /**
  * API Exception Constructor.
  *
  * @param  string       $message
  * @param  int          $code
  * @param  string|null  $type
  * @param  string|null  $stripeCode
  * @param  string|null  $httpBody
  * @param  array        $jsonBody
  * @param  array        $params
  * @param  array        $headers
  */
 public function __construct($message, $code = 500, $type = 'api_error', $stripeCode = null, $httpBody = null, $jsonBody = [], $params = [], $headers = [])
 {
     parent::__construct($message, $code, $type, $stripeCode, $httpBody, $jsonBody, $params, $headers);
 }