Exemple #1
0
 public function createBill($order_transaction, $order_info)
 {
     $order_total = fn_format_rate_value($order_info['total'], 'F', 2, '.', '', '');
     $user = str_replace(array('+', ' ', '(', ')', '-'), '', $order_info['payment_info']['phone']);
     $data = array('user' => 'tel:+' . $user, 'amount' => $order_total, 'comment' => !empty($order_info['notice']) ? $order_info['notice'] : '');
     $url = $this->_url . $order_transaction;
     $data['ccy'] = $this->_currency;
     $data['lifetime'] = $this->_lifetime;
     $extra = array('headers' => $this->_headers, 'basic_auth' => array($this->_login, $this->_password));
     $this->_response = Http::put($url, $data, $extra);
     $this->_response = json_decode($this->_response, true);
     if (!empty($this->_response['response']['result_code'])) {
         $this->_error_code = $this->_response['response']['result_code'];
         $this->_error_text = $this->_response['response']['description'];
     }
     return $this->_response;
 }