I need to make cURL for razorpay Order Id
i need to make this api work in laravel 8
CodePudding user response:
by using the code below you can build the Needed cURL
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use GuzzleHttp\Client;
use Illuminate\Support\Facades\Http;
class PayController extends Controller
public function order(Request $request)
{
$key = "YOUR API KEY";
$secret = "YOUR API SECRET";
$receipt = "unique recipt no"
$amount = "1000"
$currency = "INR"
$client = new Client();
$response = Http::withBasicAuth($key,$secret)
->post('https://api.razorpay.com/v1/orders',
[
'receipt'=> $receipt,
'amount'=> $amount,
'currency'=> $currency
]
);