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

dark-payment

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dark-payment - npm Package Compare versions

Comparing version 0.1.4-beta.2 to 0.1.5

lib/connectors/darkGift/index.js

2

index.js

@@ -1,1 +0,1 @@

module.exports = require('./lib/payment-client.js');
module.exports = require('./lib/payment-client.js');

@@ -9,3 +9,2 @@ const model = require('./model');

if (data.message) client.ccToken = data.message;
console.log('data.message =>', data.message);
} catch (e) {

@@ -12,0 +11,0 @@ // console.log("cardConenct listener => ", e.message);

@@ -64,3 +64,2 @@ //

success(tokenResponse) {
console.log(tokenResponse);
if (fn) fn('success', tokenResponse.token);

@@ -67,0 +66,0 @@ self.cayanClient.restore();

@@ -12,2 +12,5 @@ const importFile = require;

cayan: null,
payroc: null,
payrocACH: null,
darkGift: null,
};

@@ -92,2 +95,3 @@

) {
if (!this.client.customerTokenCreate) throw new Error('Customer token is not supported!');
return new Promise((resolve, reject) =>

@@ -94,0 +98,0 @@ this.client.customerTokenCreate(customerToken, source, (status, data) => {

@@ -13,7 +13,6 @@ const request = require('axios');

contentType: 'application/json',
apisignature: encryptByGCM(`${apiAccountId}.${apiSecretKey}`, darkApiSecretKey),
'x-darkpos-api-signature': encryptByGCM(`${apiAccountId}.${apiSecretKey}`, darkApiSecretKey),
};
payload.data = source;
console.log(payload);
request(payload)

@@ -24,3 +23,2 @@ .then(res => {

response = response.data || {};
console.log(response);
if (status === 'error') throw new Error(response.message);

@@ -38,4 +36,43 @@

//
const getGitCardToken = (
{ apiAccountId, apiSecretKey, darkApiUrl, darkApiSecretKey, card, partner, usePin },
fn
) => {
const query = { partner };
if (card.number) query['sources.number'] = card.number;
if (card.pin && usePin) query['sources.pin'] = card.pin;
return request({
url: `${darkApiUrl}/wallet/query`,
method: 'POST',
headers: {
contentType: 'application/json',
'x-darkpos-api-signature': encryptByGCM(`${apiAccountId}.${apiSecretKey}`, darkApiSecretKey),
},
data: { query },
})
.then(res => {
const response = res.data || {};
const { status } = response;
if (status === 'error') throw new Error(response.message);
const wallet = Array.isArray(response.data) && response.data.length && response.data[0];
if (!wallet || !Array.isArray(wallet.sources) || !wallet.sources[0])
throw new Error('No gift card found.');
const source = wallet.sources[0];
fn('success', source._id);
})
.catch(err => {
fn(
'error',
(err.response && err.response.data && err.response.data.message) ||
err.message ||
'Issue with server'
);
});
};
module.exports = {
addWalletSource,
getGitCardToken,
};
{
"name": "dark-payment",
"version": "0.1.4-beta.2",
"version": "0.1.5",
"description": "Provide payment client",

@@ -9,7 +9,2 @@ "main": "index.js",

},
"homepage": "https://gitlab.com/darkpos/dark-payment#README",
"repository": {
"type": "git",
"url": "git@gitlab.com:darkpos/dark-payment.git"
},
"author": "DarkPOS Dev Team",

@@ -36,2 +31,2 @@ "license": "ISC",

}
}
}
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