A
A
Alexander Koregin2020-09-03 14:59:57
Laravel
Alexander Koregin, 2020-09-03 14:59:57

How can I test account transfer notifications on Laravel Qiwi p2p?

I attached a payment system and made an api for server notifications that the order was paid, uploaded it to the host, made a purchase and wait. Is there a way to check if a notification is coming in and maybe throwing some errors?. I am developing on Laravel, here is the code

public function updateStatusPayment(Request $request) {
        $secret_key = setting('site.secret_key');

        $sha256_hash_header = $_SERVER['HTTP_X_API_SIGNATURE_SHA256'];
        
        $amount_currency = $request->input('bill.amount.currency');;
        $amount_value = $request->input('bill.amount.value');
        $billId = $request->input('bill.billId');
        $siteId = $request->input('bill.siteId');
        $status_value = $request->input('bill.status.value');
    
        $invoice_parameters = $amount_currency . '|' . $amount_value . '|' . $billId . '|' . $siteId . '|' . $status_value;
    
        $sha256_hash = hash_hmac('sha256', $invoice_parameters, base64_decode($secret_key));
    
        if ($sha256_hash_header == $sha256_hash && !empty($sha256_hash_header)) {
            $order = Order::where('bill_id', '=', $billId);

            $order->status_payment = $status_value;

            $order->save();

            return response()->json([], 200);
        } else {
            return response()->json([], 404);
        }
    }

Route
Route::post('/update-status-payment', '[email protected]');

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
part_os, 2020-09-06
@dragonika8

Make a product with a minimum transfer price, for example, 5 rubles and test it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question