Commit 01085177 authored by jsacksick's avatar jsacksick

Issue #3043091 by jsacksick: Create a PayPalCheckoutClient PHP library.

parent 1c5001db
......@@ -7,3 +7,7 @@ dependencies[] = commerce_payment
dependencies[] = commerce_paypal
dependencies[] = commerce_order
core = 7.x
; PayPal library files.
files[] = lib/PayPalCheckoutClient.php
files[] = lib/PayPalCheckoutExceptions.php
This diff is collapsed.
<?php
/**
* @file
* Defines exception classes for use by the PayPalCheckoutClient class.
*/
class PayPalCheckoutAuthenticationException extends PayPalCheckoutHttpException {}
/**
* Defines a base class for HTTP response related exceptions.
*
* If an HTTP exception is thrown, the exception's code SHOULD correspond to the
* status code of the response that generated the exception.
*/
class PayPalCheckoutHttpException extends \Exception {
/**
* Supplies a default message if none was supplied.
*/
public function __construct($message = '', $code = 0, \Exception $previous = NULL) {
if (empty($message)) {
$message = '';
if (!empty($code)) {
$message .= $code . ' ';
}
$message .= 'HTTP response status code not OK.';
}
parent::__construct($message, $code, $previous);
}
}
class PayPalCheckoutHttpServerErrorException extends PayPalCheckoutHttpException {}
class PayPalCheckoutHttpClientErrorException extends PayPalCheckoutHttpException {}
class PayPalCheckoutHttpRedirectionException extends PayPalCheckoutHttpException {}
class PayPalCheckoutInvalidResponseJsonException extends \Exception {}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment