Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

Plugin - Payments.PayPalStandard - allow to set display order

KrzysztofPajakab8fbcd0ba23
diff --git a/src/Plugins/Payments.PayPalStandard/Controllers/PaymentPayPalStandardController.cs b/src/Plugins/Payments.PayPalStandard/Controllers/PaymentPayPalStandardController.cs
index be788714f..ecac61d39 100644
--- a/src/Plugins/Payments.PayPalStandard/Controllers/PaymentPayPalStandardController.cs
+++ b/src/Plugins/Payments.PayPalStandard/Controllers/PaymentPayPalStandardController.cs
@@ -105,6 +105,7 @@ namespace Payments.PayPalStandard.Controllers
model.AdditionalFee = payPalStandardPaymentSettings.AdditionalFee;
model.AdditionalFeePercentage = payPalStandardPaymentSettings.AdditionalFeePercentage;
model.PassProductNamesAndTotals = payPalStandardPaymentSettings.PassProductNamesAndTotals;
+ model.DisplayOrder = payPalStandardPaymentSettings.DisplayOrder;
model.StoreScope = storeScope;
@@ -134,6 +135,7 @@ namespace Payments.PayPalStandard.Controllers
payPalStandardPaymentSettings.AdditionalFee = model.AdditionalFee;
payPalStandardPaymentSettings.AdditionalFeePercentage = model.AdditionalFeePercentage;
payPalStandardPaymentSettings.PassProductNamesAndTotals = model.PassProductNamesAndTotals;
+ payPalStandardPaymentSettings.DisplayOrder = model.DisplayOrder;
await _settingService.SaveSetting(payPalStandardPaymentSettings, storeScope);
diff --git a/src/Plugins/Payments.PayPalStandard/Models/ConfigurationModel.cs b/src/Plugins/Payments.PayPalStandard/Models/ConfigurationModel.cs
index 917aebd54..ef260e5ad 100644
--- a/src/Plugins/Payments.PayPalStandard/Models/ConfigurationModel.cs
+++ b/src/Plugins/Payments.PayPalStandard/Models/ConfigurationModel.cs
@@ -28,5 +28,10 @@ namespace Payments.PayPalStandard.Models
[GrandResourceDisplayName("Plugins.Payments.PayPalStandard.Fields.PassProductNamesAndTotals")]
public bool PassProductNamesAndTotals { get; set; }
+ [GrandResourceDisplayName("Plugins.Payments.PayPalStandard.Fields.DisplayOrder")]
+ public int DisplayOrder { get; set; }
+
+
+
}
}
\ No newline at end of file
diff --git a/src/Plugins/Payments.PayPalStandard/PayPalStandardPaymentPlugin.cs b/src/Plugins/Payments.PayPalStandard/PayPalStandardPaymentPlugin.cs
index dde3c76d8..70f8dec9e 100644
--- a/src/Plugins/Payments.PayPalStandard/PayPalStandardPaymentPlugin.cs
+++ b/src/Plugins/Payments.PayPalStandard/PayPalStandardPaymentPlugin.cs
@@ -33,7 +33,6 @@ namespace Payments.PayPalStandard
#endregion
-
#region Methods
/// <summary>
@@ -74,6 +73,8 @@ namespace Payments.PayPalStandard
await this.AddOrUpdatePluginTranslateResource(_translationService, _languageService, "Plugins.Payments.PayPalStandard.Instructions", "<p><b>If you're using this gateway ensure that your primary store currency is supported by PayPal.</b><br /><br />To use PDT, you must activate PDT and Auto Return in your PayPal account profile. You must also acquire a PDT identity token, which is used in all PDT communication you send to PayPal. Follow these steps to configure your account for PDT:<br /><br />1. Log in to your PayPal account (click <a href=\"https://www.paypal.com/us/webapps/mpp/referral/paypal-business-account2?partner_id=9JJPJNNPQ7PZ8\" target=\"_blank\">here</a> to create your account).<br />2. Click the Profile subtab.<br />3. Click Website Payment Preferences in the Seller Preferences column.<br />4. Under Auto Return for Website Payments, click the On radio button.<br />5. For the Return URL, enter the URL on your site that will receive the transaction ID posted by PayPal after a customer payment ({0}).<br />6. Under Payment Data Transfer, click the On radio button.<br />7. Click Save.<br />8. Click Website Payment Preferences in the Seller Preferences column.<br />9. Scroll down to the Payment Data Transfer section of the page to view your PDT identity token.<br /><br /></p>");
await this.AddOrUpdatePluginTranslateResource(_translationService, _languageService, "Plugins.Payments.PayPalStandard.PaymentMethodDescription", "You will be redirected to PayPal site to complete the payment");
await this.AddOrUpdatePluginTranslateResource(_translationService, _languageService, "Plugins.Payments.PayPalStandard.RoundingWarning", "It looks like you have \"ShoppingCartSettings.RoundPricesDuringCalculation\" setting disabled. Keep in mind that this can lead to a discrepancy of the order total amount, as PayPal only rounds to two doubles.");
+ await this.AddOrUpdatePluginTranslateResource(_translationService, _languageService, "Plugins.Payments.PayPalStandard.Fields.DisplayOrder", "Display order");
+
await base.Install();
}
diff --git a/src/Plugins/Payments.PayPalStandard/Views/PaymentPayPalStandard/Configure.cshtml b/src/Plugins/Payments.PayPalStandard/Views/PaymentPayPalStandard/Configure.cshtml
index 4274b0a49..e14668188 100644
--- a/src/Plugins/Payments.PayPalStandard/Views/PaymentPayPalStandard/Configure.cshtml
+++ b/src/Plugins/Payments.PayPalStandard/Views/PaymentPayPalStandard/Configure.cshtml
@@ -71,7 +71,7 @@
<div class="col-md-9 col-sm-9">
<label class="mt-checkbox mt-checkbox-outline control control-checkbox">
<admin-input asp-for="UseSandbox" />
- <div class="control__indicator"></div>
+ <div class="control__indicator"></div>
</label>
<span asp-validation-for="UseSandbox"></span>
</div>
@@ -101,7 +101,7 @@
<div class="col-md-9 col-sm-9">
<label class="mt-checkbox mt-checkbox-outline control control-checkbox">
<admin-input asp-for="PdtValidateOrderTotal" />
- <div class="control__indicator"></div>
+ <div class="control__indicator"></div>
</label>
<span asp-validation-for="PdtValidateOrderTotal"></span>
</div>
@@ -122,7 +122,7 @@
<div class="col-md-9 col-sm-9">
<label class="mt-checkbox mt-checkbox-outline control control-checkbox">
<admin-input asp-for="AdditionalFeePercentage" />
- <div class="control__indicator"></div>
+ <div class="control__indicator"></div>
</label>
<span asp-validation-for="AdditionalFeePercentage"></span>
</div>
@@ -134,11 +134,20 @@
<div class="col-md-9 col-sm-9">
<label class="mt-checkbox mt-checkbox-outline control control-checkbox">
<admin-input asp-for="PassProductNamesAndTotals" />
- <div class="control__indicator"></div>
+ <div class="control__indicator"></div>
</label>
<span asp-validation-for="PassProductNamesAndTotals"></span>
</div>
</div>
+ <div class="form-group">
+ <div class="col-md-3 col-sm-3 text-right">
+ <admin-label asp-for="DisplayOrder" class="control-label" />
+ </div>
+ <div class="col-md-9 col-sm-9">
+ <admin-input asp-for="DisplayOrder" />
+ <span asp-validation-for="DisplayOrder"></span>
+ </div>
+ </div>
</div>
<div class="form-actions">
<div class="row">