@lomray/microservice-payment-stripe
Version:
Stripe payment microservice based on NodeJS & inverted json.
28 lines (24 loc) • 918 B
JavaScript
;
var tslib = require('tslib');
var microserviceHelpers = require('@lomray/microservice-helpers');
var index = require('../constants/index.js');
const defaultConfig = {
paymentMethods: index.MS_PAYMENT_METHODS,
setupIntentUsage: index.SETUP_INTENT_USAGE,
apiKey: index.MS_API_KEY,
config: index.MS_CONFIG,
webhookKeys: index.MS_WEBHOOK_KEYS,
payoutCoeff: index.MS_PAYOUT_COEFF,
fees: JSON.parse(index.MS_FEES),
taxes: JSON.parse(index.MS_TAXES),
duplicatedCardsUsage: index.DUPLICATED_CARDS_USAGE,
payout: JSON.parse(index.MS_PAYOUT),
};
/**
* Get remote config
*/
const remoteConfig = () => tslib.__awaiter(void 0, void 0, void 0, function* () {
const conf = yield microserviceHelpers.RemoteConfig.get('config');
return Object.assign(Object.assign({}, defaultConfig), (conf !== null && conf !== void 0 ? conf : {}));
});
module.exports = remoteConfig;