Skip to content

Commit

Permalink
Changed USERID to USPS_USERID
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronmwhitehead committed Jul 1, 2019
1 parent 82fed69 commit b7af236
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
4 changes: 2 additions & 2 deletions carriers/usps.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ function USPS(options) {

const obj = {
TrackFieldRequest: {
'@USERID': options.USERID,
'@USERID': options.USPS_USERID,
Revision: '1',
ClientIp: options.ClientIp || '127.0.0.1',
SourceId: options.SourceId || 'Mediocre/bloodhound',
SourceId: options.SourceId || '@mediocre/bloodhound (+https://github.com/mediocre/bloodhound)',
TrackID: {
'@ID': trackingNumber
}
Expand Down
2 changes: 0 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ function Bloodhound(options) {
this.guessCarrier = function(trackingNumber) {
if (fedEx.isTrackingNumberValid(trackingNumber)) {
return 'FedEx';
}else if (pitneyBowes.isTrackingNumberValid(trackingNumber)) {
return 'PitneyBowes';
}else if (usps.isTrackingNumberValid(trackingNumber)) {
return 'USPS';
}else return undefined;
Expand Down
6 changes: 2 additions & 4 deletions test/carriers/usps.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,15 @@ describe.only('USPS', function () {

const bloodhound = new Bloodhound({
usps: {
USERID: process.env.USERID,
SourceId: process.env.SourceId
USPS_USERID: process.env.USPS_USERID
}
});

describe('Invalid USPS Credentials', function () {
it('should return an error for invalid USERID', function (done) {
const bloodhound1 = new Bloodhound({
usps: {
USERID: 'invalid',
SourceId: process.env.SourceId
USPS_USERID: 'invalid'
}
});
bloodhound1.track('4204210192612927005269000027623688', 'usps', function (err) {
Expand Down

0 comments on commit b7af236

Please sign in to comment.