@swp/pay-sdk
Advanced tools
Comparing version 0.0.9 to 0.0.11
@@ -10,5 +10,3 @@ { | ||
], | ||
"package-specs": { | ||
"module": "commonjs" | ||
}, | ||
"package-specs": ["es6", "commonjs"], | ||
"suffix": ".js", | ||
@@ -15,0 +13,0 @@ "bs-dependencies": [], |
@@ -6,4 +6,5 @@ 'use strict'; | ||
var RequestPromiseNative = require('request-promise-native'); | ||
var Crypto = require('crypto'); | ||
var Events = require('events'); | ||
var CryptoJs = require('crypto-js'); | ||
var EncBase64 = require('crypto-js/enc-base64'); | ||
@@ -45,3 +46,3 @@ var max = 2147483647; | ||
var port = 8081; | ||
var port = 8080; | ||
@@ -394,6 +395,5 @@ var ping = "/ping"; | ||
var timestamp = String(floor(Date.now() / 1000.0)); | ||
var hmac = Crypto.createHmac("sha384", secret); | ||
hmac.update(timestamp + (path + body)); | ||
var signature = hmac.digest("base64"); | ||
headers["X-Swp-ApiKey"] = apiKey; | ||
var hmac = CryptoJs.HmacSHA384(timestamp + (path + body), secret); | ||
var signature = EncBase64.stringify(hmac); | ||
headers["X-Swp-Api-Key"] = apiKey; | ||
headers["X-Swp-Signature"] = signature; | ||
@@ -517,3 +517,3 @@ headers["X-Swp-Timestamp"] = timestamp; | ||
} | ||
/* crypto Not a pure module */ | ||
/* events Not a pure module */ | ||
@@ -520,0 +520,0 @@ exports.checkoutEvents = checkoutEvents; |
{ | ||
"name": "@swp/pay-sdk", | ||
"version": "0.0.9", | ||
"version": "0.0.11", | ||
"main": "dist/main", | ||
@@ -35,2 +35,3 @@ "private": false, | ||
"dependencies": { | ||
"crypto-js": "^3.1.9-1", | ||
"request": "^2.87.0", | ||
@@ -37,0 +38,0 @@ "request-promise-native": "^1.0.5" |
@@ -5,5 +5,5 @@ import commonjs from 'rollup-plugin-commonjs' | ||
export default { | ||
input: 'lib/js/src/SwpPaySdk.js', | ||
input: 'lib/es6/src/SwpPaySdk.js', | ||
output: { | ||
file: './dist/main.js', | ||
file: 'dist/main.js', | ||
format: 'cjs' | ||
@@ -13,3 +13,3 @@ }, | ||
commonjs({ | ||
include: ["lib/js/src/SwpPaySdk.js", "node_modules/bs-platform"] | ||
include: ["node_modules/bs-platform"] | ||
}), | ||
@@ -16,0 +16,0 @@ nodeResolve({ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
45608
3
1052
+ Addedcrypto-js@^3.1.9-1
+ Addedcrypto-js@3.3.0(transitive)