<?php

namespace App\Http\Controllers;

use App\Models\NagadIpn;
use Illuminate\Http\Request;

class NagadIpnController extends Controller
{
    public function save(Request $request){

      
        try{
            $nagad_ipn = new NagadIpn();
            $nagad_ipn->callback_response = $request->callback_response;
            $nagad_ipn->save();

            return response()->json([
                'status' => 'Success',
                'message' => 'Nagad IPN saved successfully'
            ]);

        }catch(\Exception $e){
            return response()->json([
                'status' => 'Failed',
                'message' => $e->getMessage()
            ]);
        }
    }
}
