A
A
Alexander Kovalchuk2015-12-26 14:49:28
Laravel
Alexander Kovalchuk, 2015-12-26 14:49:28

Why is the replenishment not saved in the database when replenishing via merchant, although the payment is successful?

Here is the request form

<form action="https://merchant.webmoney.ru/lmi/payment.asp" method="POST">
    <input type="hidden" name="login" value="{{$nickname}}">
    <input type="text" name="LMI_PAYMENT_AMOUNT" value="500">
    <input type="hidden" 
        name="LMI_PAYMENT_DESC_BASE64" 
        value="0J/QvtC/0L7Qu9C90LXQvdC40Y8g0YHRh9C10YLQsA==">
    <input type="hidden" name="LMI_PAYEE_PURSE" value="U205235885940">
    <input type="submit" class="button button-5" value="{{trans('settings.balance_on')}}">
</form>

and process like this
if ($_POST['LMI_PREREQUEST'] == 1) {
            if ($_POST['LMI_PAYEE_PURSE'] == 'U205235885940') print('YES');
        } else {
            $key = $_POST['LMI_PAYEE_PURSE'] .
                       $_POST['LMI_PAYMENT_AMOUNT'] . 
                       $_POST['LMI_PAYMENT_NO'] . 
                       $_POST['LMI_MODE'] . 
                       $_POST['LMI_SYS_INVS_NO'] . 
                       $_POST['LMI_SYS_TRANS_NO'] .
                       $_POST['LMI_SYS_TRANS_DATE'] . 
                       '********' .
                       $_POST['LMI_PAYER_PURSE'] . 
                       $_POST['LMI_PAYER_WM'];
            if (strtoupper(hash('sha256', $key)) != $_POST['LMI_HASH']) exit;
            $model = Models::where('nickname', '=', $_POST['login'])
                ->first();
            if ($model->nickname == $_POST['login']) {
                $payment = new Payment();
                $payment->nickname = $_POST['login'];
                $payment->total_money = $_POST['LMI_PAYMENT_AMOUNT'];
                $payment->type_comment = 'web';
                $payment->save();

                $model->cash = $model->cash + $_POST['LMI_PAYMENT_AMOUNT'];
                $model->save();
            }
        }

Why is the result not written to the database?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
D', 2015-12-26
@mamut

name="login"

Shouldn't they be named the same?
PS
Rub the keys.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question