How to use the @storefront-api/lib/util.sgnSrc function in @storefront-api/lib

To help you get started, we’ve selected a few @storefront-api/lib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DivanteLtd / storefront-api / src / modules / default-vsf / api / product.ts View on Github external
result.items = result.items.map((item) => {
        let sgnObj = item
        if (config.tax.calculateServerSide === true) {
          sgnObj = { priceInclTax: item.price_info.final_price }
        } else {
          sgnObj = { price: item.price_info.extension_attributes.tax_adjustments.final_price }
        }

        item.sgn = hmac.sign(sgnSrc(sgnObj, item), config.objHashSecret); // for products we sign off only price and id becase only such data is getting back with orders
        return item
      })
      apiStatus(res, result, 200);