Creates an instance of this class.
OAuth2 client secret for your integration.
Sets the HMAC secret. It won't be possible to sign anything without this secret.
OAuth2 client secret for your integration.
Signer to allow for convenient concatenation.
Signs a file asynchronously.
Path of the file to sign.
Path of the file where the signed result will be stored.
a function that should read from file
a function that should write to to file
a ParentNode object of the signed HTML.
Signs a whole HTML snippet.
HTML snippet to sign.
the HTML snippet signed.
Signs input name.
Name of the input element.
Product code.
Parent product code.
Input value.
the signed input name.
Signs a query string. All query fields withing the query string will be signed, provided it is a proper URL and there is a code field
Full URL including the query string that needs to be signed.
the signed query string.
Signs input value.
Name of the input element.
Product code.
Parent product code.
Input value.
the signed value.
Generated using TypeDoc
HMAC signing utility. Methods are named after what it is to be signed, to allow for an easy to read code in the user application.
https://wiki.foxycart.com/v/2.0/hmac_validation
const signer = new Signer(mySecret); // or const signer = new Signer(); signer.setSecret(mySecret); signer.signHtml('...'); // signs a URL signer.signFile("/var/www/html/src/.../index.html", "/var/www/html/target/.../index.html"); // signs an HTML file signer.signUrl("http://..."); // signs a URL