⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.1
Server IP:
185.238.29.86
Server:
Linux server2 6.8.12-6-pve #1 SMP PREEMPT_DYNAMIC PMX 6.8.12-6 (2024-12-19T19:05Z) x86_64
Server Software:
nginx/1.18.0
PHP Version:
8.1.31
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
var
/
www
/
dnc
/
@core
/
app
/
PaymentGateway
/
Gateways
/
View File Name :
Razorpay.php
<?php namespace App\PaymentGateway\Gateways; use App\PaymentGateway\PaymentGatewayBase; use Razorpay\Api\Api; class Razorpay extends PaymentGatewayBase { /** * this payment gateway will not work with this package * @ https://github.com/razorpay/razorpay-php * */ public function charge_amount($amount) { // TODO: Implement charge_amount() method. if (in_array(self::global_currency(), $this->supported_currency_list())){ return $amount; } return self::get_amount_in_inr($amount); } /** * * @param array $args * require param list * request * @return array|string[] * */ public function ipn_response(array $args) { // TODO: Implement ipn_response() method. $request = $args['request']; //get API Configuration $api = new Api(get_static_option('razorpay_key'), get_static_option('razorpay_secret')); //Fetch payment information by razorpay_payment_id $payment = $api->payment->fetch($request->razorpay_payment_id); if (!empty($request->razorpay_payment_id)) { try { $response = $api->payment->fetch($request->razorpay_payment_id)->capture(array('amount' => $payment['amount'])); return $this->verified_data([ 'status' => 'complete', 'transaction_id' => $payment->id ]); } catch (\Exception $e) { return ['status' => 'failed']; } } return ['status' => 'failed']; } /** * * @param array $args * @paral list * price * title * description * route * order_id * * @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\View\View */ public function charge_customer(array $args) { // TODO: Implement charge_customer() method. $razorpay_data['currency'] = $this->charge_currency(); $razorpay_data['price'] = $this->charge_amount($args['price']); $razorpay_data['title'] = $args['title']; $razorpay_data['description'] = $args['description']; $razorpay_data['route'] = $args['route']; $razorpay_data['order_id'] = $args['order_id']; return view('payment.razorpay')->with('razorpay_data', $razorpay_data); } public function supported_currency_list() { // TODO: Implement supported_currency_list() method. return ['INR']; } public function charge_currency() { // TODO: Implement charge_currency() method. if (in_array(self::global_currency(), $this->supported_currency_list())){ return self::global_currency(); } return "INR"; } public function gateway_name() { // TODO: Implement geteway_name() method. return 'razorpay'; } }