Skip to content

Fix signature verification when using OAuth token authentication#389

Open
haris-5hah wants to merge 3 commits intorazorpay:masterfrom
haris-5hah:fix-oauth-signature-verification
Open

Fix signature verification when using OAuth token authentication#389
haris-5hah wants to merge 3 commits intorazorpay:masterfrom
haris-5hah:fix-oauth-signature-verification

Conversation

@haris-5hah
Copy link
Copy Markdown

Fix signature verification when using OAuth token authentication

Description

This PR addresses an issue with signature verification when the API is instantiated with an OAuth token instead of a key/secret pair. The current implementation fails because it relies on Api::getSecret() which returns null when using OAuth token authentication.

Changes

  • Modified verifyPaymentSignature to accept a secret in the attributes when using OAuth tokens
  • Updated verifyWebhookSignature to make the secret parameter optional and handle OAuth token scenarios
  • Added validation to ensure a secret is always available for signature verification
  • Properly namespaced Exception class references

Testing

Tested signature verification with both standard key/secret auth and OAuth token auth.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant