Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ($_SERVER['REMOTE_ADDR'] == '178.18.47.155') {
- $post['AMOUNT'] = 1;
- }
- $transaction_id = md5(mt_rand() . time());
- $order = array(
- 'transaction_id' => $transaction_id,
- 'contact_id' => $this->data['contact']->id,
- 'create_datetime' => date('Y-m-d H:i:s'),
- 'amount' => $post['AMOUNT'],
- 'type' => 'add',
- 'method' => 'card',
- 'status' => 'created',
- 'comment' => json_encode($contact_data),
- 'locale' => $this->data['lclang']
- );
- $websocket_db = $this->load->database('websocket', true);
- if ($websocket_db->insert('payments', $order)) {
- $invoice_id = $websocket_db->insert_id();
- $reload_data = array();
- $reload_data['name'] = $post['name'];
- $reload_data['email'] = $post['EMAIL'];
- $reload_data['phone'] = $post['phone'];
- $reload_data['country'] = $post['country'];
- $reload_data['city'] = $post['city'];
- $reload_data['address'] = $post['address'];
- $reload_data['user_id'] = $this->data['contact']->id;
- $db_reload_data = $this->db->where('user_id', $this->data['contact']->id)->get('users_reload_info')->row();
- if (!empty($db_reload_data)) {
- $this->db->where('user_id', $this->data['contact']->id);
- $this->db->update('users_reload_info', $reload_data);
- } else {
- $this->db->insert('users_reload_info', $reload_data);
- }
- }
- $mid = '44840995429';
- $key = 'D47D0*********************';
- $data = array(
- 'amount' => $post['AMOUNT'],
- 'curr' => 'RON',
- 'invoice_id' => $invoice_id,
- 'order_desc' => 'Umple din nou',
- 'merch_id' => $mid,
- 'timestamp' => date('YmdHis'),
- 'nonce' => $transaction_id,
- );
- $data['fp_hash'] = strtoupper($this->euplatesc_mac($data, $key));
- $curl = curl_init();
- curl_setopt_array($curl, array(
- CURLOPT_URL => 'https://secure.euplatesc.ro/tdsprocess/tranzactd.php',
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_ENCODING => '',
- CURLOPT_MAXREDIRS => 10,
- CURLOPT_TIMEOUT => 0,
- CURLOPT_FOLLOWLOCATION => true,
- CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
- CURLOPT_CUSTOMREQUEST => 'POST',
- CURLOPT_POSTFIELDS => $data,
- CURLOPT_HTTPHEADER => array(
- 'Cookie: EPSSESSID=q818efv1mejv9hf7g279lj1jpcc7jhgof7f68ep721eu16ktpjt0'
- ),
- ));
- $url = curl_exec($curl);
- curl_close($curl);
- $url = explode('URL=', $url);
- $response['url'] = substr($url[1], 0, -2);
- $response['status'] = 'ok';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement