Skip to content

Commit 3da0dfa

Browse files
PayPal plugin minor improvements
1 parent 39a22bb commit 3da0dfa

18 files changed

Lines changed: 336 additions & 368 deletions
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#paypal-checkout .selection-text {
2+
text-align: right;
3+
font-weight: bold;
4+
padding: 12px 15px 5px 0;
5+
}
6+
7+
#paypal-checkout .form-horizontal {
8+
text-align: right;
9+
}
10+
11+
#paypal-checkout #paypal-express-button {
12+
cursor: pointer;
13+
}
14+
.configure-paypal-direct .logo,
15+
.configure-paypal-express .logo,
16+
.configure-paypal-standard .logo
17+
.paypal-standard-public .logo{
18+
width: 200px;
19+
height: 53px;
20+
margin-bottom: 10px;
21+
}
22+
.paypal-standard-public {
23+
margin-bottom: 10px;
24+
}
25+
.configure-paypal-standard .enable-ipn-hint{
26+
float: right;
27+
font-size: 0.9em;
28+
font-style: italic;
29+
}
30+
.button-save {
31+
padding-top: 10px;
32+
}
33+
.form-horizontal.paypal-direct #s2id_CreditCardType{
34+
min-width: 180px;
35+
}
36+
.form-horizontal.paypal-direct #CardholderName,
37+
.form-horizontal.paypal-direct #CardNumber{
38+
width: 165px;
39+
}
40+
.form-horizontal.paypal-direct #s2id_ExpireMonth,
41+
.form-horizontal.paypal-direct #s2id_ExpireYears {
42+
min-width: 83px;
43+
}
44+
.form-horizontal.paypal-direct #CardCode {
45+
width: 60px;
46+
}

src/Plugins/SmartStore.PayPal/Content/smartstore.paypalexpress.css

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/Plugins/SmartStore.PayPal/Extensions/MiscExtensions.cs

Lines changed: 0 additions & 70 deletions
This file was deleted.

src/Plugins/SmartStore.PayPal/Localization/resources.de-de.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
<Language Name="Deutsch" IsDefault="true" IsRightToLeft="false">
2+
3+
<LocaleResource Name="Plugins.FriendlyName.SmartStore.PayPal" AppendRootKey="false">
4+
<Value>PayPal Zahlungsmethoden</Value>
5+
</LocaleResource>
6+
<LocaleResource Name="Plugins.Description.SmartStore.PayPal" AppendRootKey="false">
7+
<Value>Stellt die PayPal-Zahlungsmethoden PayPal Express, PayPal Standard und PayPal Direct zur Verfügung.</Value>
8+
</LocaleResource>
9+
210
<LocaleResource Name="Plugins.FriendlyName.Payments.PayPalExpress" AppendRootKey="false">
311
<Value>PayPal Express</Value>
412
</LocaleResource>

src/Plugins/SmartStore.PayPal/Localization/resources.en-us.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
<Language Name="English" IsDefault="false" IsRightToLeft="false">
2+
3+
<LocaleResource Name="Plugins.FriendlyName.SmartStore.PayPal" AppendRootKey="false">
4+
<Value>PayPal Payment Methods</Value>
5+
</LocaleResource>
6+
<LocaleResource Name="Plugins.Description.SmartStore.PayPal" AppendRootKey="false">
7+
<Value>Provides the PayPal payment methods PayPal Express, PayPal Standard and PayPal Direct.</Value>
8+
</LocaleResource>
9+
210
<LocaleResource Name="Plugins.FriendlyName.Payments.PayPalExpress" AppendRootKey="false">
311
<Value>PayPal Express</Value>
412
</LocaleResource>

