title: How to fetch payment details using Razorpay PHP API?
body: <p>I am trying to integrate the code for fetching payment details. </p>
  
  <blockquote>
    <p>billno: This value will be taken from the URL.</p>
  </blockquote>
  
  <p>My current code:</p>
  
  <pre><code>include 'razorpay/Razorpay.php';
  use Razorpay\Api\Api;
  
  $api = new Api('Secret ID', 'Secret Key');
  
  $payment = $api-&gt;payment-&gt;fetch($_REQUEST['billno']);
  $text =  json_encode($payment-&gt;toArray());
  $obj = json_decode($text);
  $shopping_id = $obj-&gt;{'notes'}-&gt;{'shopping_id'};
  
  $rzp_amount = $obj-&gt;{'amount'};//xheck
  $real_amount = $rzp_amount/100;
  $rzp_key = $obj-&gt;{'id'};
  $rzp_status = $obj-&gt;{'status'}; //Authorised cgecj
  $rzp_descp = $obj-&gt;{'description'};
  $rzp_mail = $obj-&gt;{'email'};
  $rzp_phone = $obj-&gt;{'contact'};
  $rzp_address = $obj-&gt;{'notes'}-&gt;{'address'};
  $rzp_timestamp = $obj-&gt;{'created_at'};
  $rzp_method = $obj-&gt;{'method'};
  </code></pre>
  
  <p>Extracting the billno using the code would give us the above mentioned $rzp variables.</p>