Skip to content

Commit

Permalink
syncth source
Browse files Browse the repository at this point in the history
  • Loading branch information
rock007 committed Nov 26, 2020
1 parent eb22833 commit 4c7c442
Show file tree
Hide file tree
Showing 20 changed files with 458 additions and 190 deletions.
97 changes: 49 additions & 48 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,72 +1,73 @@
# create the build instance
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
#FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build

WORKDIR /src
COPY ./src ./
#WORKDIR /src
#COPY ./src ./

# restore solution
RUN dotnet restore NopCommerce.sln
#RUN dotnet restore NopCommerce.sln

WORKDIR /src/Presentation/Nop.Web
#WORKDIR /src/Presentation/Nop.Web

# build project
RUN dotnet build Nop.Web.csproj -c Release
#RUN dotnet build Nop.Web.csproj -c Release

# build plugins
WORKDIR /src/Plugins/Nop.Plugin.DiscountRules.CustomerRoles
RUN dotnet build Nop.Plugin.DiscountRules.CustomerRoles.csproj -c Release
WORKDIR /src/Plugins/Nop.Plugin.ExchangeRate.EcbExchange
RUN dotnet build Nop.Plugin.ExchangeRate.EcbExchange.csproj -c Release
WORKDIR /src/Plugins/Nop.Plugin.ExternalAuth.Facebook
RUN dotnet build Nop.Plugin.ExternalAuth.Facebook.csproj -c Release
WORKDIR /src/Plugins/Nop.Plugin.Misc.SendinBlue
RUN dotnet build Nop.Plugin.Misc.SendinBlue.csproj -c Release
WORKDIR /src/Plugins/Nop.Plugin.Payments.CheckMoneyOrder
RUN dotnet build Nop.Plugin.Payments.CheckMoneyOrder.csproj -c Release
WORKDIR /src/Plugins/Nop.Plugin.Payments.Manual
RUN dotnet build Nop.Plugin.Payments.Manual.csproj -c Release
WORKDIR /src/Plugins/Nop.Plugin.Payments.PayPalSmartPaymentButtons
RUN dotnet build Nop.Plugin.Payments.PayPalSmartPaymentButtons.csproj -c Release
WORKDIR /src/Plugins/Nop.Plugin.Payments.PayPalStandard
RUN dotnet build Nop.Plugin.Payments.PayPalStandard.csproj -c Release
WORKDIR /src/Plugins/Nop.Plugin.Pickup.PickupInStore
RUN dotnet build Nop.Plugin.Pickup.PickupInStore.csproj -c Release
WORKDIR /src/Plugins/Nop.Plugin.Shipping.FixedByWeightByTotal
RUN dotnet build Nop.Plugin.Shipping.FixedByWeightByTotal.csproj -c Release
WORKDIR /src/Plugins/Nop.Plugin.Shipping.ShipStation
RUN dotnet build Nop.Plugin.Shipping.ShipStation.csproj -c Release
WORKDIR /src/Plugins/Nop.Plugin.Shipping.UPS
RUN dotnet build Nop.Plugin.Shipping.UPS.csproj -c Release
WORKDIR /src/Plugins/Nop.Plugin.Tax.Avalara
RUN dotnet build Nop.Plugin.Tax.Avalara.csproj -c Release
WORKDIR /src/Plugins/Nop.Plugin.Widgets.FacebookPixel
RUN dotnet build Nop.Plugin.Widgets.FacebookPixel.csproj -c Release
WORKDIR /src/Plugins/Nop.Plugin.Tax.FixedOrByCountryStateZip
RUN dotnet build Nop.Plugin.Tax.FixedOrByCountryStateZip.csproj -c Release
WORKDIR /src/Plugins/Nop.Plugin.Widgets.GoogleAnalytics
RUN dotnet build Nop.Plugin.Widgets.GoogleAnalytics.csproj -c Release
WORKDIR /src/Plugins/Nop.Plugin.Widgets.NivoSlider
RUN dotnet build Nop.Plugin.Widgets.NivoSlider.csproj -c Release
#WORKDIR /src/Plugins/Nop.Plugin.DiscountRules.CustomerRoles
#RUN dotnet build Nop.Plugin.DiscountRules.CustomerRoles.csproj -c Release
#WORKDIR /src/Plugins/Nop.Plugin.ExchangeRate.EcbExchange
#RUN dotnet build Nop.Plugin.ExchangeRate.EcbExchange.csproj -c Release
#WORKDIR /src/Plugins/Nop.Plugin.ExternalAuth.Facebook
#RUN dotnet build Nop.Plugin.ExternalAuth.Facebook.csproj -c Release
#WORKDIR /src/Plugins/Nop.Plugin.Misc.SendinBlue
#RUN dotnet build Nop.Plugin.Misc.SendinBlue.csproj -c Release
#WORKDIR /src/Plugins/Nop.Plugin.Payments.CheckMoneyOrder
#RUN dotnet build Nop.Plugin.Payments.CheckMoneyOrder.csproj -c Release
#WORKDIR /src/Plugins/Nop.Plugin.Payments.Manual
#RUN dotnet build Nop.Plugin.Payments.Manual.csproj -c Release
#WORKDIR /src/Plugins/Nop.Plugin.Payments.PayPalSmartPaymentButtons
#RUN dotnet build Nop.Plugin.Payments.PayPalSmartPaymentButtons.csproj -c Release
#WORKDIR /src/Plugins/Nop.Plugin.Payments.PayPalStandard
#RUN dotnet build Nop.Plugin.Payments.PayPalStandard.csproj -c Release
#WORKDIR /src/Plugins/Nop.Plugin.Pickup.PickupInStore
#RUN dotnet build Nop.Plugin.Pickup.PickupInStore.csproj -c Release
#WORKDIR /src/Plugins/Nop.Plugin.Shipping.FixedByWeightByTotal
#RUN dotnet build Nop.Plugin.Shipping.FixedByWeightByTotal.csproj -c Release
#WORKDIR /src/Plugins/Nop.Plugin.Shipping.ShipStation
#RUN dotnet build Nop.Plugin.Shipping.ShipStation.csproj -c Release
#WORKDIR /src/Plugins/Nop.Plugin.Shipping.UPS
#RUN dotnet build Nop.Plugin.Shipping.UPS.csproj -c Release
#WORKDIR /src/Plugins/Nop.Plugin.Tax.Avalara
#RUN dotnet build Nop.Plugin.Tax.Avalara.csproj -c Release
#WORKDIR /src/Plugins/Nop.Plugin.Widgets.FacebookPixel
#RUN dotnet build Nop.Plugin.Widgets.FacebookPixel.csproj -c Release
#WORKDIR /src/Plugins/Nop.Plugin.Tax.FixedOrByCountryStateZip
#RUN dotnet build Nop.Plugin.Tax.FixedOrByCountryStateZip.csproj -c Release
#WORKDIR /src/Plugins/Nop.Plugin.Widgets.GoogleAnalytics
#RUN dotnet build Nop.Plugin.Widgets.GoogleAnalytics.csproj -c Release
#WORKDIR /src/Plugins/Nop.Plugin.Widgets.NivoSlider
#RUN dotnet build Nop.Plugin.Widgets.NivoSlider.csproj -c Release

