Jump to content

Webhooks and Security for Pay-later payment method


Gemma
 Share

Recommended Posts

Hi,

I'm currently building a solution to add "Pay Later" functionality in Loyverse Pos. I'm using the service of Klarna In-Store for this, which is specifically designed for physical stores.  

My current solution works by adding a Klarna-payment method inside Loyverse. A receipts.update webhook triggers the integration with Klarna and creates a new payment-session with a copy of the receipt inside Klarna. A separate web interface allows to complete the payment method, by sending a form to the users phone (email/phone/QR). (They have to fill it in for credit-checks etc.) Also refund-receipts are synchronised to Klarna, so the customer only has to pay for what they keep. 

 

Now I want to validate the webhook for security, but it seems the mentioned headers are not sent currently.
Also the validation algorithm seems to be missing from the docs;

https://developer.loyverse.com/docs/#section/Webhooks-overview/Validate-notifications

 

Any information about this?

Link to comment
Share on other sites

Posted (edited)
3 hours ago, Jay Rock said:

Webhook was created  by token created by Oauth2 authorization?

Hmm, I did not. I created it from the Loyverse dashboard  

That could be a difference indeed, I will test again. Thanks! 

Edited by Gemma
Link to comment
Share on other sites

I created the webhook using the api, authenticated with OAuth2 and it works now! Thanks again.

I was able to validate the webhook using the following PHP-function;

hash_hmac('sha1', $data, $key, false)

 

Link to comment
Share on other sites

 Share

Loyverse Point of Sale

 

 

 

 

×
×
  • Create New...