sentence1 stringlengths 52 3.87M | sentence2 stringlengths 1 47.2k | label stringclasses 1
value |
|---|---|---|
public function setTextStyle($text_style, Document $document = NULL) {
$class = 'ChapterThree\AppleNewsAPI\Document\Styles\ComponentTextStyle';
if (is_string($text_style)) {
// Check that text_style exists.
if ($document &&
empty($document->getComponentTextStyles()[$text_style])
) {
... | Setter for textStyle.
@param \ChapterThree\AppleNewsAPI\Document\Styles\ComponentTextStyle|string $text_style
Either a ComponentTextStyle object, or a string reference to one defined
in $document.
@param \ChapterThree\AppleNewsAPI\Document|NULL $document
If required by first parameter.
@return $this | entailment |
public function setTop($top) {
if (!$this->isSupportedUnit($top)) {
$this->triggerError("Value \"${top}\" does not use a supported unit.");
}
else {
$this->top = $top;
}
return $this;
} | Setter for top.
@param string $top
Top.
@return $this | entailment |
public function setBottom($bottom) {
if (!$this->isSupportedUnit($bottom)) {
$this->triggerError("Value \"${bottom}\" does not use a supported unit.");
}
else {
$this->bottom = $bottom;
}
return $this;
} | Setter for bottom.
@param mixed $bottom
Bottom.
@return $this | entailment |
public function setRegion($region)
{
$this->region = strtolower($region);
$this->updateApiUrl($region);
$this->updateApiAccessTokenUrl($region);
return $this;
} | Set region
@param string $region region
@return $this | entailment |
public function getAccessToken()
{
if (null === $this->accessTokens) {
$this->accessTokens = [];
}
if (!array_key_exists($this->getRegion(), $this->accessTokens)) {
$this->accessTokens[$this->getRegion()] = $this->requestAccessToken();
}
return $this... | Get access token
@return null|string Access token | entailment |
private function updateApiUrl($region)
{
$this->apiUrl = str_replace('region', strtolower($region), self::API_URL_PATTERN);
return $this;
} | Update API url
Update API url by replacing region in API url pattern
@param string $region Region
@return $this | entailment |
private function updateApiAccessTokenUrl($region)
{
$this->apiAccessTokenUrl = str_replace('region', strtolower($region), self::API_ACCESS_TOKEN_URL_PATTERN);
return $this;
} | Update API Access Token url
Update API Access Token url by replacing region in API url pattern
@param string $region Region
@return $this | entailment |
private function configureOptions(OptionsResolver $resolver, $region)
{
if (isset(GeoData::$list[$region])) {
$locales = GeoData::$list[$region];
} else {
throw new InvalidOptionsException(
sprintf(
'The option "region" with value "%s" is i... | Configure options
@param OptionsResolver $resolver Symfony options resolver
@param string $region Region
@throws InvalidOptionsException | entailment |
protected function requestAccessToken()
{
$options = [
'form_params' => [
'grant_type' => 'client_credentials',
'client_id' => $this->getApiKey(),
'client_secret' => $this->getApiSecret(),
],
];
$result = (new Cl... | Request an Access Token from Blizzard
@return Access
@throws \HttpResponseException | entailment |
public static function setCACertPath($path)
{
if (!file_exists($path)) {
throw new PaysafeException('Invalid CA cert path: ' . $path);
}
self::$caCertPath = realpath($path);
} | Set the path to the root CA certificate for use with cURL
@param string $path
@throws PaysafeException if path is invalid | entailment |
private function getPaysafeException($httpCode, $message = null, $code = null)
{
if(!$message) {
$message = "An unknown error has occurred.";
}
if(!$code) {
$code = $httpCode;
}
$exceptionType = '\Paysafe\PaysafeException';
switch($httpCode) {... | Return the correct exception type based on http code
@param type $httpCode
@param type $message
@param type $code
@return PaysafeException | entailment |
public function getSeasonById($id, array $options = [])
{
$options['access_token'] = $this->blizzardClient->getAccessToken();
return $this->request('/data/d3/season/'.(int) $id, $options);
} | Get season by ID
Returns a leaderboard list for a particular season
@param int $id The season to lookup
@param array $options Options
@return ResponseInterface | entailment |
public function getSeasonLeaderboardById($id, $leaderboard, array $options = [])
{
$options['access_token'] = $this->blizzardClient->getAccessToken();
return $this->request('/data/d3/season/'.(int) $id.'/leaderboard/'.(string) $leaderboard, $options);
} | Get season leaderboard by ID and leaderboard
Returns a leaderboard list for a particular season
@param int $id The season to lookup
@param string $leaderboard The leaderboard to lookup, you can find these strings in the Season API call
@param array $options Options
@return ResponseInterface | entailment |
public function getEraIndexById($id, array $options = [])
{
$options['access_token'] = $this->blizzardClient->getAccessToken();
return $this->request('/data/d3/era/'.(int) $id, $options);
} | Get era index by ID
Returns a leaderboard list for a particular era
@param int $id The era to lookup
@param array $options Options
@return ResponseInterface | entailment |
public function enrollmentChecks( ThreeDSecure\ThreeDEnrollment $enrollmentchecks )
{
$enrollmentchecks->setRequiredFields(array(
'merchantRefNum',
'amount',
'currency',
'card',
'customerIp',
'userAgent',
'acceptHeader',
... | Submit an Enrollment lookup Request
@param \Paysafe\ThreeDSecure\ThreeDEnrollment $enrollmentchecks
@return \Paysafe\ThreeDSecure\ThreeDEnrollment
@throws PaysafeException | entailment |
public function getenrollmentChecks( ThreeDSecure\ThreeDEnrollment $enrollmentchecks )
{
$enrollmentchecks->setRequiredFields(array(
'id'
));
$enrollmentchecks->checkRequiredFields();
$request = new Request(array(
'method' => Request::GET,
'uri' =>... | Look Up an Enrollment Lookup Using an ID
@param \Paysafe\ThreeDSecure\ThreeDEnrollment $enrollmentchecks
@return \Paysafe\ThreeDSecure\ThreeDEnrollment
@throws PaysafeException | entailment |
public function authentications( ThreeDSecure\Authentications $authentications )
{
$authentications->setRequiredFields(array(
'merchantRefNum',
'paRes'
));
$authentications->checkRequiredFields();
$request = new Request(array(
'method' => Request::... | Submit an Authentications Request
@param \Paysafe\ThreeDSecure\Authentications $authentications
@return \Paysafe\ThreeDSecure\Authentications
@throws PaysafeException | entailment |
public function getAuthentication( ThreeDSecure\Authentications $authentications )
{
$authentications->checkRequiredFields();
$request = new Request(array(
'method' => Request::GET,
'uri' => $this->prepareURI("/authentications/" . $authentications->id),
'body' => ... | Look Up an Authentication Using an ID
@param \Paysafe\ThreeDSecure\Authentications $authentications
@return \Paysafe\ThreeDSecure\Authentications
@throws PaysafeException | entailment |
public function getAuthentications( ThreeDSecure\Authentications $authentications,$enrollmentlookup )
{
$authentications->setRequiredFields(array('id'));
$authentications->checkRequiredFields();
$fields = array();
if ($enrollmentlookup)
{
$field... | Look Up an Authentication and Corresponding Enrollment Check
@param \Paysafe\ThreeDSecure\Authentications $authentications
@return \Paysafe\ThreeDSecure\Authentications
@throws PaysafeException | entailment |
public function jsonSerialize() {
$valid = (!isset($this->fillMode) ||
$this->validateFillMode($this->fillMode)) &&
(!isset($this->verticalAlignment) ||
$this->validateVerticalAlignment($this->verticalAlignment)) &&
(!isset($this->horizontalAlignment) ||
$this->validateHorizontal... | Implements JsonSerializable::jsonSerialize(). | entailment |
public static function escape($string) {
$escaped_chars = str_split(self::ESCAPED_CHARACTERS);
$escaped_chars_replace = array_map(function($char) {
return '\\' . $char;
}, $escaped_chars);
$string = str_replace($escaped_chars, $escaped_chars_replace, $string);
// Ignored whitespace.
return... | Escape Markdown special characters.
@param string $string
A string without any Markdown.
@return mixed
$string with any special characters escaped. | entailment |
public function convert($html) {
if (preg_match('/^\s*$/u', $html)) {
return '';
}
$html = '<html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8"></head>' . $html . '</body></html>';
$this->dom = new \DOMDocument();
if (!$this->dom->loadHTML($html)) {
return NULL... | Convert HTML to Apple News Markdown.
@param string $html
HTML to convert. Value is not validated, it is caller's responsibility
to validate.
@return string|NULL
Markdown representation of the HTML, or NULL if failed. | entailment |
protected function getBlocks($nodes) {
// Each completed block.
$blocks = array();
// Container for any top-level inline elements.
$block = '';
// Add a completed block to $blocks.
$add_block = function($string = NULL) use(&$blocks, &$block) {
if (preg_match('/\S/u', $block)) {
$bl... | Converts a \DOMNodeList into a series of Markdown blocks.
@param \DOMNodeList|array $nodes
DOM nodes.
@return array
Array of string Markdown blocks. | entailment |
protected function getBlock(\DOMElement $element) {
$block = '';
/** @var \DOMNode $node */
foreach ($element->childNodes as $node) {
switch ($node->nodeType) {
case XML_ELEMENT_NODE:
/** @var \DOMElement $node */
switch ($node->nodeName) {
// Explicitly handl... | Converts a DOM element into a single Markdown block.
Handles inline elements.
@param \DOMElement $element
The Node to transform.
@return string
A single Markdown block string. | entailment |
protected function getBlockList(\DOMElement $element) {
$lines = array();
$prefix = $element->nodeName == 'ol' ? ' 1. ' : ' - ';
// Markdown does not support definition lists, convert to ul.
if ($element->nodeName == 'dl') {
$newline = TRUE;
/** @var \DOMElement $child */
foreach ($ele... | Converts a list-type \DOMElement into a single Markdown block.
Note Apple markdown subset does not support nested lists.
@param \DOMElement $element
One of ul, ol, dl.
@return string
A single Markdown block string. | entailment |
protected function normalizeOptions()
{
// not allowed empty container
!$this->containerTag && $this->containerTag = 'div';
if(!isset($this->containerOptions['id']) || empty($this->containerOptions['id'])) {
$this->containerOptions['id'] = $this->getId();
}
} | Preparing some options for this widgets | entailment |
protected function registerClientScript()
{
$view = $this->getView();
SlickAsset::register($view);
$options = Json::encode($this->clientOptions);
$id = $this->containerOptions['id'];
$js[] = ";";
$js[] = "jQuery('#$id').slick($options);";
$view->register... | Register required scripts for the Slick plugin | entailment |
public function getComponentsFlattened() {
$components = [];
foreach ($this->getComponents() as $component) {
$components[] = $component;
if ($component instanceof ComponentNested) {
/** @var \ChapterThree\AppleNewsAPI\Document\Components\ComponentNested $component */
$descendants = ... | Gets nested components as a flattened list.
@return array
List of \ChapterThree\AppleNewsAPI\Document\Components\Component. | entailment |
public function addComponentTextStyle($name, ComponentTextStyle $component_text_style) {
$this->componentTextStyles[(string) $name] = $component_text_style;
return $this;
} | Setter for componentTextStyles.
@param mixed $name
Name.
@param ComponentTextStyle $component_text_style
ComponentTextStyle.
@return $this | entailment |
public function setAdvertisingSettings($value) {
if (is_object($value) && !$value instanceof AdvertisingSettings) {
$this->triggerError('Object not of type AdvertisingSettings');
}
else {
$this->advertisingSettings = $value;
}
return $this;
} | Setter for advertisingSettings.
@param AdvertisingSettings $value
@return $this | entailment |
public function addTextStyle($name, TextStyle $text_style) {
$this->textStyles[(string) $name] = $text_style;
return $this;
} | Setter for textStyles.
@param mixed $name
Name.
@param \ChapterThree\AppleNewsAPI\Document\Styles\TextStyle $text_style
TextStyle.
@return $this | entailment |
public function addComponentStyle($name, ComponentStyle $component_style) {
$this->componentStyles[(string) $name] = $component_style;
return $this;
} | Setter for componentStyles.
@param mixed $name
Name.
@param \ChapterThree\AppleNewsAPI\Document\Styles\ComponentStyle $component_style
ComponentStyle.
@return $this | entailment |
public function addComponentLayout($name, ComponentLayout $component_layout) {
$this->componentLayouts[(string) $name] = $component_layout;
return $this;
} | Setter for componentLayouts.
@param mixed $name
Name.
@param \ChapterThree\AppleNewsAPI\Document\Layouts\ComponentLayout $component_layout
ComponentLayout.
@return $this | entailment |
public function jsonSerialize() {
if (!isset($this->componentTextStyles['default'])) {
$msg = "Document must have at least a \"default\" ComponentTextStyle.";
$this->triggerError($msg);
return NULL;
}
return parent::jsonSerialize();
} | Implements JsonSerializable::jsonSerialize(). | entailment |
public function getProfile($id, $name, $region = '1', array $options = [])
{
return $this->request('/profile/'.(string) $id.'/'.(string) $region.'/'.(string) $name.'/', $options);
} | Get profile
This provides data about an individual SC2 profile
@param string $id The ID of the profile to retrieve
@param string $name The name of the profile to retrieve
@param string $region The region of the profile to retrieve
@param array $options Options
@return ResponseInterface | entailment |
public function getLadders($id, $name, $region = '1', array $options = [])
{
return $this->request('/profile/'.(string) $id.'/'.(string) $region.'/'.(string) $name.'/ladders', $options);
} | Get ladders
This provides data about an individual SC2 profile's ladders
@param string $id The ID of the profile to retrieve
@param string $name The name of the profile to retrieve
@param string $region The region of the profile to retrieve
@param array $options Options
@return ResponseInterface | entailment |
public function getMatchHistory($id, $name, $region = '1', array $options = [])
{
return $this->request('/profile/'.(string) $id.'/'.(string) $region.'/'.(string) $name.'/matches', $options);
} | Get match history
This provides data about an individual SC2 profile's match history
@param string $id The ID of the profile to retrieve
@param string $name The name of the profile to retrieve
@param string $region The region of the profile to retrieve
@param array $options Options
@return ResponseInterfac... | entailment |
public function getProfileUser($accessToken = null, array $options = [])
{
if (null === $accessToken) {
$options['access_token'] = $this->blizzardClient->getAccessToken();
} else {
$options['access_token'] = $accessToken;
}
return $this->request('/profile/use... | Get profile user
This provides data about the current logged in OAuth user's Sc2 profile
@param null|string $accessToken Authorized user access token
@param array $options Options
@return ResponseInterface | entailment |
public function jsonSerialize() {
// Define empty attribute values.
// @see http://php.net/manual/en/language.types.boolean.php#language.types.boolean.casting
$present = function($value) {
if ($value === NULL) {
return FALSE;
}
if (is_string($value)) {
return $value !== '';... | Implements JsonSerializable::jsonSerialize(). | entailment |
public function triggerError($message, $message_type = E_USER_NOTICE) {
$trace = debug_backtrace();
trigger_error($message . ' in ' . $trace[0]['file'] . ' on line ' .
$trace[0]['line'], $message_type);
} | Error handler.
@param string $message
Message.
@param int $message_type
Matching E_USER_ERROR|E_USER_WARNING|E_USER_NOTICE|E_USER_DEPRECATED. | entailment |
protected function parseResponse( $data ) {
if (!array_key_exists($this->arrayKey, $data)) {
throw new \Paysafe\PaysafeException('Missing array key from results');
}
foreach ($data[$this->arrayKey] as $row) {
array_push($this->results, new $this->class... | Parse the response for the result set and next page.
@param type $data
@throws PaysafeException | entailment |
public function hasComponentType($class_name) {
/** @var \ChapterThree\AppleNewsAPI\Document\Components\Component $comp */
foreach ($this->components as $comp) {
if ($comp instanceof $class_name) {
return TRUE;
}
if ($comp instanceof ComponentNested) {
/** @var \ChapterThree\Ap... | Component has a child of a certain type. | entailment |
public function jsonSerialize() {
$valid = (!isset($this->backgroundColor) ||
$this->validateBackgroundColor($this->backgroundColor)) &&
(!isset($this->opacity) ||
$this->validateOpacity($this->opacity));
if (!$valid) {
return NULL;
}
return parent::jsonSerialize();
} | Implements JsonSerializable::jsonSerialize(). | entailment |
public function setTextColor($value) {
$value = strtoupper($value);
if ($this->validateTextColor($value)) {
$this->textColor = $value;
}
return $this;
} | Setter for textColor.
@param string $value
TextColor.
@return $this | entailment |
public function setUnderline($value) {
if (is_object($value) && !$value instanceof TextStrokeStyle) {
$this->triggerError('Object not of type TextStrokeStyle');
}
else {
$this->underline = $value;
}
return $this;
} | Setter for underline.
@param bool|\ChapterThree\AppleNewsAPI\Document\Styles\TextStrokeStyle $value
Underline.
@return $this | entailment |
public function setStrikethrough($value) {
if (is_object($value) && !$value instanceof TextStrokeStyle) {
$this->triggerError('Object not of type TextStrokeStyle');
}
else {
$this->strikethrough = $value;
}
return $this;
} | Setter for strikethrough.
@param bool|\ChapterThree\AppleNewsAPI\Document\Styles\TextStrokeStyle $value
Strikethrough.
@return $this | entailment |
public function jsonSerialize() {
$valid = (!isset($this->textColor) ||
$this->validateTextColor($this->textColor)) &&
(!isset($this->textTransform) ||
$this->validateTextTransform($this->textTransform)) &&
(!isset($this->backgroundColor) ||
$this->validateBackgroundColor($this->... | Implements JsonSerializable::jsonSerialize(). | entailment |
public function monitor()
{
$request = new Request(array(
'method' => Request::GET,
'uri' => 'customervault/monitor'
));
$response = $this->client->processRequest($request);
return ($response['status'] == 'READY');
} | Monitor.
@return bool true if successful
@throws PaysafeException | entailment |
public function createProfile( CustomerVault\Profile $profile )
{
$profile->setRequiredFields(array(
'merchantCustomerId',
'locale'
));
$profile->setOptionalFields(array(
'firstName',
'middleName',
'lastName',
'dateOfBir... | Create profile.
@param \Paysafe\CustomerVault\Profile $profile
@return \Paysafe\CustomerVault\Profile
@throws PaysafeException | entailment |
public function updateProfile( CustomerVault\Profile $profile )
{
$profile->setRequiredFields(array('id'));
$profile->checkRequiredFields();
$profile->setRequiredFields(array(
'merchantCustomerId',
'locale'
));
$profile->setOptionalFields(array(
... | Update profile.
@param \Paysafe\CustomerVault\Profile $profile
@return \Paysafe\CustomerVault\Profile
@throws PaysafeException | entailment |
public function deleteProfile( CustomerVault\Profile $profile )
{
$profile->setRequiredFields(array('id'));
$profile->checkRequiredFields();
$request = new Request(array(
'method' => Request::DELETE,
'uri' => $this->prepareURI("/profiles/" . $profile->id)
));... | Delete profile.
@param \Paysafe\CustomerVault\Profile $profile
@return bool
@throws PaysafeException | entailment |
public function getProfile( CustomerVault\Profile $profile, $includeAddresses = false, $includeCards = false, $includeachbankaccount = false, $includeeftbankaccount = false, $includebacsbankaccount = false, $includesepabankaccount = false )
{
$profile->setRequiredFields(array('id'));
$profile->check... | Get the profile.
@param \Paysafe\CustomerVault\Profile $profile
@param bool $includeAddresses
@param bool $includeCards
@param bool $includeachbankaccount
@param bool $includeeftbankaccount
@param bool $includebacsbankaccount
@param bool $includesepabankaccount
@return bool
@throws PaysafeException | entailment |
public function createAddress( CustomerVault\Address $address )
{
$address->setRequiredFields(array('profileID'));
$address->checkRequiredFields();
$address->setRequiredFields(array('country'));
$address->setOptionalFields(array(
'nickName',
'street',
... | Create address.
@param \Paysafe\CustomerVault\Address $address
@return \Paysafe\CustomerVault\Address
@throws PaysafeException | entailment |
public function updateAddress( CustomerVault\Address $address )
{
$address->setRequiredFields(array(
'profileID',
'id'
));
$address->checkRequiredFields();
$address->setRequiredFields(array('country'));
$address->setOptionalFields(array(
'n... | Update address.
@param \Paysafe\CustomerVault\Address $address
@return \Paysafe\CustomerVault\Address
@throws PaysafeException | entailment |
public function deleteAddress( CustomerVault\Address $address )
{
$address->setRequiredFields(array(
'profileID',
'id'
));
$address->checkRequiredFields();
$request = new Request(array(
'method' => Request::DELETE,
'uri' => $this->prep... | Delete address.
@param \Paysafe\CustomerVault\Address $address
@return bool
@throws PaysafeException | entailment |
public function getAddress( CustomerVault\Address $address )
{
$address->setRequiredFields(array(
'profileID',
'id'
));
$address->checkRequiredFields();
$request = new Request(array(
'method' => Request::GET,
'uri' => $this->prepareURI... | Get the address.
@param \Paysafe\CustomerVault\Address $address
@return bool
@throws PaysafeException | entailment |
public function createCard( CustomerVault\Card $card )
{
$card->setRequiredFields(array('profileID'));
$card->checkRequiredFields();
$card->setRequiredFields(array(
'cardNum',
'cardExpiry'
));
$card->setOptionalFields(array(
'nickName',
... | Create card.
@param \Paysafe\CustomerVault\Card $card
@return \Paysafe\CustomerVault\Card
@throws PaysafeException | entailment |
public function updateCard( CustomerVault\Card $card )
{
$card->setRequiredFields(array(
'profileID',
'id'
));
$card->checkRequiredFields();
$card->setRequiredFields(array());
$card->setOptionalFields(array(
'cardExpiry',
'nickN... | Update card.
@param \Paysafe\CustomerVault\Card $card
@return \Paysafe\CustomerVault\Card
@throws PaysafeException | entailment |
public function deleteCard( CustomerVault\Card $card )
{
$card->setRequiredFields(array(
'profileID',
'id'
));
$card->checkRequiredFields();
$request = new Request(array(
'method' => Request::DELETE,
'uri' => $this->prepareURI("/profil... | Delete card.
@param \Paysafe\CustomerVault\Card $card
@return bool
@throws PaysafeException | entailment |
public function getCard( CustomerVault\Card $card )
{
$card->setRequiredFields(array(
'profileID',
'id'
));
$card->checkRequiredFields();
$request = new Request(array(
'method' => Request::GET,
'uri' => $this->prepareURI("/profiles/" .... | Get the card.
@param \Paysafe\CustomerVault\Card $card
@return bool
@throws PaysafeException | entailment |
public function createACHBankAccount( CustomerVault\ACHBankaccounts $bankDetails )
{
$bankDetails->setRequiredFields(array(
'accountHolderName',
'accountNumber',
'routingNumber',
'billingAddressId',
'accountType'
));
$bankDetails->... | Creates ACH bank account for given profile id.
@param CustomerVault\ACHBankaccounts $bankDetails https://developer.optimalpayments.com/en/documentation/customer-vault-api/ach-bank-accounts/
@return \Paysafe\CustomerVault\Profile https://developer.optimalpayments.com/en/documentation/customer-vault-api/profiles/
@throw... | entailment |
public function createEFTBankAccount( CustomerVault\EFTBankaccounts $bankDetails )
{
$bankDetails->setRequiredFields(array(
'accountNumber',
'transitNumber',
'institutionId',
'accountHolderName',
'billingAddressId'
));
$bankDetails-... | Creates EFT bank account for given profile id.
@param CustomerVault\EFTBankaccounts $bankDetails https://developer.optimalpayments.com/en/documentation/customer-vault-api/eft-bank-accounts/
@return \Paysafe\CustomerVault\Profile https://developer.optimalpayments.com/en/documentation/customer-vault-api/profiles/
@throw... | entailment |
public function createBACSBankAccount( CustomerVault\BACSBankaccounts $bankDetails )
{
$bankDetails->setRequiredFields(array(
'accountNumber',
'sortCode',
'accountHolderName',
'billingAddressId'
));
$bankDetails->checkRequiredFields();
... | Creates BACS bank account for given profile id.
@param CustomerVault\ACHBankaccounts $bankDetails https://developer.Paysafe.com/en/documentation/customer-vault-api/bacs-bank-accounts/
@return \Paysafe\CustomerVault\Profile https://developer.optimalpayments.com/en/documentation/customer-vault-api/profiles/
@throws Pays... | entailment |
public function createSEPABankAccount( CustomerVault\SEPABankaccounts $bankDetails )
{
$bankDetails->setRequiredFields(array(
'iban',
'accountHolderName',
'billingAddressId'
));
$bankDetails->checkRequiredFields();
$bankDetails->setOptionalFields(a... | Creates SEPA bank account for given profile id.
@param CustomerVault\SEPABankaccounts $bankDetails https://developer.optimalpayments.com/en/documentation/customer-vault-api/sepa-bank-accounts/
@return \Paysafe\CustomerVault\Profile https://developer.optimalpayments.com/en/documentation/customer-vault-api/profiles/
@th... | entailment |
public function getACHBankAccount( CustomerVault\Profile $profile, CustomerVault\ACHBankaccounts $bankDetails )
{
$profile->setRequiredFields(array('id'));
$profile->checkRequiredFields();
$bankDetails->setRequiredFields(array('id'));
$bankDetails->checkRequiredFields();
$req... | Lookup ACH bank account
@param CustomerVault\Profile $profile
@param CustomerVault\ACHBankaccounts $bankDetails
@return \Paysafe\CustomerVault\Profile
@throws PaysafeException | entailment |
public function getEFTBankAccount( CustomerVault\Profile $profile, CustomerVault\EFTBankaccounts $bankDetails )
{
$profile->setRequiredFields(array('id'));
$profile->checkRequiredFields();
$bankDetails->setRequiredFields(array('id'));
$bankDetails->checkRequiredFields();
$req... | Lookup EFT bank account
@param CustomerVault\Profile $profile
@param CustomerVault\EFTBankaccounts $bankDetails
@return \Paysafe\CustomerVault\Profile
@throws PaysafeException | entailment |
public function getBACSBankAccount( CustomerVault\Profile $profile, CustomerVault\BACSBankaccounts $bankDetails )
{
$profile->setRequiredFields(array('id'));
$profile->checkRequiredFields();
$bankDetails->setRequiredFields(array('id'));
$bankDetails->checkRequiredFields();
$r... | Lookup BACS bank account
@param CustomerVault\Profile $profile
@param CustomerVault\BACSBankaccounts $bankDetails
@return \Paysafe\CustomerVault\Profile
@throws PaysafeException | entailment |
public function getSEPABankAccount( CustomerVault\Profile $profile, CustomerVault\SEPABankaccounts $bankDetails )
{
$profile->setRequiredFields(array('id'));
$profile->checkRequiredFields();
$bankDetails->setRequiredFields(array('id'));
$bankDetails->checkRequiredFields();
$... | Lookup SEPA bank account
@param CustomerVault\Profile $profile
@param CustomerVault\SEPABankaccounts $bankDetails
@return \Paysafe\CustomerVault\Profile
@throws PaysafeException | entailment |
public function updateEFTBankAccount( CustomerVault\Profile $profile, CustomerVault\EFTBankaccounts $bankDetails )
{
$profile->setRequiredFields(array('id'));
$profile->checkRequiredFields();
$bankDetails->setRequiredFields(array(
'transitNumber',
'institutionId',
... | Update EFT bank account
@param CustomerVault\Profile $profile
@param CustomerVault\EFTBankaccounts $bankDetails
@return \Paysafe\CustomerVault\Profile
@throws PaysafeException | entailment |
public function deleteACHBankAccount( CustomerVault\Profile $profile, CustomerVault\ACHBankaccounts $bankDetails )
{
$bankDetails->setRequiredFields(array('id'));
$bankDetails->checkRequiredFields();
$profile->setRequiredFields(array('id'));
$profile->checkRequiredFields();
$... | Delete ACH bank account
@param CustomerVault\Profile $profile
@param CustomerVault\ACHBankaccounts $bankDetails
@return \Paysafe\CustomerVault\Profile
@throws PaysafeException | entailment |
public function deleteEFTBankAccount( CustomerVault\Profile $profile, CustomerVault\EFTBankaccounts $bankDetails )
{
$bankDetails->setRequiredFields(array('id'));
$bankDetails->checkRequiredFields();
$profile->setRequiredFields(array('id'));
$profile->checkRequiredFields();
... | Delete EFT bank account
@param CustomerVault\Profile $profile
@param CustomerVault\EFTBankaccounts $bankDetails
@return \Paysafe\CustomerVault\Profile
@throws PaysafeException | entailment |
public function deleteBACSBankAccount( CustomerVault\Profile $profile, CustomerVault\BACSBankaccounts $bankDetails )
{
$bankDetails->setRequiredFields(array('id'));
$bankDetails->checkRequiredFields();
$profile->setRequiredFields(array('id'));
$profile->checkRequiredFields();
$requ... | Delete BACS bank account
@param CustomerVault\Profile $profile
@param CustomerVault\BACSBankaccounts $bankDetails
@return \Paysafe\CustomerVault\Profile
@throws PaysafeException | entailment |
public function deleteSEPABankAccount( CustomerVault\Profile $profile, CustomerVault\SEPABankaccounts $bankDetails )
{
$profile->setRequiredFields(array('id'));
$profile->checkRequiredFields();
$bankDetails->setRequiredFields(array('id'));
$bankDetails->checkRequiredFields();
... | Delete SEPA bank account
@param CustomerVault\Profile $profile
@param CustomerVault\SEPABankaccounts $bankDetails
@return \Paysafe\CustomerVault\Profile
@throws PaysafeException | entailment |
public function createMandates(CustomerVault\Mandates $mandates ,$bankaccounts) {
$mandates->setRequiredFields(array(
'reference'
));
$mandates->checkRequiredFields();
$request = new Request(array(
'method' => Request::POST,
'uri' => $t... | Process Create a Mandate.
@param \Paysafe\CustomerVault\Mandate $mandate
@return \Paysafe\CustomerVault\Mandate
@throws PaysafeException | entailment |
public function getMandates(CustomerVault\Mandates $mandates) {
$mandates->setRequiredFields(array(
'id'
));
$mandates->checkRequiredFields();
$request = new Request(array(
'method' => Request::GET,
'uri' => $this->prepareURI("/profiles/" .... | Process Look Up a Mandates
@param \Paysafe\CustomerVault\Mandate $mandates
@return \Paysafe\CustomerVault\Mandates
@throws PaysafeException | entailment |
public function updateMandates(CustomerVault\Mandates $mandates) {
$mandates->setRequiredFields(array(
'status'
));
$mandates->checkRequiredFields();
$request = new Request(array(
'method' => Request::PUT,
'uri' => $this->prepareURI("/profile... | Process Update a Mandates
@param \Paysafe\CustomerVault\Mandate $mandates
@return \Paysafe\CustomerVault\Mandates
@throws PaysafeException | entailment |
public function deleteMandates(CustomerVault\Mandates $mandates) {
$request = new Request(array(
'method' => Request::DELETE,
'uri' => $this->prepareURI("/profiles/" . $mandates->profileID."/mandates/".$mandates->id),
'body' => $mandates
));
$response ... | Process Delete a Mandates
@param \Paysafe\CustomerVault\Mandate $mandates
@return \Paysafe\CustomerVault\Mandates
@throws PaysafeException | entailment |
public function setMargin($value) {
if (is_object($value) && !$value instanceof Margin) {
$this->triggerError('Object not of type Margin');
}
else {
$this->margin = $value;
}
return $this;
} | Setter for margin.
@param int|\ChapterThree\AppleNewsAPI\Document\Margin $value
Margin.
@return $this | entailment |
public function setContentInset($value) {
if (is_object($value) && !$value instanceof ContentInset) {
$this->triggerError('Object not of type ContentInset');
}
else {
$this->contentInset = $value;
}
return $this;
} | Setter for contentInset.
@param bool|\ChapterThree\AppleNewsAPI\Document\ContentInset $value
ContentInset.
@return $this | entailment |
public function setIgnoreDocumentMargin($value = TRUE) {
if ($this->validateIgnoreDocumentMargin($value)) {
$this->ignoreDocumentMargin = $value;
}
return $this;
} | Setter for ignoreDocumentMargin.
@param float $value
IgnoreDocumentMargin.
@return $this | entailment |
public function setIgnoreDocumentGutter($value = TRUE) {
if ($this->validateIgnoreDocumentGutter($value)) {
$this->ignoreDocumentGutter = $value;
}
return $this;
} | Setter for ignoreDocumentGutter.
@param float $value
IgnoreDocumentGutter.
@return $this | entailment |
public function jsonSerialize() {
$valid = (!isset($this->ignoreDocumentMargin) ||
$this->validateIgnoreDocumentMargin($this->ignoreDocumentMargin)) &&
(!isset($this->ignoreDocumentGutter) ||
$this->validateIgnoreDocumentGutter($this->ignoreDocumentGutter)) &&
(!isset($this->minimumHeigh... | Implements JsonSerializable::jsonSerialize(). | entailment |
protected function validateIgnoreDocumentMargin($value) {
if (!is_bool($value) &&
!in_array($value, ['none', 'left', 'right', 'both'])
) {
$this->triggerError('ignoreDocumentMargin is not valid');
return FALSE;
}
return TRUE;
} | Validates the ignoreDocumentMargin attribute. | entailment |
protected function validateIgnoreDocumentGutter($value) {
if (!is_bool($value) &&
!in_array($value, ['none', 'left', 'right', 'both'])
) {
$this->triggerError('ignoreDocumentGutter is not valid');
return FALSE;
}
return TRUE;
} | Validates the ignoreDocumentGutter attribute. | entailment |
protected function validateMinimumHeight($value) {
if (!is_int($value) &&
!$this->isSupportedUnit($value)
) {
$this->triggerError('minimumHeight is not valid');
return FALSE;
}
return TRUE;
} | Validates the minimumHeight attribute. | entailment |
protected function validateMaximumContentWidth($value) {
if (!is_int($value) &&
!$this->isSupportedUnit($value)
) {
$this->triggerError('maximumContentWidth is not valid');
return FALSE;
}
return TRUE;
} | Validates the maximumContentWidth attribute. | entailment |
public function getCharacter($realm, $characterName, array $options = [])
{
return $this->request('/character/'.(string) $realm.'/'.(string) $characterName, $options);
} | Get character
The Character Profile API is the primary way to access character information. This Character Profile API can be
used to fetch a single character at a time through an HTTP GET request to a URL describing the character profile
resource. By default, a basic dataset will be returned and with each request and... | entailment |
public function getGuild($realm, $guildName, array $options = [])
{
return $this->request('/guild/'.(string) $realm.'/'.(string) $guildName, $options);
} | Get guild profile
The guild profile API is the primary way to access guild information. This guild profile API can be used to fetch
a single guild at a time through an HTTP GET request to a url describing the guild profile resource. By default,
a basic dataset will be returned and with each request and zero or more ad... | entailment |
public function getProfileCharacters($accessToken = null, array $options = [])
{
if (null === $accessToken) {
$options['access_token'] = $this->blizzardClient->getAccessToken();
} else {
$options['access_token'] = $accessToken;
}
return $this->request('/user/... | Get profile characters
This provides data about the current logged in OAuth user's WoW profile
@param null|string $accessToken Authorized user access token
@param array $options Options
@return ResponseInterface | entailment |
public function submit( DirectDebit\Purchase $purchase )
{
if (isset($purchase->ach))
{
$return = $this->submitPurchaseACH($purchase);
} else if (isset($purchase->eft))
{
$return = $this->submitPurchaseEFT($purchase);
} else if (isset($purchase->bacs))... | Submit purchase
@param \Paysafe\DirectDebit\Purchase $purchase
@return \Paysafe\DirectDebit\Purchase
@throws PaysafeException | entailment |
private function submitPurchaseBACS( DirectDebit\Purchase $purchase )
{
$fields = array(
'merchantRefNum',
'amount',
'bacs'
);
if (!isset($purchase->bacs->paymentToken))
{
$fields[] = 'profile';
$fields[] = 'billingDetails'... | Process Purchase using BACS without payment token.
@param \Paysafe\DirectDebit\Purchase $purchase
@return \Paysafe\DirectDebit\Purchase
@throws PaysafeException | entailment |
public function cancelPurchase( DirectDebit\Purchase $purchase )
{
$purchase->setRequiredFields(array('id','status'));
$purchase->checkRequiredFields();
$request = new Request(array(
'method' => Request::PUT,
'uri' => $this->prepareURI($this->purchasePath . $this->ur... | Cancel Purchase.
@param \Paysafe\DirectDebit\Purchase $purchase
@return \Paysafe\DirectDebit\Purchase
@throws PaysafeException | entailment |
public function getPurchase( DirectDebit\Purchase $purchase )
{
$purchase->setOptionalFields(array('id'));
$purchase->checkRequiredFields();
$request = new Request(array(
'method' => Request::GET,
'uri' => $this->prepareURI($this->purchasePath . $this->uriseparator .... | Lookup Purchase.
@param \Paysafe\DirectDebit\Purchase $purchase
@return \Paysafe\DirectDebit\Purchase
@throws PaysafeException | entailment |
public function getPurchases( DirectDebit\Purchase $purchase, DirectDebit\Filter $filter )
{
$queryStr = array();
if ($purchase && $purchase->merchantRefNum)
{
$queryStr['merchantRefNum'] = $purchase->merchantRefNum;
}
if ($filter)
{
if (isset(... | Lookup Purchase.
@param \Paysafe\DirectDebit\Purchase $purchase
@return \Paysafe\DirectDebit\Purchase
@throws PaysafeException | entailment |
public function standaloneCredits( DirectDebit\StandaloneCredits $standalonecredits )
{
if (isset($standalonecredits->ach))
{
$return = $this->standalonecreditsACH($standalonecredits);
} else if (isset($standalonecredits->eft))
{
$return = $this->standalonecre... | Submit Standalone Cedits
@param \Paysafe\DirectDebit\StandaloneCredits $standalonecredits
@return \Paysafe\DirectDebit\StandaloneCredits
@throws PaysafeException | entailment |
private function standalonecreditsBACS( DirectDebit\StandaloneCredits $standalonecredits )
{
$fields = array(
'merchantRefNum',
'amount',
'bacs'
);
if (!isset($standalonecredits->bacs->paymentToken))
{
$fields[] = 'profile';
... | Process Standalone Credits using BACS without payment token.
@param \Paysafe\DirectDebit\StandaloneCredits $standalonecredits
@return \Paysafe\DirectDebit\StandaloneCredits
@throws PaysafeException | entailment |
public function cancelStandalonecredits( DirectDebit\StandaloneCredits $standalonecredits )
{
$standalonecredits->setRequiredFields(array('id'));
$standalonecredits->checkRequiredFields();
$tmpAuth = new DirectDebit\StandaloneCredits(array(
'status' => 'CANCELLED'
));
... | Cancel StandaloneCredits.
@param \Paysafe\DirectDebit\StandaloneCredits $standalonecredits
@return \Paysafe\DirectDebit\StandaloneCredits
@throws PaysafeException | entailment |
public function getStandaloneCredit( DirectDebit\StandaloneCredits $standalonecredits )
{
$standalonecredits->setRequiredFields(array('id'));
$standalonecredits->checkRequiredFields();
$request = new Request(array(
'method' => Request::GET,
'uri' => $this->prepareURI(... | Lookup StandaloneCredits.
@param \Paysafe\DirectDebit\StandaloneCredits $standalonecredits
@return \Paysafe\DirectDebit\StandaloneCredits
@throws PaysafeException | entailment |
public function getStandaloneCredits( DirectDebit\StandaloneCredits $standalonecredits, DirectDebit\Filter $filter )
{
$queryStr = array();
if ($standalonecredits && $standalonecredits->merchantRefNum)
{
$queryStr['merchantRefNum'] = $standalonecredits->merchantRefNum;
}
... | Lookup StandaloneCredits.
@param \Paysafe\DirectDebit\StandaloneCredits $standalonecredits
@return \Paysafe\DirectDebit\StandaloneCredits
@throws PaysafeException | entailment |
public function setHeaders(array $headers, $reset = false)
{
if ($reset === true) {
$this->api_headers = $headers;
} else {
$this->api_headers += $headers;
}
return $this;
} | Set the headers for all requests
@param array $headers Global headers for all future requests
@param bool $reset
@return $this | entailment |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.