Skip to content

Commit

Permalink
composer.json added
Browse files Browse the repository at this point in the history
  • Loading branch information
kkamkou committed Aug 15, 2013
1 parent 921e568 commit 092f049
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Shipping/Spsr.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ public function getCountries()
* Makes calculation according options
*
* @param array $options
* @throws \UnexpectedValueException if a required option skipped
* @return array|false
*/
public function calculate(array $options)
Expand Down Expand Up @@ -143,7 +144,7 @@ public function calculate(array $options)
}
}

// let's apply properies
// let's apply properties
$client = $this->_getHttpClient()->setUri(self::URI_CALC);
foreach ($options as $key => $value) {
if (!is_numeric($value)) {
Expand All @@ -162,8 +163,8 @@ public function calculate(array $options)
}

// if we need only one tariff
if (isset($options['TariffType'])) {
$xpathResult = $xml->xpath("/root/Tariff[contains(., '{$options['TariffType']}')]");
if (isset($options['usldost'])) {
$xpathResult = $xml->xpath('/root/Tariff[UslDost="' . $options['usldost'] . '"]');
if ($xpathResult !== false) {
$results = (array)$xpathResult[0];
}
Expand Down Expand Up @@ -249,6 +250,7 @@ protected function _getHttpClient()
* Makes request and checks the result
*
* @param \Zend_Http_Client $client
* @throws \Exception if XML parser returned the error
* @return \SimpleXMLElement
*/
protected function _request(\Zend_Http_Client $client)
Expand Down
29 changes: 29 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "kkamkou/zf-russian-post-sdk",
"description": "Russian post, EMS and SPSR shipping calculations with ZF1",
"type": "library",
"homepage": "http://github.com/kkamkou/ZF-Russian-Post-SDK",
"license": "BSD-2-Clause",
"keywords": [
"zf1",
"shipping",
"EMS",
"SPSR",
"RussianPost"
],
"authors": [
{
"name": "Kanstantsin Kamkou",
"email": "kkamkou@gmail.com"
}
],
"require": {
"php": ">=5.2.11",
"zendframework/zendframework1" : "1.12.*"
},
"autoload": {
"psr-0": {
"TpShipping": "Shipping/"
}
}
}

0 comments on commit 092f049

Please sign in to comment.