New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

paypal-nvp-api

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

paypal-nvp-api - npm Package Compare versions

Comparing version 0.1.26 to 0.1.28

6

index.js

@@ -0,2 +1,8 @@

/**
* Starting app
* @ndaidong
**/
'use strict';
exports = module.exports = require('./src/paypal-nvp-api');
exports.version = require('./package').version;

2

package.json
{
"version": "0.1.26",
"version": "0.1.28",
"name": "paypal-nvp-api",

@@ -4,0 +4,0 @@ "description": "Node.js wrapper for the Paypal Name-Value Pair — NVP ",

@@ -19,18 +19,19 @@ /**

let s = '';
if(bella.isString(data)){
if (bella.isString(data)) {
s = data;
}
else if(bella.isArray(data) || bella.isObject(data)){
} else if (bella.isArray(data) || bella.isObject(data)) {
let ar = [];
for(let k in data){
let val = data[k];
if(bella.isString(val)){
val = bella.encode(val);
for (let k in data) {
if (bella.hasProperty(data, k)) {
let val = data[k];
if (bella.isString(val)) {
val = bella.encode(val);
} else if (bella.isArray(val) || bella.isObject(val)) {
val = JSON.stringify(val);
}
ar.push(bella.encode(k) + '=' + val);
}
else if(bella.isArray(val) || bella.isObject(val)){
val = JSON.stringify(val);
}
ar.push(bella.encode(k) + '=' + val);
}
if(ar.length > 0){
if (ar.length > 0) {
s = ar.join('&');

@@ -40,6 +41,6 @@ }

return s;
}
};
var parse = (s) => {
if(!bella.isString(s)){
if (!bella.isString(s)) {
return s;

@@ -51,6 +52,6 @@ }

let a = ss.split('&');
if(a.length > 0){
if (a.length > 0) {
a.forEach((item) => {
let b = item.split('=');
if(b.length === 2){
if (b.length === 2) {
d[b[0]] = b[1];

@@ -61,13 +62,13 @@ }

return d;
}
};
var formatCurrency = (num) => {
let n = Number(num);
if(!n || !bella.isNumber(n) || n < 0){
if (!n || !bella.isNumber(n) || n < 0) {
return '0.00';
}
return n.toFixed(2).replace(/./g, (c, i, a) => {
return i && c !== '.' && ((a.length - i) % 3 === 0) ? ',' + c : c;
return i && c !== '.' && (a.length - i) % 3 === 0 ? ',' + c : c;
});
}
};

@@ -88,3 +89,3 @@ var Paypal = (opts) => {

VERSION: version
}
};

@@ -106,3 +107,3 @@ let sendRequest = (method, params) => {

}, (err, response, body) => {
if(err){
if (err) {
return reject(err);

@@ -114,9 +115,9 @@ }

});
}
};
return {
request: sendRequest,
formatCurrency: formatCurrency
}
}
};
};
module.exports = Paypal;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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