public function _init()
 {
     if (!$this->ENABLE) {
         return null;
     }
     // default
     $purse = $this->_purse_by_currency(['is_key' => false]);
     if ($purse['status'] === false) {
         throw new InvalidArgumentException($purse['status_message']);
     }
     // load api
     $provider_path = __DIR__ . '/payment_provider/webmoney';
     // CA: https://wiki.wmtransfer.com/projects/webmoney/wiki/WebMoney_root_certificate
     $this->CA = $provider_path . '/WebMoneyCA.pem';
     require_once $provider_path . '/WebMoney.php';
     $this->api = new WebMoney($purse['id'], $purse['key'], $purse['hash_method']);
     $this->url_result = url_user('/api/payment/provider?name=webmoney&operation=response');
     $this->url_server = url_user('/api/payment/provider?name=webmoney&operation=response&server=true');
     // DEBUG
     $is_test = $this->is_test();
     if ($is_test) {
         $this->SHOP_ID = 21;
     }
     if ($is_test && @$_GET['result_test']) {
         $result_test = $_GET['result_test'] == '1' || $_GET['result_test'] == 'true' ? 1 : 0;
         // test: 0 - success; 1 - fail.
         // $_[ 'LMI_SIM_MODE' ] = 0;
         // $_[ 'LMI_SIM_MODE' ] = 1;
         $_SESSION['payin']['result_test'] = $result_test;
     }
     // parent
     parent::_init();
 }
 public function _init()
 {
     if (!$this->ENABLE) {
         return null;
     }
     // load api
     require_once __DIR__ . '/payment_provider/ecommpay/EcommPay.php';
     $this->api = new EcommPay($this->KEY_PUBLIC, $this->KEY_PRIVATE);
     $this->url_result = url_user('/api/payment/provider?name=ecommpay&operation=response');
     $this->url_server = url_user('/api/payment/provider?name=ecommpay&operation=response&server=true');
     // translation
     $strs =& $this->method_allow['payout']['pay_card']['option'];
     foreach ($strs as $key => &$str) {
         $str = t($str);
     }
     // payout default option
     $user_id = main()->USER_ID;
     if ($user_id) {
         $user = user($user_id);
         $option_default =& $this->method_allow['payout']['pay_card']['option_default'];
         $option_default = ['card' => $user['card'], 'sender_first_name' => $user['first_name'], 'sender_last_name' => $user['last_name'], 'sender_middle_name' => $user['middle_name'] ?: $user['patronymic'], 'sender_passport_number' => $user['passport_num'], 'sender_passport_issue_date' => $user['passport_issue_date'], 'sender_passport_issued_by' => $user['passport_issued_by'] ?: $user['passport_released'], 'sender_phone' => @str_replace([' ', '-', '+'], '', $user['phone']), 'sender_birthdate' => $user['birthdate'] ?: $user['birth_date'], 'sender_address' => $user['address'] ?: $user['address2'], 'sender_city' => $user['city'] ?: $user['city2'], 'sender_postindex' => $user['zip_code'] ?: $user['zip_code2']];
         $option_default =& $this->method_allow['payout']['qiwi']['option_default'];
         $option_default = ['account_number' => @str_replace([' ', '-', '+'], '', $user['phone'])];
     }
     // parent
     parent::_init();
 }
 public function _init()
 {
     if (!$this->ENABLE) {
         return null;
     }
     $this->payment_api = _class('payment_api');
     // load api
     require_once __DIR__ . '/payment_provider/privat24/Privat24.php';
     $this->api = new Privat24($this->KEY_PUBLIC, $this->KEY_PRIVATE);
     $this->url_result = url_user('/api/payment/provider?name=privat24&operation=response');
     $this->url_server = url_user('/api/payment/provider?name=privat24&operation=response&server=true');
     // parent
     parent::_init();
 }
 public function _init()
 {
     if (!$this->ENABLE) {
         return null;
     }
     $this->payment_api = _class('payment_api');
     // load api
     require_once __DIR__ . '/payment_provider/interkassa/Interkassa.php';
     $this->api = new Interkassa($this->KEY_PUBLIC, $this->KEY_PRIVATE, $this->KEY_PRIVATE_TEST, $this->HASH_METHOD, $this->TEST_MODE);
     $this->url_result = url_user('/api/payment/provider?name=interkassa&operation=response');
     $this->url_server = url_user('/api/payment/provider?name=interkassa&operation=response&server=true');
     // parent
     parent::_init();
 }
 public function _init()
 {
     if (!$this->ENABLE) {
         return null;
     }
     if (empty($this->url_server)) {
         $this->url_server = url_user('/api/payment/provider?name=payeer&operation=response&server=true');
     }
     $allow = $this->allow();
     if (!$allow) {
         return false;
     }
     if (!empty($this->PARTNER_ID)) {
         $this->URL_MERCHANT_API .= '?partner=' . $this->PARTNER_ID;
         //$this->URL_API .= '?partner='.$this->PARTNER_ID;
     }
     parent::_init();
 }
 public function payment($options)
 {
     if (!$this->ENABLE) {
         return null;
     }
     // import options
     is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
     // class
     $payment_api = $this->payment_api;
     // var
     $operation_id = $_data['operation_id'];
     // payment
     $result = parent::payment($options);
     // confirmation is ok
     $confirmation_ok_options = ['operation_id' => $operation_id];
     $result = $payment_api->confirmation_ok($confirmation_ok_options);
     // payout
     $result = $this->api_payout($options);
     return $result;
 }
 public function _init()
 {
     if (!$this->ENABLE) {
         return null;
     }
     // parent
     parent::_init();
     // class
     $payment_api =& $this->payment_api;
     $provider_name =& $this->provider_name;
     $provider_id =& $this->provider_id;
     $provider =& $this->provider;
     $access_token =& $this->access_token;
     // load api
     require_once __DIR__ . '/payment_provider/yandexmoney/YandexMoney.php';
     $this->api = new YandexMoney($this->KEY_PUBLIC, $this->KEY_PRIVATE);
     $this->url_result = url_user('/api/payment/provider?name=yandexmoney&operation=response');
     $this->url_server = url_user('/api/payment/provider?name=yandexmoney&operation=response&server=true');
     $this->url_authorize = url_user('/api/payment/provider?name=yandexmoney&operation=authorize&server=true');
     // provider options
     list($provider_id, $provider) = $payment_api->get_provider(['name' => $provider_name]);
     $access_token = @$provider['options']['authorize']['access_token'];
     !is_string($access_token) && ($access_token = null);
 }