icelander
1148
1
Laravel

json_decode() expects parameter 1 to be string, array given

Posted 11 months ago by icelander

below is my controller: public function handleGatewayCallback(Request $request) { $paymentDetails = Paystack::getPaymentData(); $paydetail = json_decode($paymentDetails); $banks_data = json_decode($paydetail, true);

    foreach($banks_data as $bank) { 
        $payment_bank = FixedPayment::create([
            'amount' => json_decode($bank['amount']),
            
        ]);
    }

pls help.

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.