abstract class USPSRequest in Commerce USPS 8
USPS API Service.
@package Drupal\commerce_usps
Hierarchy
- class \Drupal\commerce_usps\USPSRequest implements USPSRequestInterface
Expanded class hierarchy of USPSRequest
File
- src/
USPSRequest.php, line 10
Namespace
Drupal\commerce_uspsView source
abstract class USPSRequest implements USPSRequestInterface {
/**
* The configuration array from a CommerceShippingMethod.
*
* @var array
*/
protected $configuration;
/**
* {@inheritdoc}
*/
public function setConfig(array $configuration) {
$this->configuration = $configuration;
}
/**
* Returns authentication array for a request.
*
* @return array
* An array of authentication parameters.
*/
protected function getAuth() {
return [
'user_id' => $this->configuration['api_information']['user_id'],
'password' => $this->configuration['api_information']['password'],
];
}
/**
* Determines if the shipping method is in test method..
*
* @return bool
* Returns TRUE if we're in test mode.
*/
protected function isTestMode() {
return $this->configuration['api_information']['mode'] == 'test';
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
USPSRequest:: |
protected | property | The configuration array from a CommerceShippingMethod. | 1 |
USPSRequest:: |
protected | function | Returns authentication array for a request. | |
USPSRequest:: |
protected | function | Determines if the shipping method is in test method.. | |
USPSRequest:: |
public | function |
Set the request configuration. Overrides USPSRequestInterface:: |
1 |