@delopay/sdk 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,3 +1,10 @@
1
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
2
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
3
+ }) : x)(function(x) {
4
+ if (typeof require !== "undefined") return require.apply(this, arguments);
5
+ throw Error('Dynamic require of "' + x + '" is not supported');
6
+ });
7
+
1
8
  // src/error.ts
2
9
  var DelopayError = class extends Error {
3
10
  constructor(message, options) {
@@ -2052,7 +2059,6 @@ var Verification = class {
2052
2059
  };
2053
2060
 
2054
2061
  // src/resources/webhooks.ts
2055
- import crypto from "crypto";
2056
2062
  var Webhooks = {
2057
2063
  /**
2058
2064
  * Verify the signature of an incoming Delopay webhook and return the parsed event.
@@ -2094,6 +2100,7 @@ var Webhooks = {
2094
2100
  throw new Error("Invalid webhook timestamp");
2095
2101
  }
2096
2102
  const signature = signaturePart.slice(3);
2103
+ const crypto = __require("crypto");
2097
2104
  const signedPayload = `${timestamp}.${rawBody}`;
2098
2105
  const expected = crypto.createHmac("sha256", secret).update(signedPayload).digest("hex");
2099
2106
  const sigBuf = Buffer.from(signature);