razorpay / razorpay-php

Razorpay PHP Library
MIT License
180 stars 124 forks source link

Order ID not getting with Payment Link #372

Open jishadp opened 5 months ago

jishadp commented 5 months ago

Steps to reproduce the behavior

Create a payment link with $api->paymentLink->create([]); and fetch the link with $order = $api->paymentLink->fetch($response->id);

Expected behavior

Order ID should get in response

Actual behavior

The order ID is not getting in this response.

Code snippets

`$booking = Booking::find($event->booking->id);

        $api = new Api($apiKey, $apiSecret);

        $response = $api->paymentLink->create([
            'amount'=>10000,
            'currency'=>'INR',
            'expire_by' => strtotime('+18 minutes', time()),
            'reference_id' => $booking->reference."_".time(),
            'description' => 'KarCare Payment for '.$booking->reference,
            'customer' => [
                'name'=>'KarCare User',
                'email' => 'karkareapp@gmail.com',
                'contact'=>'+91'.$booking->user->mobile],
                'notify'=>
                ['sms'=>true, 'email'=>true] ,
            'reminder_enable'=>true ,
            'notes'=>['policy_name'=> 'KarCare'],
            'callback_url' => env('FE_URL').'my-bookings',
            'callback_method'=>'get'
        ]);
        info(collect($response));
        $booking->update([
            'razorpay_payment_link' => $response->short_url,
        ]);
        $order = $api->paymentLink->fetch($response->id);
        info(collect($order));`

Php version

8.3

Library version

"razorpay/razorpay": "^2.9",

Additional Information

No response