You are here

public function PayPalCheckoutClient::baseUrl in Commerce PayPal 7.2

Returns the base URL for the API, based on the specified mode.

Return value

string The base URL for the API that query parameters will be appended to when submitting API requests.

2 calls to PayPalCheckoutClient::baseUrl()
PayPalCheckoutClient::acquireAccessToken in modules/checkout/lib/PayPalCheckoutClient.php
Acquire an access token from PayPal.
PayPalCheckoutClient::submitRequest in modules/checkout/lib/PayPalCheckoutClient.php
Submits an API request to the PayPal server.

File

modules/checkout/lib/PayPalCheckoutClient.php, line 94
Defines a class for consuming the PayPal Checkout API.

Class

PayPalCheckoutClient
Defines the PayPalCheckoutClient class.

Code

public function baseUrl() {
  switch ($this->config['server']) {
    case 'live':
      return 'https://api.paypal.com';
    case 'sandbox':
    default:
      return 'https://api.sandbox.paypal.com';
  }
}