Giter Club home page Giter Club logo

Comments (9)

captn3m0 avatar captn3m0 commented on August 11, 2024

Which package version are you currently at?

from razorpay-php.

hari-web avatar hari-web commented on August 11, 2024

@captn3m0 2.*
"razorpay/razorpay": "2.*"

from razorpay-php.

captn3m0 avatar captn3m0 commented on August 11, 2024

@phpnets Can you give us the output of composer show|grep razorpay to give us the exact version?

from razorpay-php.

hari-web avatar hari-web commented on August 11, 2024

@captn3m0 the version is 2.0.2

from razorpay-php.

captn3m0 avatar captn3m0 commented on August 11, 2024

How are you reading the request JSON body?

from razorpay-php.

hari-web avatar hari-web commented on August 11, 2024

@captn3m0
I used below both methods both return the same (this is a Laravel project)

$requestBody 	   =  json_encode($oRequest->toArray());
OR
$requestBody 	   = $oRequest->getContent();

the $requestBody contains data I described in the question above

for header I used this code:

$razorPaySignature = $oRequest->header('X-Razorpay-Signature');

from razorpay-php.

captn3m0 avatar captn3m0 commented on August 11, 2024
  1. Looks like you are trying to verify the webhook signature using the Key Secret. You must use the webhook secret that you have specified while setting up the webhook
  2. Please make sure you are getting the raw request body correctly. Our webhook requests do not contain newlines.

from razorpay-php.

hari-web avatar hari-web commented on August 11, 2024

@captn3m0
Yeah, the new key secret was not updated with webhook. Now It is okay. And could you please clarify that the validation will not return true if it success ? So the try catch is enough to catch the unmatched hash?

try{
    	 $oApi->utility->verifyWebhookSignature($requestBody, $razorPaySignature, $this->RAZOR_PAY_SECRET_KEY) 
    }
    catch(Exception $e) {
    	Log::info('RazorPay Webhook validation Error: '.$e->getMessage());
    	die;
    }

Thank you for you support.

from razorpay-php.

captn3m0 avatar captn3m0 commented on August 11, 2024

Yes, we throw Razorpay\Errors\SignatureVerificationError in case the signature validation fails. The method will always return null

from razorpay-php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.