Need to make a HMAC-SHA256

Hello, I am trying to integrate a Chilean Payment Gateway (Khiphu) through Bubble’s API Connector plugin. Khipu’s API uses a header authentification through a Hash string created with the amount payed, a secret key, a identifier key and the currency, it then converts this string to HMAC-SHA256. would greatly appreciate your help in making this possible, it is crucial for my app.

Can I create formulas on the “Design” end of my app and simply send the text to my API through there? If so, how can I do this and is this safe?

I attach some screenshots of examples in PHP and Java for making this Hash.

PHP:

JAVA:

Thank you very much!

You can use the plugin ToolBox. It’s got a workflow action called ‘Server script’, with which you can use Node.js’s built-in modules ‘crypto’ and ‘buffers’:

var crypto = require('crypto')
  , text = 'I love cupcakes'
  , key = 'abcdeghi'
  , hash;

var hash = crypto.createHmac('sha256', key).update(text).digest('hex');
4 Likes