feat(compatibility): add support for stripe compatible webhooks #1728
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Type of Change
Description
Add signing support for stripe compatibility layer. So when the merchant registers the stripe compatible webhook url he would get a stripe compatible webhook.
Additional Changes
Motivation and Context
How did you test it?
Registered stripe compatible webhook on stripe dashboard. Once router received the webhook from stripe it triggered another webhook to the same router , same merchant and the source got verified successfully. So outgoing and incoming stripe compatibility webhook is checked.
The webhook was received at stripe compatible endpoint webhook has been sent to merchant, but merchant wasn't able to handle it so error (because I did not provision for that)
![image](https://private-user-images.githubusercontent.com/68317979/253927711-133904b0-f95e-4d09-b3d4-912be2c511dc.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM5OTA2MzAsIm5iZiI6MTcyMzk5MDMzMCwicGF0aCI6Ii82ODMxNzk3OS8yNTM5Mjc3MTEtMTMzOTA0YjAtZjk1ZS00ZDA5LWIzZDQtOTEyYmUyYzUxMWRjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE4VDE0MTIxMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTFhMzY4NjIyNTVkOGVkMWY4NGE3NDAwYzFiYTkxZmVkMTgwZTYwMjkxODQ1OGMzNzhkNjI3YjM4ZjJhYTQ0NzcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.a6g0sA4nw0cVsdPIMzM1qQaI89S7TeCBgM4PWpouGNc)
On the merchant app, the webhook was received from hyperswitch and the source was verified which means the compatibility layer signed properly.
![image](https://private-user-images.githubusercontent.com/68317979/253927981-1f500c92-daf7-426e-a019-c09669342e42.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM5OTA2MzAsIm5iZiI6MTcyMzk5MDMzMCwicGF0aCI6Ii82ODMxNzk3OS8yNTM5Mjc5ODEtMWY1MDBjOTItZGFmNy00MjZlLWEwMTktYzA5NjY5MzQyZTQyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE4VDE0MTIxMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWYwMGI1OWJlYzNjNTljMGZiNWU2ZDk5ZTNlOTlmMDllYjQyOTIxMmI4ZTY4NGU5YWI1ZDc3ZjFlZTViOGU1MzEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.aMrjQbVWugJ79ImmDWfxCKl8xj7Oz6e5ik1Zai8RWpA)
Checklist
cargo +nightly fmt --all
cargo clippy