芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/portpulselogistics.com/Modules/Cargo/Http/Controllers/RazorpayController.php
toArray(); $razorpay_payment = json_decode($paymentSettings['razorpay'], true); //Input items of form $input = $request->all(); //get API Configuration $api = new Api($razorpay_payment['RAZOR_KEY'],$razorpay_payment['RAZOR_SECRET']); //Fetch payment information by razorpay_payment_id $payment = $api->payment->fetch($input['razorpay_payment_id']); if(count($input) && !empty($input['razorpay_payment_id'])) { $payment_detalis = null; try { $response = $api->payment->fetch($input['razorpay_payment_id'])->capture(array('amount'=>$payment['amount'])); $payment_detalis = json_encode(array('id' => $response['id'],'method' => $response['method'],'amount' => $response['amount'],'currency' => $response['currency'])); } catch (\Exception $e) { return $e->getMessage(); \Session::put('error',$e->getMessage()); return redirect()->back(); } // Do something here for store payment details in database... // if(Session::has('payment_type')){ // if(Session::get('payment_type') == 'cart_payment'){ $checkoutController = new CheckoutController; return $checkoutController->checkout_done(null,$payment_detalis,$request->shipment_id); // } // elseif (Session::get('payment_type') == 'wallet_payment') { // $walletController = new WalletController; // return $walletController->wallet_payment_done(Session::get('payment_data'), $payment_detalis); // } // elseif (Session::get('payment_type') == 'customer_package_payment') { // $customer_package_controller = new CustomerPackageController; // return $customer_package_controller->purchase_payment_done(Session::get('payment_data'), $payment); // } // elseif (Session::get('payment_type') == 'seller_package_payment') { // $seller_package_controller = new SellerPackageController; // return $seller_package_controller->purchase_payment_done(Session::get('payment_data'), $payment); // } // } } } }