'undefined index Razorpay_orderid

when I use webview my app is giving me err undefined index razoprpay_orderid. and in web application it is working fine. here are lines of code . on first line it gives err.

$razorpay_order = $_SESSION['razorpay_order_id'];

if (empty($_POST['razorpay_payment_id']) === false)
 {
$api = new Api($keyId, $keySecret);

try
{
    // Please note that the razorpay order ID must
    // come from a trusted source (session here, but
    // could be database or something else)

    $attributes = array(
              
        'razorpay_order_id' => $_SESSION['razorpay_order_id'],
        
        'razorpay_payment_id' => $_POST['razorpay_payment_id'],
        'razorpay_signature' => $_POST['razorpay_signature']
    );

    $api->utility->verifyPaymentSignature($attributes);
}
catch(SignatureVerificationError $e)
{
    $success = false;
    $error = 'Razorpay Error : ' . $e->getMessage();
}

}



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source