8000 add shipping method ups freight for get shipping rates by TusharSangani · Pull Request #64 · HotcakesCommerce/hotcakes-commerce-core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

add shipping method ups freight for get shipping rates #64

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Hotcakes.sln
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Hotcakes.CommerceDTO.Tests"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Hotcakes.Commerce.NoCms", "Libraries\Hotcakes.Commerce.NoCms\Hotcakes.Commerce.NoCms.csproj", "{CB21DFDA-99A5-4E97-92F8-A6C8689F9341}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Hotcakes.Shipping.UpsFreight", "Libraries\Hotcakes.Shipping.UpsFreight\Hotcakes.Shipping.UpsFreight.csproj", "{24FD7B03-1D9B-4D14-9657-236E520C2192}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|.NET = Debug|.NET
Expand Down Expand Up @@ -287,6 +289,18 @@ Global
{CB21DFDA-99A5-4E97-92F8-A6C8689F9341}.Release|Any CPU.Build.0 = Release|Any CPU
{CB21DFDA-99A5-4E97-92F8-A6C8689F9341}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{CB21DFDA-99A5-4E97-92F8-A6C8689F9341}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{24FD7B03-1D9B-4D14-9657-236E520C2192}.Debug|.NET.ActiveCfg = Debug|Any CPU
{24FD7B03-1D9B-4D14-9657-236E520C2192}.Debug|.NET.Build.0 = Debug|Any CPU
{24FD7B03-1D9B-4D14-9657-236E520C2192}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{24FD7B03-1D9B-4D14-9657-236E520C2192}.Debug|Any CPU.Build.0 = Debug|Any CPU
{24FD7B03-1D9B-4D14-9657-236E520C2192}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{24FD7B03-1D9B-4D14-9657-236E520C2192}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{24FD7B03-1D9B-4D14-9657-236E520C2192}.Release|.NET.ActiveCfg = Release|Any CPU
{24FD7B03-1D9B-4D14-9657-236E520C2192}.Release|.NET.Build.0 = Release|Any CPU
{24FD7B03-1D9B-4D14-9657-236E520C2192}.Release|Any CPU.ActiveCfg = Release|Any CPU
{24FD7B03-1D9B-4D14-9657-236E520C2192}.Release|Any CPU.Build.0 = Release|Any CPU
{24FD7B03-1D9B-4D14-9657-236E520C2192}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{24FD7B03-1D9B-4D14-9657-236E520C2192}.Release|Mixed Platforms.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\References\Dnn\System.Web.Helpers.dll</HintPath>
</Reference>
<Reference Include="System.Web.Mvc, Version=4.0.0.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Reference Include="System.Web.Mvc, Version=4.0.0.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Microsoft.AspNet.Mvc.4.0.40804.0\lib\net40\System.Web.Mvc.dll</HintPath>
</Reference>
Expand Down
52 changes: 52 additions & 0 deletions Libraries/Hotcakes.Commerce/Accounts/StoreSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -939,6 +939,58 @@ public bool ShippingUSPostalDiagnostics
set { SetProp("ShippingUSPostalDiagnostics", value); }
}


#region "UPS Freight"

public int ShippingUpsFreightDefaultPackaging
{
get { return GetPropInt("ShippingUpsFreightDefaultPackaging"); }
set { SetProp("ShippingUpsFreightDefaultPackaging", value); }
}

public int ShippingUpsFreightDefaultPayment
{
get { return GetPropInt("ShippingUpsFreightDefaultPayment"); }
set { SetProp("ShippingUpsFreightDefaultPayment", value); }
}

public bool ShippingUPSFreightDiagnostics
{
get { return GetPropBool("ShippingUPSFreightDiagnostics"); }
set { SetProp("ShippingUPSFreightDiagnostics", value); }
}

public bool ShippingUpsFreightForceResidential
{
get { return GetPropBool("ShippingUpsFreightForceResidential"); }
set { SetProp("ShippingUpsFreightForceResidential", value); }
}

public bool ShippingUpsFreightSkipDimensions
{
get { return GetPropBool("ShippingUpsFreightSkipDimensions"); }
set { SetProp("ShippingUpsFreightSkipDimensions", value); }
}

