Completed
Push — master ( 75ca6a...d59674 )
by Владислав
02:12
created

RuCaptcha::init()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace jumper423\decaptcha\services;
4
5
use jumper423\decaptcha\core\DeCaptchaBase;
6
7
/**
8
 * Распознавание капчи RuCaptcha.
9
 *
10
 * Class RuCaptcha
11
 *
12
 * @link http://infoblog1.ru/goto/rucaptcha
13
 */
14
class RuCaptcha extends DeCaptchaBase
15
{
16
    public $domain = 'rucaptcha.com';
17
18
    public function init()
19
    {
20
        parent::init();
21
        $this->actions[static::ACTION_RECOGNIZE][static::ACTION_FIELDS][static::ACTION_FIELD_SOFT_ID][static::PARAM_SLUG_DEFAULT] = 882;
22
    }
23
24
    public function getBalance(){
25
        $this->setParam(static::ACTION_FIELD_ACTION, 'getbalance');
26
        $response = $this->getResponse(static::ACTION_UNIVERSAL);
27
        $dataGet = $this->decodeResponse(static::DECODE_ACTION_GET, $response);
28
        return $dataGet[static::DECODE_PARAM_RESPONSE];
29
    }
30
}
31