public function PayPalCheckoutClient::__construct in Commerce PayPal 7.2
Constructs a new PayPalCheckoutClient object.
Parameters
array $config: An associative array containing at least the following keys:
- client_id: The client ID.
- secret: The client secret.
- server: ("sandbox"|"live").
string $logger: A callable used to log API request / response messages. Leave empty if logging is not needed.
File
- modules/
checkout/ lib/ PayPalCheckoutClient.php, line 50 - Defines a class for consuming the PayPal Checkout API.
Class
- PayPalCheckoutClient
- Defines the PayPalCheckoutClient class.
Code
public function __construct($config, $logger = NULL) {
$this->config = $config;
$this->logger = $logger;
$this->retryCount = 0;
$this->headers = array(
'Accept' => 'application/json',
// Defaults the "Content-Type" header to application/json.
'Content-Type' => 'application/json',
'PayPal-Partner-Attribution-Id' => 'CommerceGuys_Cart_SPB',
);
}