Socket
Socket
Sign inDemoInstall

ubivar

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ubivar

API wrapper to Ubivar


Version published
Weekly downloads
4
increased by33.33%
Maintainers
1
Weekly downloads
 
Created
Source

Ubivar node.js bindings

npm version Build Status Inline docs

Ubivar is an API that takes over the hassle of automatically screening e-payment for frauds on e-commerce websites.

Ubivar's purpose is to route e-commerce transactions given their estimated risk. By default, the three possible routing outcomes are a suggested rejection, a recommended manual verification, and a proposed acceptance of the transaction. Ubivar does not need all the business events (aka resources), however the more it has contextual information about the transactions, the better its accuracy. The two required resources are the transactions and the labels that categorize the transactions like fraud, not fraud. The API is simple: you provide Ubivar your request token and the bindings provide the hooks to send and receive resources to the API.

Install

npm install ubivar

Documentation

Documentation is available at https://ubivar.com/docs/nodejs

API Overview

Every resource is accessed via your ubivar instance and accepts an optional callback as the last argument. The sample code below retrieves your account information (as json) and updates the primary phone with a random value.

Quick Start

A. Init

var Ubivar    = require("ubivar")
  , ubivar    = new Ubivar("YOUR_API_ACCESS_TOKEN", "latest")

B. Send an e-commerce transaction

ubivar.transactions.create({
  "user_id"     : "test_phahr3Eit3_123"           // the id of your client
, "user_email"  : "test_phahr3Eit3@gmail-123.com" // the email of your client
, "type"        : "sale"                          // the type of transaction
, "status"      : "success"                       // whether the transaction was authorized
, "order_id"    : "test_iiquoozeiroogi_123"       // the shopping cart id
, "tx_id"       : "client_tx_id_123"              // the transaction id of this transaction
, "amount"      : "43210"                         // the amount of the transaction in cents
, "payment_method":{
    "bin"       :"123456"                         // the bank identification number of the card
  , "brand"     :"Mastercard"                     // the brand of the card
  , "funding"   :"credit"                         // the type of card
  , "country"   :"US"                             // the iso country code of the card
  , "name"      :"M Man"                          // the name of the card holder
  , "cvc_check":"pass"                            // whether the card passed the cvc check
},"billing_address":{
    "line1"     :"123 Market Street"              // the billing address
  , "line2"     :"4th Floor"                       
  , "city"      :"San Francisco"
  , "state"     :"California"
  , "zip"       :"94102"
  , "country"   :"US"
  }
}, function(err, res){

  if(err) return err 
  // something unexpected occurred

  txId          = res.data[0].id 
  // keep track of the transaction id 
})

C. Retrieve its status

ubivar.labels.retrieve(txId, function(err, res){

  if(err) return err
  // something unexpected occurred

  status        = res.data[0].status
  // the status of the transaction
})

All resources and methods

ubivar.fx.list({
  "cur_from"  : "CAD"         // default to EUR
, "cur_to"    : "GBP"         // default to USD
, "date"      : "2015-01-01"  // default to today
}, function(err, res){
  // returns the CAD/GBP FX of the day
})
ubivar.status.list(function(err, res){
  // returns uptime status of the web and API resources
})

Configuration

  • ubivar.set("auth", "your-api-token")
  • ubivar.setTimeout(20000) // in ms, node's default is 120000ms

More information / wikis

Development

To run the tests, you will need a Ubivar test API key (from your Ubivar dashboard)

export UBIVAR_TEST_TOKEN="your-test-api-key"
npm install -g mocha
npm test

Note: on Windows, use SET instead of export for setting the UBIVAR_TEST_TOKEN environment variable.

Author

Originally inspired from stripe-node. Developed by Fabrice Colas (fabrice.colas@gmail.com). Maintained by Ubivar.

Keywords

FAQs

Package last updated on 30 Mar 2015

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

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