Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bankid

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bankid - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

24

bankid.js

@@ -55,3 +55,3 @@ const path = require('path');

if (callback) callback(err, res);
if (err) reject(err);

@@ -64,2 +64,23 @@ else resolve(res);

authenticateAndCollect(pno, refreshInterval=1000) {
return new Promise((resolve, reject) => {
this.authenticate(pno)
.then(({ orderRef }) => {
const timer = setInterval(() => {
this.collect(orderRef)
.then(res => {
if (res.progressStatus === 'COMPLETE') {
clearInterval(timer);
resolve(res.userInfo);
}
})
.catch(err => {
clearInterval(timer);
reject(err);
});
}, refreshInterval);
}, reject);
});
}
_createClient() {

@@ -74,3 +95,2 @@ const pfx = fs.readFileSync(path.resolve(__dirname, 'FPTestcert2_20150818_102329.pfx'));

return new Promise((resolve, reject) => {
console.log('creating client');
soap.createClient(wsdlUrl, { wsdl_options: wsdlOptions }, (err, client) => {

@@ -77,0 +97,0 @@ if (err) {

42

index.js

@@ -6,22 +6,30 @@ const BankId = require('./bankid');

bankid.authenticate(pno).then(res => {
bankid.authenticateAndCollect(pno)
.then(res => {
console.log(res);
})
.catch(err => {
console.log(res);
});
// bankid.authenticate(pno).then(res => {
// console.log(res);
const timer = setInterval(() => {
const done = () => clearInterval(timer);
// const timer = setInterval(() => {
// const done = () => clearInterval(timer);
bankid.collect(res.orderRef)
.then(res => {
console.log(res.progressStatus);
// bankid.collect(res.orderRef)
// .then(res => {
// console.log(res.progressStatus);
if (res.progressStatus === 'COMPLETE') {
console.log(res.userInfo);
done();
}
})
.catch(err => {
console.log(err.toString());
done();
})
}, 1000);
});
// if (res.progressStatus === 'COMPLETE') {
// console.log(res.userInfo);
// done();
// }
// })
// .catch(err => {
// console.log(err.toString());
// done();
// })
// }, 1000);
// });
{
"name": "bankid",
"description": "",
"version": "0.0.4",
"version": "0.0.5",
"main": "bankid.js",

@@ -6,0 +6,0 @@ "repository": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc