You are here

protected static function StripePaymentMethodController::loadLibrary in Stripe 7

Ensure the Stripe API library is loaded.

This method is intended to be invoked fron __constructor() and __wakeup() to ensure the Stripe API is loaded before the controller is used. Avoiding the need to load the Stripe API in every method.

Throws

Exception If the Stripe API library can not be loaded.

2 calls to StripePaymentMethodController::loadLibrary()
StripePaymentMethodController::__construct in stripe_payment/includes/StripePaymentMethodController.inc
Public constructor.
StripePaymentMethodController::__wakeup in stripe_payment/includes/StripePaymentMethodController.inc
Wakeup.

File

stripe_payment/includes/StripePaymentMethodController.inc, line 87
Stripe Payment controller class and helper code (classes and function).

Class

StripePaymentMethodController

Code

protected static function loadLibrary() {
  if (!stripe_load_library()) {
    throw new Exception('Cannot load Stripe PHP Library.');
  }
}