# publish project
WORKDIR /src/Presentation/Nop.Web
RUN dotnet publish Nop.Web.csproj -c Release -o /app/published
#WORKDIR /src/Presentation/Nop.Web
#RUN dotnet publish Nop.Web.csproj -c Release -o /app/published

# create the runtime instance
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-alpine AS runtime

# add globalization support
RUN apk add --no-cache icu-libs
#RUN apk add --no-cache icu-libs
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false

# installs required packages
RUN apk add libgdiplus --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ --allow-untrusted
RUN apk add libc-dev --no-cache
#RUN apk add libgdiplus --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ --allow-untrusted
#RUN apk add libc-dev --no-cache

WORKDIR /app
RUN mkdir bin
RUN mkdir logs

COPY --from=build /app/published .
RUN mkdir logs

COPY src/Presentation/Nop.Web/bin/Release/netcoreapp3.1 ./bin
#COPY --from=build /app/published .

ENTRYPOINT ["dotnet", "Nop.Web.dll"]
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "3.1.201",
"version": "3.1.404",
"rollForward": "latestFeature",
"allowPrerelease": false
}
Expand Down
2 changes: 1 addition & 1 deletion src/Libraries/Nop.Data/Nop.Data.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<PackageReference Include="FluentMigrator" Version="3.2.6" />
<PackageReference Include="FluentMigrator.Runner" Version="3.2.6" />
<PackageReference Include="linq2db" Version="2.9.8" />
<PackageReference Include="MySql.Data" Version="8.0.20" />
<PackageReference Include="MySql.Data" Version="8.0.21" />
<PackageReference Include="System.Net.NameResolution" Version="4.3.0" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/Plugins/Nop.Plugin.ExternalAuth.QQ/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"FriendlyName": "QQ 登录",
"SystemName": "ExternalAuth.QQ",
"Version": "1.00",
"SupportedVersions": [ "4.30" ],
"SupportedVersions": [ "4.40" ],
"Author": " ",
"DisplayOrder": 5,
"FileName": "Nop.Plugin.ExternalAuth.QQ.dll",
Expand Down
2 changes: 1 addition & 1 deletion src/Plugins/Nop.Plugin.ExternalAuth.WeChat/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"FriendlyName": "微信登录",
"SystemName": "ExternalAuth.WeChat",
"Version": "1.00",
"SupportedVersions": [ "4.30" ],
"SupportedVersions": [ "4.40" ],
"Author": " ",
"DisplayOrder": 5,
"FileName": "Nop.Plugin.ExternalAuth.WeChat.dll",
Expand Down
2 changes: 1 addition & 1 deletion src/Plugins/Nop.Plugin.Payments.AliPay/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"FriendlyName": "支付宝",
"SystemName": "Payments.AliPay",
"Version": "1.00",
"SupportedVersions": [ "4.30" ],
"SupportedVersions": [ "4.40" ],
"Author": "",
"DisplayOrder": 1,
"FileName": "Nop.Plugin.Payments.AliPay.dll",
Expand Down
2 changes: 1 addition & 1 deletion src/Plugins/Nop.Plugin.Payments.WeChatPay/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"FriendlyName": "微信支付",
"SystemName": "Payments.WeChatPay",
"Version": "1.00",
"SupportedVersions": [ "4.30" ],
"SupportedVersions": [ "4.40" ],
"Author": "",
"DisplayOrder": 1,
"FileName": "Nop.Plugin.Payments.WeChatPay.dll",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ public ShipStationController(ILocalizationService localizationService,
public ActionResult Configure()
{
//load settings for a chosen store scope
var storeScope = _storeContext.ActiveStoreScopeConfiguration;
var shipStationSettings = _settingService.LoadSetting<ShipStationSettings>(storeScope);

// var storeScope = _storeContext.ActiveStoreScopeConfiguration;
// var shipStationSettings = _settingService.LoadSetting<ShipStationSettings>(storeScope);
/***
var model = new ShipStationModel
{
ApiKey = shipStationSettings.ApiKey,
Expand All @@ -71,6 +71,9 @@ public ActionResult Configure()
model.PassDimensions_OverrideForStore = _settingService.SettingExists(shipStationSettings, x => x.PassDimensions, storeScope);
model.Password_OverrideForStore = _settingService.SettingExists(shipStationSettings, x => x.Password, storeScope);
model.UserName_OverrideForStore = _settingService.SettingExists(shipStationSettings, x => x.UserName, storeScope);
***/
var model = new ShipStationModel();
model.WebhookURL = $"{_webHelper.GetStoreLocation()}Plugins/ShipStation/Webhook";

return View("~/Plugins/Shipping.ShipStation/Views/Configure.cshtml", model);
}
Expand All @@ -86,7 +89,7 @@ public ActionResult Configure(ShipStationModel model)
//load settings for a chosen store scope
var storeScope = _storeContext.ActiveStoreScopeConfiguration;
var shipStationSettings = _settingService.LoadSetting<ShipStationSettings>(storeScope);

//save settings
shipStationSettings.ApiKey = model.ApiKey;
shipStationSettings.ApiSecret = model.ApiSecret;
Expand All @@ -98,15 +101,15 @@ public ActionResult Configure(ShipStationModel model)

/* We do not clear cache after each setting update.
* This behavior can increase performance because cached settings will not be cleared
* and loaded from database after each update */
* and loaded from database after each update ***/
_settingService.SaveSettingOverridablePerStore(shipStationSettings, x => x.ApiKey, model.ApiKey_OverrideForStore, storeScope, false);
_settingService.SaveSettingOverridablePerStore(shipStationSettings, x => x.ApiSecret, model.ApiSecret_OverrideForStore, storeScope, false);
_settingService.SaveSettingOverridablePerStore(shipStationSettings, x => x.PackingPackageVolume, model.PackingPackageVolume_OverrideForStore, storeScope, false);
_settingService.SaveSettingOverridablePerStore(shipStationSettings, x => x.PackingType, model.PackingType_OverrideForStore, storeScope, false);
_settingService.SaveSettingOverridablePerStore(shipStationSettings, x => x.PassDimensions, model.PassDimensions_OverrideForStore, storeScope, false);
_settingService.SaveSettingOverridablePerStore(shipStationSettings, x => x.Password, model.Password_OverrideForStore, storeScope, false);
_settingService.SaveSettingOverridablePerStore(shipStationSettings, x => x.UserName, model.UserName_OverrideForStore, storeScope, false);

//now clear settings cache
_settingService.ClearCache();

Expand All @@ -117,13 +120,13 @@ public ActionResult Configure(ShipStationModel model)

public IActionResult Webhook()
{
var userName = _webHelper.QueryString<string>("SS-UserName");
var password = _webHelper.QueryString<string>("SS-Password");
// var userName = _webHelper.QueryString<string>("SS-UserName");
// var password = _webHelper.QueryString<string>("SS-Password");

//load settings for a chosen store scope
var storeScope = _storeContext.ActiveStoreScopeConfiguration;
var shipStationSettings = _settingService.LoadSetting<ShipStationSettings>(storeScope);

// var storeScope = _storeContext.ActiveStoreScopeConfiguration;
// var shipStationSettings = _settingService.LoadSetting<ShipStationSettings>(storeScope);
/***!!
if (!userName.Equals(shipStationSettings.UserName) || !password.Equals(shipStationSettings.Password))
return Content(string.Empty);
Expand Down Expand Up @@ -157,6 +160,8 @@ public IActionResult Webhook()
var endDate = string.IsNullOrEmpty(endDateParam) ? (DateTime?)null : DateTime.ParseExact(endDateParam, _shipStationService.DateFormat, CultureInfo.InvariantCulture);
return Content(_shipStationService.GetXmlOrders(startDate, endDate, pageIndex, 200), "text/xml");
****/
return Content("fuck the shipStation hook", "text/xml");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ namespace Nop.Plugin.Shipping.ShipStation.Models
{
public class ShipStationModel : BaseNopModel
{

public int ActiveStoreScopeConfiguration { get; set; }

[NopResourceDisplayName("Plugins.Shipping.ShipStation.Fields.ApiKey")]
Expand Down Expand Up @@ -38,6 +39,7 @@ public class ShipStationModel : BaseNopModel
[DataType(DataType.Password)]
public string Password { get; set; }
public bool Password_OverrideForStore { get; set; }


public string WebhookURL { get; set; }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<ItemGroup>
<None Remove="logo.jpg" />
<None Remove="plugin.json" />
<None Remove="Views\Configure - 复制.cshtml" />
<None Remove="Views\Configure.cshtml" />
<None Remove="Views\_ViewImports.cshtml" />
</ItemGroup>
Expand All @@ -31,6 +32,9 @@
<Content Include="plugin.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Views\Configure - 复制.cshtml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Views\Configure.cshtml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ public ShipStationService(ICacheKeyService cacheKeyService,

protected virtual string SendGetRequest(string apiUrl)
{
/***
var request = WebRequest.Create(apiUrl);
request.Credentials = new NetworkCredential(_shipStationSettings.ApiKey, _shipStationSettings.ApiSecret);
Expand All @@ -114,6 +115,9 @@ protected virtual string SendGetRequest(string apiUrl)
return sr.ReadToEnd();
}
}
****/

return "ShipStationService.SendGetRequest result";
}

private int ConvertFromPrimaryMeasureDimension(decimal quantity, MeasureDimension usedMeasureDimension)
Expand Down Expand Up @@ -143,6 +147,7 @@ protected virtual bool TryGetError(string data)

protected virtual IList<ShipStationServiceRate> GetRates(GetShippingOptionRequest getShippingOptionRequest, string carrierCode)
{
/**!!
var usedWeight = _measureService.GetMeasureWeightBySystemKeyword(Weight.Units);
if (usedWeight == null)
throw new NopException("ShipStatio shipping service. Could not load \"{0}\" measure weight", Weight.Units);
Expand Down Expand Up @@ -266,6 +271,8 @@ protected virtual IList<ShipStationServiceRate> GetRates(GetShippingOptionReques
return TryGetError(data) ? new List<ShipStationServiceRate>() : JsonConvert.DeserializeObject<List<ShipStationServiceRate>>(data);
}
****/
return new List<ShipStationServiceRate>();
}

protected virtual IList<Carrier> GetCarriers()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public GetShippingOptionResponse GetShippingOptions(GetShippingOptionRequest get
if (getShippingOptionRequest == null)
throw new ArgumentNullException(nameof(getShippingOptionRequest));

return null;
return (decimal?)10.1;
}

/// <summary>
Expand All @@ -118,11 +118,13 @@ public override string GetConfigurationPageUrl()
public override void Install()
{
//settings
/**
var settings = new ShipStationSettings
{
PackingPackageVolume = 5184
};
_settingService.SaveSetting(settings);
//locales
_localizationService.AddPluginLocaleResource(new Dictionary<string, string>
Expand All @@ -144,7 +146,7 @@ public override void Install()
["Plugins.Shipping.ShipStation.Fields.UserName"] = "User name",
["Plugins.Shipping.ShipStation.Fields.UserName.Hint"] = "Specify ShipStation user name"
});

***/
base.Install();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ namespace Nop.Plugin.Shipping.ShipStation
{
public class ShipStationSettings : ISettings
{

/// <summary>
/// API key
/// </summary>
Expand Down Expand Up @@ -38,5 +39,6 @@ public class ShipStationSettings : ISettings
/// ShipStation password
/// </summary>
public string Password { get; set; }

}
}
Loading

0 comments on commit 4c7c442

Please sign in to comment.