public int ShippingUpsFreightBillingOption
{
get { return GetPropInt("ShippingUpsFreightBillingOption"); }
set { SetProp("ShippingUpsFreightBillingOption", value); }
}

public string ShippingUpsFreightHandleOneUnitType
{
get { return GetProp("ShippingUpsFreightHandleOneUnitType"); }
set { SetProp("ShippingUpsFreightHandleOneUnitType", value); }
}

public string ShippingUpsFreightFreightClass
{
get { return GetProp("ShippingUpsFreightFreightClass"); }
set { SetProp("ShippingUpsFreightFreightClass", value); }
}

#endregion
#endregion

#region Affiliates
Expand Down
6 changes: 5 additions & 1 deletion Libraries/Hotcakes.Commerce/Hotcakes.Commerce.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\References\Dnn\System.Web.Helpers.dll</HintPath>
</Reference>
<Reference Include="System.Web.Mvc, Version=4.0.0.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Reference Include="System.Web.Mvc, Version=4.0.0.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Microsoft.AspNet.Mvc.4.0.40804.0\lib\net40\System.Web.Mvc.dll</HintPath>
</Reference>
Expand Down Expand Up @@ -1063,6 +1063,10 @@
<Project>{9B00258D-45D2-43BD-8178-A6F2AAFF5090}</Project>
<Name>Hotcakes.Shipping.FedEx</Name>
</ProjectReference>
<ProjectReference Include="..\Hotcakes.Shipping.UpsFreight\Hotcakes.Shipping.UpsFreight.csproj">
<Project>{24fd7b03-1d9b-4d14-9657-236e520c2192}</Project>
<Name>Hotcakes.Shipping.UpsFreight</Name>
</ProjectReference>
<ProjectReference Include="..\Hotcakes.Shipping.Ups\Hotcakes.Shipping.Ups.csproj">
<Project>{68FF27BE-6296-4A8B-B20F-6480A491D092}</Project>
<Name>Hotcakes.Shipping.Ups</Name>
Expand Down
19 changes: 19 additions & 0 deletions Libraries/Hotcakes.Commerce/Shipping/AvailableServices.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
using Hotcakes.Shipping.FedEx;
using Hotcakes.Shipping.Ups;
using Hotcakes.Shipping.USPostal;
using Hotcakes.Shipping.UpsFreight;
using System;

namespace Hotcakes.Commerce.Shipping
{
Expand Down Expand Up @@ -78,6 +80,23 @@ public static List<IShippingService> FindAll(Store currentStore)
};
result.Add(new UPSService(upsglobal, Factory.CreateEventLogger()));


// Load UPS Freight
var upsFreightGlobal = new UPSFreightServiceGlobalSettings
{
AccountNumber = currentStore.Settings.ShippingUpsAccountNumber,
LicenseNumber = currentStore.Settings.ShippingUpsLicense,
Username = currentStore.Settings.ShippingUpsUsername,
Password = currentStore.Settings.ShippingUpsPassword,
DefaultPackaging = (Hotcakes.Shipping.UpsFreight.PackingTypes)currentStore.Settings.ShippingUpsFreightDefaultPackaging,
DiagnosticsMode = currentStore.Settings.ShippingUPSFreightDiagnostics,
ForceResidential = currentStore.Settings.ShippingUpsFreightForceResidential,
IgnoreDimensions = currentStore.Settings.ShippingUpsFreightSkipDimensions,
BillingOption = (Hotcakes.Shipping.UpsFreight.BillingOption)currentStore.Settings.ShippingUpsFreightBillingOption,
HandleOneUnitType = (currentStore.Settings.ShippingUpsFreightHandleOneUnitType != string.Empty ? (HandlineOneUnitType)Enum.Parse(typeof(HandlineOneUnitType),currentStore.Settings.ShippingUpsFreightHandleOneUnitType) : HandlineOneUnitType.CBY),
FreightClass = currentStore.Settings.ShippingUpsFreightFreightClass
};
result.Add(new UPSFreightService(upsFreightGlobal, Factory.CreateEventLogger()));
return result;
}

Expand Down
1 change: 1 addition & 0 deletions Libraries/Hotcakes.Commerce/Shipping/ShippingMethod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ public Collection<ShippingRateDisplay> GetRates(Order o, Store currentStore)

