Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wp-content/plugins/woocommerce-gateway-klarna/vendor/klarna/checkout/src/Klarna/Checkout/BasicConnector.php
- protected function verifyResponse(Klarna_Checkout_HTTP_Response $result)
- {
- // Error Status Code recieved. Throw an exception.
- if ($result->getStatus() >= 400 && $result->getStatus() <= 599) {
- $json = json_decode($result->getData(), true);
- $payload = ($json && is_array($json)) ? $json : array();
- var_dump($result->getStatus(), $payload);
- throw new Klarna_Checkout_ApiErrorException(
- "API Error", $result->getStatus(), $payload
- );
- }
- }
- Is not throwing status code and payload message
- Its class chain inheritance chain below (from last to processor):
- <?php
- /**
- * Copyright 2015 Klarna AB
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * File containing the Klarna_Checkout_ConnectorException class
- *
- * PHP version 5.3
- *
- * @category Payment
- * @package Klarna_Checkout
- * @author Klarna <[email protected]>
- * @copyright 2015 Klarna AB
- * @license http://www.apache.org/licenses/LICENSE-2.0 Apache license v2.0
- * @link http://developers.klarna.com/
- */
- /**
- * Api Error exception
- *
- * @category Payment
- * @package Klarna_Checkout
- * @author Matthias Feist <[email protected]>
- * @copyright 2015 Klarna AB
- * @license http://www.apache.org/licenses/LICENSE-2.0 Apache license v2.0
- * @link http://developers.klarna.com/
- */
- class Klarna_Checkout_ApiErrorException extends Klarna_Checkout_Exception
- {
- /**
- * Payload of the error
- *
- * @var array
- */
- protected $payload = array();
- /**
- * Custom contructor
- *
- * @param string $message Error message
- * @param int $code Error code
- * @param Array $payload Payload
- * @param Exception $previous Previous Exception
- */
- public function __construct(
- $message,
- $code,
- Array $payload = array(),
- Exception $previous = null
- ) {
- parent::__construct($message, $code, $previous);
- $this->payload = $payload;
- }
- /**
- * Gets the payload
- *
- * @return array
- */
- public function getPayload()
- {
- return $this->payload;
- }
- }
- <?php
- /**
- * Copyright 2015 Klarna AB
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * File containing the Klarna_Checkout_Exception class
- *
- * PHP version 5.3
- *
- * @category Payment
- * @package Klarna_Checkout
- * @author Klarna <[email protected]>
- * @copyright 2015 Klarna AB
- * @license http://www.apache.org/licenses/LICENSE-2.0 Apache license v2.0
- * @link http://developers.klarna.com/
- */
- /**
- * Basic exception class
- *
- * @category Payment
- * @package Klarna_Checkout
- * @author Majid G. <[email protected]>
- * @author David K. <[email protected]>
- * @copyright 2015 Klarna AB
- * @license http://www.apache.org/licenses/LICENSE-2.0 Apache license v2.0
- * @link http://developers.klarna.com/
- */
- class Klarna_Checkout_Exception extends Exception
- {
- }
- Core_c.php
- class Exception implements Throwable {
- protected $message;
- protected $code;
- protected $file;
- protected $line;
- /**
- * Clone the exception
- * @link http://php.net/manual/en/exception.clone.php
- * @return void
- * @since 5.1.0
- */
- final private function __clone() { }
- /**
- * Construct the exception. Note: The message is NOT binary safe.
- * @link http://php.net/manual/en/exception.construct.php
- * @param string $message [optional] The Exception message to throw.
- * @param int $code [optional] The Exception code.
- * @param Exception $previous [optional] The previous exception used for the exception chaining. Since 5.3.0
- * @since 5.1.0
- */
- public function __construct($message = "", $code = 0, Exception $previous = null) { }
- ...
Advertisement
Add Comment
Please, Sign In to add comment