working on amazon payment promisification
This commit is contained in:
@@ -1,30 +1,30 @@
|
||||
import * as amz from '../../../../../website/src/libs/api-v3/amazonPayments';
|
||||
import amazonPayments as amzStub from 'amazon-payments';
|
||||
import * as amzStub from 'amazon-payments';
|
||||
|
||||
describe('amazonPayments', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
});
|
||||
|
||||
describe('#getTokenInfo', () => {
|
||||
it('validates access_token parameter', async (done) => {
|
||||
try {
|
||||
let result = await amz.getTokenInfo();
|
||||
await amz.getTokenInfo();
|
||||
} catch (e) {
|
||||
expect(e.type).to.eql('invalid_request');
|
||||
done();
|
||||
}
|
||||
});
|
||||
|
||||
it.only('returns tokenInfo', (done) => {
|
||||
it('returns tokenInfo', async (done) => {
|
||||
let thisToken = 'this token info';
|
||||
let amzStubInstance = amzStub.connect({});
|
||||
amzStubInstance.api.getTokenInfo = (token, cb) => {
|
||||
return cb(undefined, thisToken);
|
||||
};
|
||||
let result = await amz.getTokenInfo;
|
||||
console.log('+++ +++ result:', result);
|
||||
let result = await amz.getTokenInfo();
|
||||
// console.log('+++ +++ result:', result);
|
||||
expect(result).to.eql(thisToken);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ import validator from 'validator';
|
||||
import moment from 'moment';
|
||||
import passport from 'passport';
|
||||
import nconf from 'nconf';
|
||||
// import setupNconf from '../../libs/api-v3/setupNconf';
|
||||
// setupNconf();
|
||||
import setupNconf from '../../libs/api-v3/setupNconf';
|
||||
setupNconf();
|
||||
import {
|
||||
authWithHeaders,
|
||||
} from '../../middlewares/api-v3/auth';
|
||||
@@ -461,7 +461,6 @@ api.updateEmail = {
|
||||
},
|
||||
};
|
||||
|
||||
// console.log('+++ ++ secret:', nconf.get('USER'));
|
||||
const firebaseTokenGenerator = new FirebaseTokenGenerator(nconf.get('FIREBASE:SECRET'));
|
||||
|
||||
// Internal route
|
||||
|
||||
@@ -12,7 +12,10 @@ import _ from 'lodash';
|
||||
import { removeFromArray } from '../../libs/api-v3/collectionManipulators';
|
||||
import { sendTxn } from '../../libs/api-v3/email';
|
||||
import nconf from 'nconf';
|
||||
import setupNconf from '../../libs/api-v3/setupNconf';
|
||||
setupNconf();
|
||||
|
||||
console.log('+++ +++ this:', nconf.get('FLAG_REPORT_EMAIL'));
|
||||
const FLAG_REPORT_EMAILS = nconf.get('FLAG_REPORT_EMAIL').split(',').map((email) => {
|
||||
return { email, canSend: true };
|
||||
});
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import amazonPayments from 'amazon-payments';
|
||||
import nconf from 'nconf';
|
||||
import Q from 'q';
|
||||
|
||||
const IS_PROD = nconf.get('NODE_ENV') === 'production';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user