Issue
I need to make cURL for razorpay Order Id src="https://i.stack.imgur.com/pK4xc.png" alt="the postman of api" />
i need to make this api work in laravel 8
Solution
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
]
);
Answered By - Shafi Asharaf Answer Checked By - Candace Johnson (WPSolving Volunteer)