File tree Expand file tree Collapse file tree 1 file changed +20
-5
lines changed
Expand file tree Collapse file tree 1 file changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -36,20 +36,35 @@ class Banka extends RW {
3636 */
3737 public $ evidence = 'banka ' ;
3838
39+ /**
40+ * Bank pull mode of Json processing
41+ * @var boolean
42+ */
43+ private $ pullMode = false ;
44+
3945 /**
4046 * Stáhne bankovní výpisy ( trvá delší dobu )
4147 *
4248 * @return boolean
4349 */
4450 public function stahnoutVypisyOnline () {
45- try {
46- $ this ->performRequest ('nacteni-vypisu-online.json ' , 'PUT ' , 'txt ' );
47- } catch (Exception $ exc ) {
48- $ this ->addStatusMessage ('Json response is still plaintext ' , 'debug ' );
49- }
51+ $ this ->pullMode = true ;
52+ $ this ->performRequest ('nacteni-vypisu-online.json ' , 'PUT ' , 'txt ' );
53+ $ this ->pullMode = false ;
5054 return $ this ->lastResponseCode == 200 ;
5155 }
5256
57+ /**
58+ * Convert AbraFlexi Response JSON to Array
59+ *
60+ * @param string $rawJson
61+ *
62+ * @return array
63+ */
64+ public function rawJsonToArray ($ rawJson ) {
65+ return $ this ->pullMode ? explode ($ rawJson , "\n" ) : parent ::rawJsonToArray ($ rawJson );
66+ }
67+
5368 /**
5469 * Start invoice automatic matching process ( it takes longer time )
5570 * Spustí proces automatického párování plateb. ( trvá delší dobu )
You can’t perform that action at this time.
0 commit comments