if (p != null)
{
Settings.Add("PayerName", (o.ShippingAddress.FirstName + " " + o.ShippingAddress.LastName));
p.BaseSettings.Clear();
p.BaseSettings.Merge(Settings);

Expand Down
34 changes: 34 additions & 0 deletions Libraries/Hotcakes.Shipping.UpsFreight/BillingOption.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#region License

// Distributed under the MIT License
// ============================================================
// Copyright (c) 2016 Hotcakes Commerce, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software
// and associated documentation files (the "Software"), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge, publish, distribute,
// sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#endregion

namespace Hotcakes.Shipping.UpsFreight
{
public enum BillingOption
{
Prepaid = 10,
BilltoThirdParty = 30,
FreightCollect = 40
}
}
48 changes: 48 additions & 0 deletions Libraries/Hotcakes.Shipping.UpsFreight/CurrencyCode.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#region License

// Distributed under the MIT License
// ============================================================
// Copyright (c) 2016 Hotcakes Commerce, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software
// and associated documentation files (the "Software"), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge, publish, distribute,
// sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#endregion

namespace Hotcakes.Shipping.UpsFreight
{
public enum CurrencyCode
{
AustalianDollar = 2,
Baht = 3,
BritishPounds = 4,
CanadianDollar = 5,
DenmarkKrone = 6,
Drachma = 7,
Euro = 8,
HongKongDollar = 9,
NewZealandDollar = 10,
NorwayKrone = 11,
Peso = 12,
Ringgit = 13,
SingaporeDollar = 14,
SwedishKrona = 15,
SwissFranc = 16,
TaiwanDollar = 17,
UsDollar = 1
}
}
133 changes: 133 additions & 0 deletions Libraries/Hotcakes.Shipping.UpsFreight/Entity.cs
4D1F
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
#region License

// Distributed under the MIT License
// ============================================================
// Copyright (c) 2016 Hotcakes Commerce, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software
// and associated documentation files (the "Software"), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge, publish, distribute,
// sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#endregion

using System;

namespace Hotcakes.Shipping.UpsFreight
{
[Serializable]
public class Entity
{
private string _AccountNumber = string.Empty;
private string _AddressLine1 = string.Empty;
private string _AddressLine2 = string.Empty;
private string _AddressLine3 = string.Empty;
private string _AttentionName = string.Empty;
private string _City = string.Empty;

private string _CompanyName = string.Empty;
private string _CountryCode = string.Empty;
private string _FaxNumber = string.Empty;
private string _PhoneNumber = string.Empty;
private string _PostalCode = string.Empty;
private bool _ResidentialAddress;
private string _StateProvinceCode = string.Empty;
private string _TaxIDNumber = string.Empty;

public string CompanyOrContactName
{
get { return _CompanyName; }
set { _CompanyName = value; }
}

public string AttentionName
{
get { return _AttentionName; }
set { _AttentionName = value; }
}

public string AccountNumber
{
get { return _AccountNumber; }
set { _AccountNumber = value; }
}

public string TaxIDNumber
{
get { return _TaxIDNumber; }
set { _TaxIDNumber = value; }
}

public string PhoneNumber
{
get { return _PhoneNumber; }
set { _PhoneNumber = value; }
}

public string FaxNumber
{
get { return _FaxNumber; }
set { _FaxNumber = value; }
}

public string AddressLine1
{
get { return _AddressLine1; }
set { _AddressLine1 = value; }
}

public string AddressLine2
{
get { return _AddressLine2; }
set { _AddressLine2 = value; }
}

public string AddressLine3
{
get { return _AddressLine3; }
set { _AddressLine3 = value; }
}

public string City
{
get { return _City; }
set { _City = value; }
}

public string StateProvinceCode
{
get { return _StateProvinceCode; }
set { _StateProvinceCode = value; }
}

public string PostalCode
{
get { return _PostalCode; }
set { _PostalCode = value; }
}

public string CountryCode
{
get { return _CountryCode; }
set { _CountryCode = value; }
}

public bool ResidentialAddress
{
get { return _ResidentialAddress; }
set { _ResidentialAddress = value; }
}
}
}
Loading
0