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

pitney-bowes

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pitney-bowes - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

.eslintrc.js

40

index.js

@@ -9,3 +9,4 @@ const cache = require('memory-cache');

api_secret: '',
baseUrl: 'https://api-sandbox.pitneybowes.com/shippingservices'
baseUrl: 'https://api-sandbox.pitneybowes.com/shippingservices',
baseTestUrl: 'https://api-test.pitneybowes.com'
}, args);

@@ -50,3 +51,3 @@

this.tracking = function(args, callback) {
this.getOAuthToken(function(err, token) {
this.getOAuthToken(function(err, oAuthToken) {
if (err) {

@@ -58,3 +59,3 @@ return callback(err);

auth: {
bearer: token.access_token
bearer: oAuthToken.access_token
},

@@ -83,3 +84,3 @@ json: true,

method: 'GET',
url: 'https://api-test.pitneybowes.com/tlstest'
url: `${options.baseTestUrl}/tlstest`
};

@@ -93,3 +94,3 @@

if (res.statusCode !== 200) {
return callback(createError(res.statusCode, res.body));
return callback(createError(res.statusCode));
}

@@ -100,4 +101,33 @@

};
this.validateAddress = function(args, callback) {
this.getOAuthToken(function(err, oAuthToken) {
if (err) {
return callback(err);
}
const req = {
auth: {
bearer: oAuthToken.access_token
},
json: args.address,
method: 'POST',
url: `${options.baseUrl}/v1/addresses/verify?minimalAddressValidation=${args.minimalAddressValidation || false}`
};
request(req, function(err, res, body) {
if (err) {
return callback(err);
}
if (res.statusCode !== 200) {
return callback(createError(res.statusCode, body));
}
callback(null, body);
});
});
};
}
module.exports = PitneyBowes;

2

package.json

@@ -30,3 +30,3 @@ {

},
"version": "0.0.1"
"version": "0.0.2"
}

@@ -6,4 +6,6 @@ # pitney-bowes

The Pitney Bowes Complete Shipping APIs let you integrate shipping services from multiple carriers, including USPS® and Newgistics®, into your services and applications.
The Pitney Bowes Complete Shipping APIs let you integrate shipping services from multiple carriers, including USPS® and Newgistics®, into your services and applications.
https://shipping.pitneybowes.com
## Usage

@@ -14,3 +16,3 @@

var pitneyBowes = new PitneyBowes({
const pitneyBowes = new PitneyBowes({
api_key: 'your_api_key',

@@ -56,2 +58,28 @@ api_secret: 'your_api_secret',

});
```
### pitneyBowes.validateAddress(args, callback)
Address validation verifies and cleanses postal addresses within the United States to help ensure packages are rated accurately and shipments arrive at their final destinations on time. The Validate Address operation sends an address to be verified. The response indicates whether the address is valid and whether the validation check made changes to the address.
**Example**
```javascript
const address = {
addressLines: [
'1600 Pennsylvania Avenue NW'
],
cityTown: 'Washington',
stateProvince: 'DC',
postalCode: '20500 ',
countryCode: 'US',
company: 'Pitney Bowes Inc.',
name: 'John Doe',
phone: '203-000-0000',
email: 'john.d@example.com'
};
pitneyBowes.validateAddress({ address, minimalAddressValidation: false }, function(err, data) {
console.log(data);
});
```
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