Changeset View
Changeset View
Standalone View
Standalone View
externals/stripe-php/lib/Stripe.php
| <?php | <?php | ||||
| // Tested on PHP 5.2, 5.3 | // Tested on PHP 5.2, 5.3 | ||||
| // This snippet (and some of the curl code) due to the Facebook SDK. | // This snippet (and some of the curl code) due to the Facebook SDK. | ||||
| if (!function_exists('curl_init')) { | if (!function_exists('curl_init')) { | ||||
| throw new Exception('Stripe needs the CURL PHP extension.'); | throw new Exception('Stripe needs the CURL PHP extension.'); | ||||
| } | } | ||||
| if (!function_exists('json_decode')) { | if (!function_exists('json_decode')) { | ||||
| throw new Exception('Stripe needs the JSON PHP extension.'); | throw new Exception('Stripe needs the JSON PHP extension.'); | ||||
| } | } | ||||
| if (!function_exists('mb_detect_encoding')) { | |||||
| throw new Exception('Stripe needs the Multibyte String PHP extension.'); | |||||
| abstract class Stripe | |||||
| { | |||||
| public static $apiKey; | |||||
| public static $apiBase = 'https://api.stripe.com/v1'; | |||||
| public static $verifySslCerts = true; | |||||
| const VERSION = '1.6.3'; | |||||
| public static function getApiKey() | |||||
| { | |||||
| return self::$apiKey; | |||||
| } | |||||
| public static function setApiKey($apiKey) | |||||
| { | |||||
| self::$apiKey = $apiKey; | |||||
| } | |||||
| public static function getVerifySslCerts() { | |||||
| return self::$verifySslCerts; | |||||
| } | |||||
| public static function setVerifySslCerts($verify) { | |||||
| self::$verifySslCerts = $verify; | |||||
| } | |||||
| } | } | ||||
| // Stripe singleton | |||||
| require(dirname(__FILE__) . '/Stripe/Stripe.php'); | |||||
| // Utilities | // Utilities | ||||
| require(dirname(__FILE__) . '/Stripe/Util.php'); | require(dirname(__FILE__) . '/Stripe/Util.php'); | ||||
| require(dirname(__FILE__) . '/Stripe/Util/Set.php'); | require(dirname(__FILE__) . '/Stripe/Util/Set.php'); | ||||
| // Errors | // Errors | ||||
| require(dirname(__FILE__) . '/Stripe/Error.php'); | require(dirname(__FILE__) . '/Stripe/Error.php'); | ||||
| require(dirname(__FILE__) . '/Stripe/ApiError.php'); | require(dirname(__FILE__) . '/Stripe/ApiError.php'); | ||||
| require(dirname(__FILE__) . '/Stripe/ApiConnectionError.php'); | require(dirname(__FILE__) . '/Stripe/ApiConnectionError.php'); | ||||
| require(dirname(__FILE__) . '/Stripe/AuthenticationError.php'); | require(dirname(__FILE__) . '/Stripe/AuthenticationError.php'); | ||||
| require(dirname(__FILE__) . '/Stripe/CardError.php'); | require(dirname(__FILE__) . '/Stripe/CardError.php'); | ||||
| require(dirname(__FILE__) . '/Stripe/InvalidRequestError.php'); | require(dirname(__FILE__) . '/Stripe/InvalidRequestError.php'); | ||||
| require(dirname(__FILE__) . '/Stripe/RateLimitError.php'); | |||||
| // Plumbing | // Plumbing | ||||
| require(dirname(__FILE__) . '/Stripe/Object.php'); | require(dirname(__FILE__) . '/Stripe/Object.php'); | ||||
| require(dirname(__FILE__) . '/Stripe/ApiRequestor.php'); | require(dirname(__FILE__) . '/Stripe/ApiRequestor.php'); | ||||
| require(dirname(__FILE__) . '/Stripe/ApiResource.php'); | require(dirname(__FILE__) . '/Stripe/ApiResource.php'); | ||||
| require(dirname(__FILE__) . '/Stripe/SingletonApiResource.php'); | |||||
| require(dirname(__FILE__) . '/Stripe/AttachedObject.php'); | |||||
| require(dirname(__FILE__) . '/Stripe/List.php'); | |||||
| // Stripe API Resources | // Stripe API Resources | ||||
| require(dirname(__FILE__) . '/Stripe/Account.php'); | |||||
| require(dirname(__FILE__) . '/Stripe/Card.php'); | |||||
| require(dirname(__FILE__) . '/Stripe/Balance.php'); | |||||
| require(dirname(__FILE__) . '/Stripe/BalanceTransaction.php'); | |||||
| require(dirname(__FILE__) . '/Stripe/Charge.php'); | require(dirname(__FILE__) . '/Stripe/Charge.php'); | ||||
| require(dirname(__FILE__) . '/Stripe/Customer.php'); | require(dirname(__FILE__) . '/Stripe/Customer.php'); | ||||
| require(dirname(__FILE__) . '/Stripe/Invoice.php'); | require(dirname(__FILE__) . '/Stripe/Invoice.php'); | ||||
| require(dirname(__FILE__) . '/Stripe/InvoiceItem.php'); | require(dirname(__FILE__) . '/Stripe/InvoiceItem.php'); | ||||
| require(dirname(__FILE__) . '/Stripe/Plan.php'); | require(dirname(__FILE__) . '/Stripe/Plan.php'); | ||||
| require(dirname(__FILE__) . '/Stripe/Subscription.php'); | |||||
| require(dirname(__FILE__) . '/Stripe/Token.php'); | require(dirname(__FILE__) . '/Stripe/Token.php'); | ||||
| require(dirname(__FILE__) . '/Stripe/Coupon.php'); | require(dirname(__FILE__) . '/Stripe/Coupon.php'); | ||||
| require(dirname(__FILE__) . '/Stripe/Event.php'); | require(dirname(__FILE__) . '/Stripe/Event.php'); | ||||
| No newline at end of file | require(dirname(__FILE__) . '/Stripe/Transfer.php'); | ||||
| require(dirname(__FILE__) . '/Stripe/Recipient.php'); | |||||
| require(dirname(__FILE__) . '/Stripe/Refund.php'); | |||||
| require(dirname(__FILE__) . '/Stripe/ApplicationFee.php'); | |||||