fraudlabspro-nodejs
Advanced tools
+1
-1
| MIT License | ||
| Copyright (c) 2022 FraudLabs Pro | ||
| Copyright (c) 2024 FraudLabs Pro | ||
@@ -5,0 +5,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy |
+1
-1
| { | ||
| "name": "fraudlabspro-nodejs", | ||
| "version": "2.2.0", | ||
| "version": "3.0.0", | ||
| "description": "FraudLabs Pro Node.js module enables users to easily implement fraud detection feature using the FraudLabs Pro API.", | ||
@@ -5,0 +5,0 @@ "keywords": ["fraud prevention", "fraud detection", "fraud checker", "fraudlabs pro", "fraudlabspro", "fraud protection"], |
+49
-53
| var https = require('https'); | ||
| var crypto = require('crypto'); | ||
| var VERSION = '2.2.0'; | ||
| var VERSION = '3.0.0'; | ||
| var SOURCE = 'sdk-nodejs'; | ||
@@ -32,36 +32,45 @@ var FORMAT = 'json'; | ||
| flp_checksum: 'flp_checksum' in params ? params['flp_checksum'] : '', | ||
| }; | ||
| // Billing information | ||
| last_name: (typeof(params['billing']['last_name']) !== 'undefined') ? params['billing']['last_name'] : '', | ||
| first_name: (typeof(params['billing']['first_name']) !== 'undefined') ? params['billing']['first_name'] : '', | ||
| bill_addr: (typeof(params['billing']['address']) !== 'undefined') ? params['billing']['address'] : '', | ||
| bill_city: (typeof(params['billing']['city']) !== 'undefined') ? params['billing']['city'] : '', | ||
| bill_state: (typeof(params['billing']['state']) !== 'undefined') ? params['billing']['state'] : '', | ||
| bill_country: (typeof(params['billing']['country']) !== 'undefined') ? params['billing']['country'] : '', | ||
| bill_zip_code: (typeof(params['billing']['zip_code']) !== 'undefined') ? params['billing']['zip_code'] : '', | ||
| user_phone: (typeof(params['billing']['phone']) !== 'undefined') ? params['billing']['phone'] : '', | ||
| email: (typeof(params['billing']['email']) !== 'undefined') ? params['billing']['email'] : '', | ||
| // Billing information | ||
| if (typeof(params['billing']) === 'undefined') { | ||
| params['billing'] = {}; | ||
| } | ||
| data.last_name = (typeof(params['billing']['last_name']) !== 'undefined') ? params['billing']['last_name'] : ''; | ||
| data.first_name = (typeof(params['billing']['first_name']) !== 'undefined') ? params['billing']['first_name'] : ''; | ||
| data.bill_addr = (typeof(params['billing']['address']) !== 'undefined') ? params['billing']['address'] : ''; | ||
| data.bill_city = (typeof(params['billing']['city']) !== 'undefined') ? params['billing']['city'] : ''; | ||
| data.bill_state = (typeof(params['billing']['state']) !== 'undefined') ? params['billing']['state'] : ''; | ||
| data.bill_country = (typeof(params['billing']['country']) !== 'undefined') ? params['billing']['country'] : ''; | ||
| data.bill_zip_code = (typeof(params['billing']['zip_code']) !== 'undefined') ? params['billing']['zip_code'] : ''; | ||
| data.user_phone = (typeof(params['billing']['phone']) !== 'undefined') ? params['billing']['phone'] : ''; | ||
| data.email = (typeof(params['billing']['email']) !== 'undefined') ? params['billing']['email'] : ''; | ||
| // Shipping information | ||
| ship_last_name: (typeof(params['shipping']['last_name']) !== 'undefined') ? params['shipping']['last_name'] : '', | ||
| ship_first_name: (typeof(params['shipping']['first_name']) !== 'undefined') ? params['shipping']['first_name'] : '', | ||
| ship_addr: (typeof(params['shipping']['address']) !== 'undefined') ? params['shipping']['address'] : '', | ||
| ship_city: (typeof(params['shipping']['city']) !== 'undefined') ? params['shipping']['city'] : '', | ||
| ship_state: (typeof(params['shipping']['state']) !== 'undefined') ? params['shipping']['state'] : '', | ||
| ship_country: (typeof(params['shipping']['country']) !== 'undefined') ? params['shipping']['country'] : '', | ||
| ship_zip_code: (typeof(params['shipping']['zip_code']) !== 'undefined') ? params['shipping']['zip_code'] : '', | ||
| // Shipping information | ||
| if (typeof(params['shipping']) === 'undefined') { | ||
| params['shipping'] = {}; | ||
| } | ||
| data.ship_last_name = (typeof(params['shipping']['last_name']) !== 'undefined') ? params['shipping']['last_name'] : ''; | ||
| data.ship_first_name = (typeof(params['shipping']['first_name']) !== 'undefined') ? params['shipping']['first_name'] : ''; | ||
| data.ship_addr = (typeof(params['shipping']['address']) !== 'undefined') ? params['shipping']['address'] : ''; | ||
| data.ship_city = (typeof(params['shipping']['city']) !== 'undefined') ? params['shipping']['city'] : ''; | ||
| data.ship_state = (typeof(params['shipping']['state']) !== 'undefined') ? params['shipping']['state'] : ''; | ||
| data.ship_country = (typeof(params['shipping']['country']) !== 'undefined') ? params['shipping']['country'] : ''; | ||
| data.ship_zip_code = (typeof(params['shipping']['zip_code']) !== 'undefined') ? params['shipping']['zip_code'] : ''; | ||
| // Order information | ||
| user_order_id: (typeof(params['order']['order_id']) !== 'undefined') ? params['order']['order_id'] : '', | ||
| currency: (typeof(params['order']['currency']) !== 'undefined') ? params['order']['currency'] : 'USD', | ||
| amount: (typeof(params['order']['amount']) !== 'undefined') ? params['order']['amount'] : 0, | ||
| quantity: (typeof(params['order']['quantity']) !== 'undefined') ? params['order']['quantity'] : 0, | ||
| user_order_memo: (typeof(params['order']['order_memo']) !== 'undefined') ? params['order']['order_memo'] : '', | ||
| department: (typeof(params['order']['department']) !== 'undefined') ? params['order']['department'] : '', | ||
| payment_gateway: (typeof(params['order']['payment_gateway']) !== 'undefined') ? params['order']['payment_gateway'] : '', | ||
| payment_mode: (typeof(params['order']['payment_mode']) !== 'undefined') ? params['order']['payment_mode'] : '', | ||
| bin_no: (typeof(params['order']['bin_no']) !== 'undefined') ? params['order']['bin_no'] : '', | ||
| avs_result: (typeof(params['order']['avs_result']) !== 'undefined') ? params['order']['avs_result'] : '', | ||
| cvv_result: (typeof(params['order']['cvv_result']) !== 'undefined') ? params['order']['cvv_result'] : '', | ||
| }; | ||
| // Order information | ||
| if (typeof(params['order']) === 'undefined') { | ||
| params['order'] = {}; | ||
| } | ||
| data.user_order_id = (typeof(params['order']['order_id']) !== 'undefined') ? params['order']['order_id'] : ''; | ||
| data.currency = (typeof(params['order']['currency']) !== 'undefined') ? params['order']['currency'] : 'USD'; | ||
| data.amount = (typeof(params['order']['amount']) !== 'undefined') ? params['order']['amount'] : 0; | ||
| data.quantity = (typeof(params['order']['quantity']) !== 'undefined') ? params['order']['quantity'] : 0; | ||
| data.user_order_memo = (typeof(params['order']['order_memo']) !== 'undefined') ? params['order']['order_memo'] : ''; | ||
| data.department = (typeof(params['order']['department']) !== 'undefined') ? params['order']['department'] : ''; | ||
| data.payment_gateway = (typeof(params['order']['payment_gateway']) !== 'undefined') ? params['order']['payment_gateway'] : ''; | ||
| data.payment_mode = (typeof(params['order']['payment_mode']) !== 'undefined') ? params['order']['payment_mode'] : ''; | ||
| data.bin_no = (typeof(params['order']['bin_no']) !== 'undefined') ? params['order']['bin_no'] : ''; | ||
| data.avs_result = (typeof(params['order']['avs_result']) !== 'undefined') ? params['order']['avs_result'] : ''; | ||
| data.cvv_result = (typeof(params['order']['cvv_result']) !== 'undefined') ? params['order']['cvv_result'] : ''; | ||
@@ -115,3 +124,3 @@ // Item information | ||
| port: 443, | ||
| path: '/v1/order/screen', | ||
| path: '/v2/order/screen', | ||
| method: 'POST', | ||
@@ -164,3 +173,3 @@ headers: { | ||
| port: 443, | ||
| path: '/v1/order/feedback', | ||
| path: '/v2/order/feedback', | ||
| method: 'POST', | ||
@@ -199,3 +208,3 @@ headers: { | ||
| let urlStr = 'https://api.fraudlabspro.com/v1/order/result?'; | ||
| let urlStr = 'https://api.fraudlabspro.com/v2/order/result?'; | ||
@@ -257,3 +266,3 @@ Object.keys(data).forEach(function (key, index) { | ||
| port: 443, | ||
| path: '/v1/verification/send', | ||
| path: '/v2/verification/send', | ||
| method: 'POST', | ||
@@ -292,25 +301,14 @@ headers: { | ||
| let dataStr = ''; | ||
| let urlStr = 'https://api.fraudlabspro.com/v2/verification/result?'; | ||
| Object.keys(data).forEach(function (key, index) { | ||
| if (this[key] != '') { | ||
| dataStr += key + '=' + encodeURIComponent(this[key]) + '&'; | ||
| urlStr += key + '=' + encodeURIComponent(this[key]) + '&'; | ||
| } | ||
| }, data); | ||
| dataStr = dataStr.substring(0, dataStr.length - 1); | ||
| urlStr = urlStr.substring(0, urlStr.length - 1); | ||
| let options = { | ||
| hostname: 'api.fraudlabspro.com', | ||
| port: 443, | ||
| path: '/v1/verification/result', | ||
| method: 'POST', | ||
| headers: { | ||
| 'Content-Type': 'application/x-www-form-urlencoded', | ||
| 'Content-Length': Buffer.byteLength(dataStr), | ||
| }, | ||
| }; | ||
| let d = ''; | ||
| let req = https.request(options, function (res) { | ||
| let req = https.get(urlStr, function (res) { | ||
| res.on('data', (chunk) => (d = d + chunk)); | ||
@@ -322,4 +320,2 @@ res.on('end', function () { | ||
| req.write(dataStr); | ||
| req.end(); | ||
| req.on('error', function (e) { | ||
@@ -326,0 +322,0 @@ callback(e); |
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
26154
-0.93%324
-0.92%