src/Plugins/SmartStore.PayPal/Plugin.cs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
namespace SmartStore.PayPal
99
{
10-
public class Plugin : BasePlugin, IConfigurable
10+
public class Plugin : BasePlugin
1111
{
1212
private readonly ISettingService _settingService;
1313
private readonly ILocalizationService _localizationService;
@@ -63,13 +63,5 @@ public override void Uninstall()
6363

6464
base.Uninstall();
6565
}
66-
67-
68-
public void GetConfigurationRoute(out string actionName, out string controllerName, out RouteValueDictionary routeValues)
69-
{
70-
actionName = "Configure";
71-
controllerName = "PayPalExpress";
72-
routeValues = new RouteValueDictionary() { { "Namespaces", "SmartStore.PayPal.Controllers" }, { "area", "SmartStore.PayPal" } };
73-
}
7466
}
7567
}

src/Plugins/SmartStore.PayPal/Providers/PayPalDirect.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ protected ProcessPaymentResult AuthorizeOrSale(ProcessPaymentRequest processPaym
128128
details.PaymentDetails.OrderTotal.Value = Math.Round(processPaymentRequest.OrderTotal, 2).ToString("N", new CultureInfo("en-us"));
129129
details.PaymentDetails.OrderTotal.currencyID = payPalCurrency;
130130
details.PaymentDetails.Custom = processPaymentRequest.OrderGuid.ToString();
131-
details.PaymentDetails.ButtonSource = "SmartStore.NET";
131+
details.PaymentDetails.ButtonSource = SmartStoreVersion.CurrentFullVersion;
132132
//shipping
133133
if (customer.ShippingAddress != null)
134134
{

src/Plugins/SmartStore.PayPal/Providers/PayPalExpress.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
using SmartStore.PayPal.Controllers;
77
using SmartStore.PayPal.Services;
88
using SmartStore.PayPal.Settings;
9-
using SmartStore.PayPal.Extensions;
109
using SmartStore.Core.Configuration;
1110
using SmartStore.Core.Domain.Orders;
1211
using SmartStore.Core.Plugins;
@@ -82,7 +81,7 @@ public override void PostProcessPayment(PostProcessPaymentRequest postProcessPay
8281
/// <returns>Additional handling fee</returns>
8382
public override decimal GetAdditionalHandlingFee(IList<OrganizedShoppingCartItem> cart)
8483
{
85-
var settings = _settingService.LoadPayPalExpressSettings("PayPalExpress", _services.StoreContext.CurrentStore.Id);
84+
var settings = _settingService.LoadSetting<PayPalExpressSettings>(_services.StoreContext.CurrentStore.Id);
8685

8786
var result = this.CalculateAdditionalFee(_orderTotalCalculationService, cart,
8887
settings.AdditionalFee, settings.AdditionalFeePercentage);

src/Plugins/SmartStore.PayPal/Services/PayPalExpressApiService.cs

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
using SmartStore.Core.Infrastructure;
1616
using SmartStore.PayPal.PayPalSvc;
1717
using SmartStore.PayPal.Settings;
18-
using SmartStore.PayPal.Extensions;
1918
using SmartStore.Services;
2019
using SmartStore.Services.Catalog;
2120
using SmartStore.Services.Common;
@@ -94,7 +93,7 @@ public PayPalExpressApiService(
9493

9594
public ProcessPaymentResult ProcessPayment(ProcessPaymentRequest request)
9695
{
97-
var settings = _settingService.LoadPayPalExpressSettings("PayPalExpress", _services.StoreContext.CurrentStore.Id);
96+
var settings = _settingService.LoadSetting<PayPalExpressSettings>(_services.StoreContext.CurrentStore.Id);
9897
var doPayment = DoExpressCheckoutPayment(request);
9998
var result = new ProcessPaymentResult();
10099

@@ -128,7 +127,7 @@ public void PostProcessPayment(PostProcessPaymentRequest request)
128127
public CapturePaymentResult Capture(CapturePaymentRequest request)
129128
{
130129
var result = new CapturePaymentResult();
131-
var settings = _settingService.LoadPayPalExpressSettings("PayPalExpress", _services.StoreContext.CurrentStore.Id);
130+
var settings = _settingService.LoadSetting<PayPalExpressSettings>(_services.StoreContext.CurrentStore.Id);
132131

133132
string authorizationId = request.Order.AuthorizationTransactionId;
134133
var req = new DoCaptureReq();
@@ -171,7 +170,7 @@ public CapturePaymentResult Capture(CapturePaymentRequest request)
171170

172171
public VoidPaymentResult Void(VoidPaymentRequest request)
173172
{
174-
var settings = _settingService.LoadPayPalExpressSettings("PayPalExpress", _services.StoreContext.CurrentStore.Id);
173+
var settings = _settingService.LoadSetting<PayPalExpressSettings>(_services.StoreContext.CurrentStore.Id);
175174
var result = new VoidPaymentResult();
176175

177176
string transactionId = request.Order.AuthorizationTransactionId;
@@ -216,7 +215,7 @@ public RefundPaymentResult Refund(RefundPaymentRequest request)
216215
{
217216

218217
var result = new RefundPaymentResult();
219-
var settings = _settingService.LoadPayPalExpressSettings("PayPalExpress", _services.StoreContext.CurrentStore.Id);
218+
var settings = _settingService.LoadSetting<PayPalExpressSettings>(_services.StoreContext.CurrentStore.Id);
220219

221220
string transactionId = request.Order.CaptureTransactionId;
222221

@@ -261,7 +260,7 @@ public CancelRecurringPaymentResult CancelRecurringPayment(CancelRecurringPaymen
261260
{
262261

263262
var result = new CancelRecurringPaymentResult();
264-
var settings = _settingService.LoadPayPalExpressSettings("PayPalExpress", _services.StoreContext.CurrentStore.Id);
263+
var settings = _settingService.LoadSetting<PayPalExpressSettings>(_services.StoreContext.CurrentStore.Id);
265264
var order = request.Order;
266265

267266
var req = new ManageRecurringPaymentsProfileStatusReq();
@@ -302,7 +301,7 @@ public SetExpressCheckoutResponseType SetExpressCheckout(PayPalProcessPaymentReq
302301
{
303302
var result = new SetExpressCheckoutResponseType();
304303
var currentStore = _storeContext.CurrentStore;
305-
var settings = _settingService.LoadPayPalExpressSettings("PayPalExpress", _services.StoreContext.CurrentStore.Id);
304+
var settings = _settingService.LoadSetting<PayPalExpressSettings>(_services.StoreContext.CurrentStore.Id);
306305

307306
var req = new SetExpressCheckoutReq
308307
{
@@ -465,7 +464,7 @@ public SetExpressCheckoutResponseType SetExpressCheckout(PayPalProcessPaymentReq
465464
currencyID = PayPalHelper.GetPaypalCurrency(_currencyService.GetCurrencyById(_currencySettings.PrimaryStoreCurrencyId))
466465
},
467466
Custom = processPaymentRequest.OrderGuid.ToString(),
468-
ButtonSource = "SmartStore.NET",
467+
ButtonSource = SmartStoreVersion.CurrentFullVersion,
469468
PaymentAction = PayPalHelper.GetPaymentAction(settings),
470469
PaymentDetailsItem = cartItems.ToArray()
471470
};
@@ -506,7 +505,7 @@ public SetExpressCheckoutResponseType SetExpressCheckout(PayPalProcessPaymentReq
506505
public GetExpressCheckoutDetailsResponseType GetExpressCheckoutDetails(string token)
507506
{
508507
var result = new GetExpressCheckoutDetailsResponseType();
509-
var settings = _settingService.LoadPayPalExpressSettings("PayPalExpress", _services.StoreContext.CurrentStore.Id);
508+
var settings = _settingService.LoadSetting<PayPalExpressSettings>(_services.StoreContext.CurrentStore.Id);
510509

511510
using (var service = new PayPalAPIAASoapBinding())
512511
{
@@ -537,7 +536,7 @@ public GetExpressCheckoutDetailsResponseType GetExpressCheckoutDetails(string to
537536

538537
public ProcessPaymentRequest SetCheckoutDetails(ProcessPaymentRequest processPaymentRequest, GetExpressCheckoutDetailsResponseDetailsType checkoutDetails)
539538
{
540-
var settings = _settingService.LoadPayPalExpressSettings("PayPalExpress", _services.StoreContext.CurrentStore.Id);
539+
var settings = _settingService.LoadSetting<PayPalExpressSettings>(_services.StoreContext.CurrentStore.Id);
541540
int customerId = Convert.ToInt32(_workContext.CurrentCustomer.Id.ToString());
542541
var customer = _customerService.GetCustomerById(customerId);
543542

@@ -697,7 +696,7 @@ public ProcessPaymentRequest SetCheckoutDetails(ProcessPaymentRequest processPay
697696
/// <returns>Result</returns>
698697
public bool VerifyIPN(string formString, out Dictionary<string, string> values)
699698
{
700-
var settings = _settingService.LoadPayPalExpressSettings("PayPalExpress", _services.StoreContext.CurrentStore.Id);
699+
var settings = _settingService.LoadSetting<PayPalExpressSettings>(_services.StoreContext.CurrentStore.Id);
701700
var req = (HttpWebRequest)WebRequest.Create(PayPalHelper.GetPaypalUrl(settings));
702701
req.Method = "POST";
703702
req.ContentType = "application/x-www-form-urlencoded";
@@ -733,7 +732,7 @@ public bool VerifyIPN(string formString, out Dictionary<string, string> values)
733732
public DoExpressCheckoutPaymentResponseType DoExpressCheckoutPayment(ProcessPaymentRequest processPaymentRequest)
734733
{
735734
var result = new DoExpressCheckoutPaymentResponseType();
736-
var settings = _settingService.LoadPayPalExpressSettings("PayPalExpress", _services.StoreContext.CurrentStore.Id);
735+
var settings = _settingService.LoadSetting<PayPalExpressSettings>(_services.StoreContext.CurrentStore.Id);
737736

738737
// populate payment details
739738
var paymentDetails = new PaymentDetailsType
@@ -744,7 +743,7 @@ public DoExpressCheckoutPaymentResponseType DoExpressCheckoutPayment(ProcessPaym
744743
currencyID = PayPalHelper.GetPaypalCurrency(_currencyService.GetCurrencyById(_currencySettings.PrimaryStoreCurrencyId))
745744
},
746745
Custom = processPaymentRequest.OrderGuid.ToString(),
747-
ButtonSource = "SmartStore.NET"
746+
ButtonSource = SmartStoreVersion.CurrentFullVersion
748747
};
749748

750749
// build the request

src/Plugins/SmartStore.PayPal/SmartStore.PayPal.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@
113113
<Compile Include="Controllers\PayPalDirectController.cs" />
114114
<Compile Include="Controllers\PayPalExpressController.cs" />
115115
<Compile Include="DependencyRegistrar.cs" />
116-
<Compile Include="Extensions\MiscExtensions.cs" />
117116
<Compile Include="Models\PayPalStandardConfigurationModel.cs" />
118117
<Compile Include="Models\PayPalDirectConfigurationModel.cs" />
119118
<Compile Include="Models\PayPalDirectPaymentInfoModel.cs" />
@@ -181,7 +180,7 @@
181180
<Content Include="Content\images\logo200x53.png">
182181
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
183182
</Content>
184-
<Content Include="Content\smartstore.paypalexpress.css">
183+
<Content Include="Content\smartstore.paypal.css">
185184
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
186185
</Content>
187186
<Content Include="Content\icon.png">

0 commit comments

Comments
 (0)