Inits the workflow configuration
This commit is contained in:
parent
f66dac31c9
commit
e6e098b32e
286 changed files with 33660 additions and 64632 deletions
|
|
@ -50,7 +50,7 @@ namespace Yavsc.Helpers
|
|||
}
|
||||
public static string GetSender(this ApplicationUser user)
|
||||
{
|
||||
return user.UserName+" ["+user.Id+"@"+Startup.Authority+"]";
|
||||
return user.UserName+" ["+user.Id+"@"+Config.Authority+"]";
|
||||
}
|
||||
public static HairCutQueryEvent CreateEvent(this HairMultiCutQuery query,
|
||||
IStringLocalizer SR, BrusherProfile bpr)
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ namespace Yavsc.Helpers
|
|||
FileName = AbstractFileSystemHelpers.SignFileNameFormat("pro", billingCode, estimateId)
|
||||
};
|
||||
|
||||
var destFileName = Path.Combine(Startup.SiteSetup.Bills, item.FileName);
|
||||
var destFileName = Path.Combine(Config.SiteSetup.Bills, item.FileName);
|
||||
|
||||
var fi = new FileInfo(destFileName);
|
||||
if (fi.Exists) item.Overriden = true;
|
||||
|
|
@ -44,7 +44,7 @@ namespace Yavsc.Helpers
|
|||
/// <param name="source"></param>
|
||||
private static void CreateAvatars(this ApplicationUser user, Bitmap source)
|
||||
{
|
||||
var dir = Startup.SiteSetup.Avatars;
|
||||
var dir = Config.SiteSetup.Avatars;
|
||||
var name = user.UserName + ".png";
|
||||
var smallname = user.UserName + ".s.png";
|
||||
var xsmallname = user.UserName + ".xs.png";
|
||||
|
|
@ -235,12 +235,12 @@ namespace Yavsc.Helpers
|
|||
public static HtmlString FileLink(this RemoteFileInfo info, string username, string subpath)
|
||||
{
|
||||
return new HtmlString(
|
||||
$"{Startup.UserFilesOptions.RequestPath}/{username}/{subpath}/{info.Name}" );
|
||||
$"{Config.UserFilesOptions.RequestPath}/{username}/{subpath}/{info.Name}" );
|
||||
}
|
||||
|
||||
public static RemoteFileInfo FileInfo(this ApplicationUser user, string path)
|
||||
{
|
||||
IFileInfo info = Startup.UserFilesOptions.FileProvider.GetFileInfo($"{user.UserName}/{path}");
|
||||
IFileInfo info = Config.UserFilesOptions.FileProvider.GetFileInfo($"{user.UserName}/{path}");
|
||||
if (!info.Exists) return null;
|
||||
return new RemoteFileInfo{ Name = info.Name, Size = info.Length, LastModified = info.LastModified.UtcDateTime };
|
||||
|
||||
|
|
@ -253,7 +253,7 @@ namespace Yavsc.Helpers
|
|||
FileName = user.UserName + ".png"
|
||||
};
|
||||
|
||||
var destFileName = Path.Combine(Startup.SiteSetup.Avatars, item.FileName);
|
||||
var destFileName = Path.Combine(Config.SiteSetup.Avatars, item.FileName);
|
||||
|
||||
var fi = new FileInfo(destFileName);
|
||||
if (fi.Exists) item.Overriden = true;
|
||||
|
|
@ -289,7 +289,7 @@ namespace Yavsc.Helpers
|
|||
}
|
||||
|
||||
}
|
||||
item.DestDir = Startup.AvatarsOptions.RequestPath.ToUriComponent();
|
||||
item.DestDir = Config.AvatarsOptions.RequestPath.ToUriComponent();
|
||||
user.Avatar = $"{item.DestDir}/{item.FileName}";
|
||||
return item;
|
||||
}
|
||||
|
|
@ -298,7 +298,7 @@ namespace Yavsc.Helpers
|
|||
{
|
||||
if (flow.DifferedFileName==null) return null;
|
||||
// no server-side backup for this stream
|
||||
return $"{Startup.UserFilesOptions.RequestPath}/{flow.Owner.UserName}/live/"+GetFileName(flow);
|
||||
return $"{Config.UserFilesOptions.RequestPath}/{flow.Owner.UserName}/live/"+GetFileName(flow);
|
||||
}
|
||||
|
||||
public static string GetFileName (this LiveFlow flow)
|
||||
|
|
|
|||
|
|
@ -110,8 +110,8 @@ namespace Yavsc.Helpers
|
|||
try {
|
||||
using (var m = new SimpleJsonPostMethod(ep)) {
|
||||
return await m.Invoke<TokenResponse>(
|
||||
new { refresh_token= oldResponse.RefreshToken, client_id=Startup.GoogleWebClientConfiguration["web:client_id"],
|
||||
client_secret=Startup.GoogleWebClientConfiguration["web:client_secret"],
|
||||
new { refresh_token= oldResponse.RefreshToken, client_id=Config.GoogleWebClientConfiguration["web:client_id"],
|
||||
client_secret=Config.GoogleWebClientConfiguration["web:client_secret"],
|
||||
grant_type="refresh_token" }
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,22 +22,23 @@ namespace Yavsc.Helpers
|
|||
if (payPalProperties==null) {
|
||||
|
||||
payPalProperties = new Dictionary<string,string>();
|
||||
var paypalSettings = Config.PayPalSettings;
|
||||
// Don't do:
|
||||
// payPalProperties.Add("mode", Startup.PayPalSettings.Mode);
|
||||
// Instead, set the endpoint parameter.
|
||||
if (Startup.PayPalSettings.Mode == "production") {
|
||||
if (paypalSettings.Mode == "production") {
|
||||
// use nvp end point: https://api-3t.paypal.com/nvp
|
||||
payPalProperties.Add("endpoint", "https://api-3t.paypal.com/nvp");
|
||||
|
||||
} else {
|
||||
payPalProperties.Add("endpoint", "https://api-3t.sandbox.paypal.com/nvp");
|
||||
}
|
||||
payPalProperties.Add("clientId", Startup.PayPalSettings.ClientId);
|
||||
payPalProperties.Add("clientSecret", Startup.PayPalSettings.ClientSecret);
|
||||
payPalProperties.Add("clientId", paypalSettings.ClientId);
|
||||
payPalProperties.Add("clientSecret", paypalSettings.ClientSecret);
|
||||
|
||||
int numClient = 0;
|
||||
if (Startup.PayPalSettings.Accounts!=null)
|
||||
foreach (var account in Startup.PayPalSettings.Accounts) {
|
||||
if (paypalSettings.Accounts!=null)
|
||||
foreach (var account in paypalSettings.Accounts) {
|
||||
numClient++;
|
||||
payPalProperties.Add ($"account{numClient}.apiUsername",account.ApiUsername);
|
||||
payPalProperties.Add ($"account{numClient}.apiPassword",account.ApiPassword);
|
||||
|
|
@ -106,8 +107,8 @@ namespace Yavsc.Helpers
|
|||
|
||||
var d = new SetExpressCheckoutRequestDetailsType();
|
||||
|
||||
logger.LogInformation($"Creating express checkout for {Startup.PayPalSettings.MerchantAccountUserName} : "+JsonConvert.SerializeObject(coreq));
|
||||
var response = PayPalService.SetExpressCheckout( coreq, Startup.PayPalSettings.MerchantAccountUserName );
|
||||
logger.LogInformation($"Creating express checkout for {Config.PayPalSettings.MerchantAccountUserName} : "+JsonConvert.SerializeObject(coreq));
|
||||
var response = PayPalService.SetExpressCheckout( coreq, Config.PayPalSettings.MerchantAccountUserName );
|
||||
|
||||
return response;
|
||||
}
|
||||
|
|
@ -125,7 +126,7 @@ namespace Yavsc.Helpers
|
|||
Token = token
|
||||
}
|
||||
};
|
||||
return PayPalService.GetExpressCheckoutDetails(req,Startup.PayPalSettings.Accounts[0].ApiUsername);
|
||||
return PayPalService.GetExpressCheckoutDetails(req,Config.PayPalSettings.Accounts[0].ApiUsername);
|
||||
}
|
||||
public static async Task<PaymentInfo> ConfirmPayment(
|
||||
this ApplicationDbContext context,
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ namespace Yavsc.Helpers
|
|||
{
|
||||
string errorMsg = null;
|
||||
var billdir = Model.DestDir;
|
||||
var tempdir = Startup.SiteSetup.TempDir;
|
||||
var tempdir = Config.SiteSetup.TempDir;
|
||||
string name = Model.BaseFileName;
|
||||
string fullname = new FileInfo(
|
||||
System.IO.Path.Combine(tempdir, name)).FullName;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue