Здравствуйте. Не добавляются в бд данные транзакции после тестового перевода на юмани.
Мой view
<form method="POST" action="https://yoomoney.ru/quickpay/confirm.xml">
<input type="hidden" name="receiver" value="410011xxxx14839">
<input type="hidden" name="quickpay-form" value="shop">
<input type="hidden" name="label" value="<?= $this->session->userdata('id') ?>">
<input type="hidden" name="targets" value="Тест">
<input type="hidden" name="paymentType" value="PC">
<input name="sum" value="4568.25" data-type="number" placeholder="Сумма">
<input type="submit" value="Перевести">
</form>
Мой контроллер
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Yoomoney extends MY_Controller {
public function __construct()
{
parent::__construct();
}
public function index()
{
$this->load->model('yoomoney_model');
if(isset($_POST['notification_type'])){
$hash = sha1($_POST['notification_type'].'&'.
$_POST['operation_id'].'&'.
$_POST['amount'].'&'.
$_POST['currency'].'&'.
$_POST['datetime'].'&'.
$_POST['sender'].'&'.
$_POST['codepro'].'&'.
'1vCpCaBwxxxxOEVPmv0l8Vy '.'&'.
$_POST[' label']);
if($_POST['sha1_hash'] != $hash || $_POST['codepro'] === true || $_POST['unaccepted'] === true) die();
else{
// file_get_contents('history.php', 1, FILE_APPEND);
$add['amount'] = $_POST['amount'];
$add['user_id'] = $_POST[' label'];
$add['ps_id'] = 1;
$this->yoomoney_model->add_transaction($add);
echo "Успешно";
die();
}
}
$this->load->view('templates/yoomoney_view');
}
}
Модель
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Yoomoney_model extends CI_Model {
public function add_transaction($add)
{
$this->db->insert('transactions', $add);
}
}
Настроил уведомление