Skip to content

Commit

Permalink
0.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrii-fediuk committed Sep 3, 2017
1 parent b92a6fb commit 3a0d3cd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
21 changes: 15 additions & 6 deletions API/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ final class Validator extends \Df\API\Response\Validator {
* 2017-09-03
* @override
* @see \Df\API\Exception::long()
* @used-by short()
* @used-by \Df\API\Client::p()
* @return string
*/
function long() {return '';}
function long() {return dfa($this->codes(), $this->code());}

/**
* 2017-09-03
Expand All @@ -23,7 +24,7 @@ function long() {return '';}
* @used-by \Df\API\Client::p()
* @return string
*/
function short() {return '';}
function short() {return $this->long();}

/**
* 2017-09-03
Expand All @@ -32,14 +33,22 @@ function short() {return '';}
* @used-by \Df\API\Response\Validator::validate()
* @return bool
*/
function valid() {return !$this->rCode();}
function valid() {return !$this->code();}

/**
* 2017-09-03 `[QIWI Wallet] API error codes`: https://mage2.pro/t/4448
* @used-by long()
* @used-by valid()
* @return int
*/
private function rCode() {return dfc($this, function() {return
intval(dfa($this->r(), 'result_code'))
;});}
private function code() {return dfc($this, function() {return intval(dfa($this->r(), 'result_code'));});}

/**
* 2017-09-03
* @used-by long()
* @return array(int => string)
*/
private function codes() {return dfc($this, function() {return dfa_key_int(df_module_csv($this, sprintf(
'error-codes/%s.csv', df_lang_ru_en()
)));});}
}
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mage2pro/qiwi"
,"version": "0.0.8"
,"version": "0.0.9"
,"description": "The «Visa QIWI Wallet» (QIWI Кошелёк) payment extension for Magento 2."
,"type": "magento2-module"
,"homepage": "https://mage2.pro/c/extensions/qiwi"
Expand All @@ -11,7 +11,7 @@
"homepage": "https://mage2.pro/users/dmitry_fedyuk",
"role": "Developer"
}]
,"require": {"mage2pro/core": ">=2.11.7"}
,"require": {"mage2pro/core": ">=2.11.9"}
,"autoload": {"files": ["registration.php"], "psr-4": {"Dfe\\Qiwi\\": ""}}
,"keywords": [
"API"
Expand Down

0 comments on commit 3a0d3cd

Please sign in to comment.