Skip to content

Commit

Permalink
Inclusão de configuração para descrição exibida no checkout.
Browse files Browse the repository at this point in the history
Alteração das imagens para logo do PayU #1
  • Loading branch information
rdakar committed Jun 11, 2017
1 parent 807d355 commit c74105b
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 7 deletions.
Binary file removed Content/Images/logoPagamento.jpg
Binary file not shown.
Binary file added Content/Images/logoPagamento.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion Controllers/PaymentPayUController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public PaymentPayUController(ISettingService settingService, IWebHelper webHelpe
[ChildActionOnly]
public ActionResult Configure()
{
var model = new ConfigurationModel() { EmailPayU = _payUPaymentSettings.EmailPayU };
var model = new ConfigurationModel() { EmailPayU = _payUPaymentSettings.EmailPayU, PaymentMethodDescription = _payUPaymentSettings.PaymentMethodDescription };
return View(@"~/Plugins/Payments.PayU/Views/PaymentPayU/Configure.cshtml", model);
}

Expand All @@ -41,6 +41,7 @@ public ActionResult Configure(ConfigurationModel model)
return Configure();

_payUPaymentSettings.EmailPayU = model.EmailPayU;
_payUPaymentSettings.PaymentMethodDescription = model.PaymentMethodDescription;
_settingService.SaveSetting(_payUPaymentSettings);

return View(@"~/Plugins/Payments.PayU/Views/PaymentPayU/Configure.cshtml", model);
Expand Down
3 changes: 3 additions & 0 deletions Models/ConfigurationModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@ public class ConfigurationModel : BaseNopModel
{
[NopResourceDisplayName("Plugins.Payments.EmailAdmin.PayU")]
public string EmailPayU { get; set; }

[NopResourceDisplayName("Plugins.Payments.MethodDescription.PayU")]
public string PaymentMethodDescription { get; set; }
}
}
6 changes: 3 additions & 3 deletions NopBrasil.Plugin.Payments.PayU.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@
<EmbeddedResource Include="Views\PaymentPayU\PaymentInfo.cshtml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<Content Include="Content\Images\logoPagamento.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Content\Images\nopCommerceBrasil.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
Expand Down Expand Up @@ -127,9 +130,6 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="Content\Images\logoPagamento.jpg">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Description.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand Down
8 changes: 6 additions & 2 deletions PayUPaymentProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,20 @@ public class PayUPaymentProcessor : BasePlugin, IPaymentMethod
private readonly ILogger _logger;
private readonly ISettingService _settingService;
private readonly IPaymentPayUService _payUService;
private readonly PayUPaymentSettings _payUPaymentSettings;

public PayUPaymentProcessor(ILogger logger, ISettingService settingService, IPaymentPayUService payUService)
public PayUPaymentProcessor(ILogger logger, ISettingService settingService, IPaymentPayUService payUService, PayUPaymentSettings payUPaymentSettings)
{
this._logger = logger;
this._settingService = settingService;
this._payUService = payUService;
this._payUPaymentSettings = payUPaymentSettings;
}

public override void Install()
{
this.AddOrUpdatePluginLocaleResource("Plugins.Payments.EmailAdmin.PayU", "Email castrado no PayU");
this.AddOrUpdatePluginLocaleResource("Plugins.Payments.MethodDescription.PayU", "Descrição que será exibida no checkout");
this.AddOrUpdatePluginLocaleResource("NopBrasil.Plugins.Payments.PayU.Fields.Redirection", "Você será redirecionado para a pagina do PayU.");
base.Install();
}
Expand All @@ -37,6 +40,7 @@ public override void Uninstall()
{
_settingService.DeleteSetting<PayUPaymentSettings>();
this.DeletePluginLocaleResource("Plugins.Payments.EmailAdmin.PayU");
this.DeletePluginLocaleResource("Plugins.Payments.MethodDescription.PayU");
this.DeletePluginLocaleResource("NopBrasil.Plugins.Payments.PayU.Fields.Redirection");
base.Uninstall();
}
Expand Down Expand Up @@ -117,6 +121,6 @@ public void GetPaymentInfoRoute(out string actionName, out string controllerName

public bool SkipPaymentInfo => false;

public string PaymentMethodDescription => "PayU";
public string PaymentMethodDescription => _payUPaymentSettings.PaymentMethodDescription;
}
}
1 change: 1 addition & 0 deletions PayUPaymentSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ namespace NopBrasil.Plugin.Payments.PayU
public class PayUPaymentSettings : ISettings
{
public string EmailPayU { get; set; }
public string PaymentMethodDescription { get; set; }
}
}
8 changes: 8 additions & 0 deletions Views/PaymentPayU/Configure.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@
</div>
</div>

<div class="form-group">
<div class="col-md-3">
@Html.NopLabelFor(model => model.PaymentMethodDescription)
</div>
<div class="col-md-9">
@Html.EditorFor(model => model.PaymentMethodDescription)
</div>
</div>

<div class="form-group">
<div class="col-md-3">
Expand Down
2 changes: 1 addition & 1 deletion Views/PaymentPayU/PaymentInfo.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<b>@T("NopBrasil.Plugins.Payments.PayU.Fields.Redirection")</b>
</td>
<td>
<img class ="imagemPagamento" src="../Plugins/Payments.PayU/Content/Images/logoPagamento.jpg">
<img class ="imagemPagamento" src="../Plugins/Payments.PayU/Content/Images/logoPagamento.png">
</td>
</tr>
</table>
Expand Down
Binary file modified logo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c74105b

Please sign in to comment.