🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

fraudlabspro-nodejs

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fraudlabspro-nodejs

FraudLabs Pro Node.js module enables users to easily implement fraud detection feature using the FraudLabs Pro API.

Source
npmnpm
Version
2.1.0
Version published
Weekly downloads
648
-56.3%
Maintainers
1
Weekly downloads
 
Created
Source

npm npm

FraudLabs Pro Node.js SDK

This Node.js module enables user to easily implement fraud detection feature into their solution using the API from https://www.fraudlabspro.com.

Below are the features of this Node.js module:

  • Fraud analysis and scoring
  • IP address geolocation & proxy validation
  • Email address validation
  • Credit card issuing bank validation
  • Transaction velocity validation
  • Device transaction validation
  • Blacklist validation
  • Custom rules trigger
  • Email notification of fraud orders
  • Mobile app notification of fraud orders

This module requires an API key to function. You may subscribe for a free API key at https://www.fraudlabspro.com

Installation

To install this module type the following:

npm install fraudlabspro-nodejs

Usage Example

Validate Order

Object Properties

Property NameProperty TypeDescription
ipstringIP address of online transaction. It supports both IPv4 and IPv6 address format.
first_namestringUser's first name.
last_namestringUser's last name.
usernamestringUser's username.
emailstringUser's email address.
user_phonestringUser's phone number.
bill_addrstringStreet address of billing address.
bill_citystringCity of billing address.
bill_statestringState of billing address. It supports state codes, e.g. NY (New York), for state or province of United States or Canada. Please refer to State & Province Codes for complete list.
bill_zip_codestringPostal or ZIP code of billing address.
bill_countrystringCountry of billing address. It requires the input of ISO-3166 alpha-2 country code, e.g. US for United States. Please refer to Country Codes for complete list.
user_order_idstringMerchant identifier to uniquely identify a transaction. It supports maximum of 15 characters user order id input.
user_order_memostringMerchant description of an order transaction. It supports maximum of 200 characters.
amountfloatAmount of the transaction.
quantityintegerTotal quantity of the transaction.
currencystringCurrency code used in the transaction. It requires the input of ISO-4217 (3 characters) currency code, e.g. USD for US Dollar. Please refer to Currency Codes for complete list.
departmentstringMerchant identifier to uniquely identify a product or service department.
payment_modestringPayment mode of transaction. Valid values: creditcard, affirm, paypal, googlecheckout, bitcoin, cod, moneyorder, wired, bankdeposit, elviauthorized, paymitco, cybersource, sezzle, viabill, amazonpay, pmnts_gateway, giftcard, others.
numberstringBilling credit card number or BIN number.
avs_resultstringThe single character AVS result returned by the credit card processor. Please refer to AVS & CVV2 Response Codes for details.
cvv_resultstringThe single character CVV2 result returned by the credit card processor. Please refer to AVS & CVV2 Response Codes for details.
ship_addrstringStreet address of shipping address.
ship_citystringCity of shipping address.
ship_statestringState of shipping address. It supports state codes, e.g. NY - New York, for state or province of United States or Canada. Please refer to State & Province Codes for complete list.
ship_zip_codestringPostal or ZIP code of shipping address.
ship_countrystringCountry of shipping address. It requires the input of ISO-3166 alpha-2 country code, e.g. US for United States. Please refer to Country Codes for complete list.
const {FraudValidation} = require("fraudlabspro-nodejs");

var flp = new FraudValidation('YOUR API KEY');

params = {
	ip: '146.112.62.105',
	user_order_id: '67398',
	user_order_memo: 'Online shop',
	currency: 'USD',
	amount: '79.89',
	quantity: 1,
	number: '4556553172971283',
	payment_mode: 'creditcard',
	first_name: 'Hector',
	last_name: 'Henderson',
	email: 'hh5566@gmail.com',
	user_phone: '561-628-8674',
	bill_addr: '1766 Powder House Road',
	bill_city: 'West Palm Beach',
	bill_state: 'FL',
	bill_zip_code: '33401',
	bill_country: 'US',
	ship_addr: '4469 Chestnut Street',
	ship_city: 'Tampa',
	ship_state: 'FL',
	ship_zip_code: '33602',
	ship_country: 'US',
};
flp.validate(params, (err, data) => {
	if (!err) {
		console.log(data);
	}
});

Get Transaction

Parameter Properties

Parameter NameParameter TypeDescription
idstringFraudLabs Pro transaction ID or Order ID.
id_typestringID type. Valid values: fraudlabspro_id, user_order_id
const {FraudValidation} = require("fraudlabspro-nodejs");

var flp = new FraudValidation('YOUR API KEY');

params = {
	id: '20170906MXFHSTRF',
	id_type: 'fraudlabspro_id',
};
flp.getTransaction(params, (err, data) => {
	if (!err) {
		console.log(data);
	}
});

Feedback

Object Properties

Property NameProperty TypeDescription
idstringUnique transaction ID generated from Validate function.
actionstringPerform APPROVE, REJECT, or REJECT_BLACKLIST action to transaction.
notestringNotes for the feedback request.
const {FraudValidation} = require("fraudlabspro-nodejs");

var flp = new FraudValidation('YOUR API KEY');

params = {
	id: '20170906MXFHSTRF',
	action: 'APPROVE',
	note: 'This customer made a valid purchase before.',
};
flp.feedback(params, (err, data) => {
	if (!err) {
		console.log(data);
	}
});

SMS Verification

Send SMS Verification

Object Properties

Property NameProperty TypeDescription
telstringThe recipient mobile phone number in E164 format which is a plus followed by just numbers with no spaces or parentheses.
mesgstringThe message template for the SMS. Add as placeholder for the actual OTP to be generated. Max length is 140 characters.
otp_timeoutintegerTimeout feature for OTP value in seconds. Default is 3600 seconds(1 hour). Max timeout is 86400 seconds(24 hours).
country_codestringISO 3166 country code for the recipient mobile phone number. If parameter is supplied, then some basic telephone number validation is done.
const {SMSVerification} = require("fraudlabspro-nodejs");

var sms = new SMSVerification('YOUR API KEY');

params = {
	tel: '+123456789',
	mesg: 'Hi, your OTP is <otp>.',
	otp_timeout: 3600,
	country_code: 'US',
};
sms.sendSMS(params, (err, data) => {
	if (!err) {
		console.log(data);
	}
});

Get SMS Verification Result

Object Properties

Property NameProperty TypeDescription
tran_idstringThe unique ID that was returned by the Send SMS Verification that triggered the OTP sms.
otpstringThe OTP that was sent to the recipient’s phone.
const {SMSVerification} = require("fraudlabspro-nodejs");

var sms = new SMSVerification('YOUR API KEY');

params = {
	tran_id: 'UNIQUE_TRANS_ID',
	otp: 'OTP_RECEIVED',
};
sms.verifyOTP(params, (err, data) => {
	if (!err) {
		console.log(data);
	}
});

Keywords

fraud prevention

FAQs

Package last updated on 16 Jul 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts