Answer the question
In order to leave comments, you need to log in
How to set up yoomoney for a website?
Hello. Transaction data is not added to the database after a test translation into Yumani.
my 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);
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question