A
A
Alexander Kovalchuk2015-12-24 18:27:23
Laravel
Alexander Kovalchuk, 2015-12-24 18:27:23

How to fix a payment error in merchant?

I set up payment with a record in the database, 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="go">
</form>

And I accept payment like this:
if ($_POST['LMI_PREREQUEST'] == 1) {
            if ($_POST['LMI_PAYEE_PURSE'] == 'U205235885940') {
                echo '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'] . 
'SpCFe8m9CNQs6rY61XOg' . 
$_POST['LMI_PAYER_PURSE'] . 
$_POST['LMI_PAYER_WM'];

            if (strtoupper(hash('sha256', $key)) != $_POST['LMI_HASH']) {
                exit;
            }
            $payment = new Payment();
            $payment->nickname = $_POST['nickname'];
            $payment->total_money = $_POST['LMI_PAYMENT_AMOUNT'];
            $payment->type_comment = 'web';
            $payment->save();

            $model = Models::where('nickname', '=', $_POST['nickname'])
                ->first();
            $model->cash = $model->cash + $_POST['LMI_PAYMENT_AMOUNT'];
            $model->save();
        }

And the answer is this error
2d4d49346f4448ff90386a58b11dbd46.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Pavlenko, 2015-12-24
@mamut

Probably the page should return just OK (or something similar), but you get the whole page returned. This could probably be a mistake.
And also check the order of the parameters in the request signature, they seem to be in alphabetical order.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question