Discussions

Ask a Question
Back to All

Need help in generating webhook signature from source.chargeable event request

Header received in a request...
"Paymongo-Signature": "t=1620901532,te=0c6fcee4abf200e6b8858c2b6fc5f773c3920e1087f9cb4c4d67d4c7212dbe7d,li=",

payload received:
"body": "{"data":{"id":"evt_kVBbtHrJcsHSNC2oAKoGcjsL","type":"event","attributes":{"type":"source.chargeable","livemode":false,"data":{"id":"src_MGZPYvicoDMSQrv7tbn7tGjR","type":"source","attributes":{"amount":15500,"billing":{"address":{"city":"Bengaluru","country":null,"line1":"","line2":"Marine Drive, Benga","postal_code":null,"state":"Karnataka"},"email":"[email protected]","name":"Shashi Kant","phone":"6203362289"},"currency":"PHP","livemode":false,"redirect":{"checkout_url":"https://test-sources.paymongo.com/sources?id=src_MGZPYvicoDMSQrv7tbn7tGjR\",\"failed\":\"http://localhost:3000/checkout\",\"success\":\"http://localhost:3000/checkout\"},\"status\":\"chargeable\",\"type\":\"grab_pay\",\"created_at\":1620901511,\"updated_at\":1620901514}},\"previous_data\":{},\"created_at\":1620901514,\"updated_at\":1620901514}}}",

trying to create a signature
sign = "1620901532.{"data":{"id":"evt_kVBbtHrJcsHSNC2oAKoGcjsL","type":"event","attributes":{"type":"source.chargeable","livemode":false,"data":{"id":"src_MGZPYvicoDMSQrv7tbn7tGjR","type":"source","attributes":{"amount":15500,"billing":{"address":{"city":"Bengaluru","country":null,"line1":"","line2":"Marine Drive, Benga","postal_code":null,"state":"Karnataka"},"email":"[email protected]","name":"Shashi Kant","phone":"6203362289"},"currency":"PHP","livemode":false,"redirect":{"checkout_url":"https://test-sources.paymongo.com/sources?id=src_MGZPYvicoDMSQrv7tbn7tGjR\",\"failed\":\"http://localhost:3000/checkout\",\"success\":\"http://localhost:3000/checkout\"},\"status\":\"chargeable\",\"type\":\"grab_pay\",\"created_at\":1620901511,\"updated_at\":1620901514}},\"previous_data\":{},\"created_at\":1620901514,\"updated_at\":1620901514}}}

after running this with sha256 hash function the test-part in the paymongo-signature header does not match?

Need help as to what is the action raw json payload of the api request