INNER CODE UNIT · JavaScript
getPaymentInfo
shadowsocks/shadowsocks-manager · plugins/account/index.js:617
const getPaymentInfo = type => {
const pay = {
'2': 'week',
'3': 'month',
'4': 'day',
'5': 'hour',
};
return paymentInfo[pay[type]];
};
const checkIfAccountExists = async (accountId) => {
if(!accountId) { return null; }
const account = await knex('account_plugin').where({ id: accountId });
if(!account.length) { return null; }
const accountInfo = account[0];
accountInfo.data = JSON.parse(account[0].data);
return accountInfo;
};