- @*
@L["Payment"]
*@
@await Component.InvokeAsync(typeof(PaymentWidgetViewComponent))
diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/Payment.cshtml.cs b/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/Payment.cshtml.cs
index d4191c8c..aac4373c 100644
--- a/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/Payment.cshtml.cs
+++ b/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/Payment.cshtml.cs
@@ -59,7 +59,7 @@ public class PaymentModel : AbpPageModel
var placedOrder = await _orderAppService.CreateAsync(new OrderCreateDto()
{
- PaymentTypeId = 1, // Paypal
+ PaymentTypeId = model.SelectedPaymentId,
Address = GetUserAddress(model.SelectedAddressId),
Products = productItems
});
diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/ServiceProviders/PaymentTypeProvider.cs b/apps/public-web/src/EShopOnAbp.PublicWeb/ServiceProviders/PaymentTypeProvider.cs
new file mode 100644
index 00000000..a2b9d755
--- /dev/null
+++ b/apps/public-web/src/EShopOnAbp.PublicWeb/ServiceProviders/PaymentTypeProvider.cs
@@ -0,0 +1,24 @@
+using System.Collections.Generic;
+using Volo.Abp.DependencyInjection;
+
+namespace EShopOnAbp.PublicWeb.ServiceProviders;
+
+public class PaymentTypeProvider : ITransientDependency
+{
+ public List
GetPaymentTypes()
+ {
+ return new List
+ {
+ new() {Id = 0, Name = "Demo", IconCss = "fa-credit-card demo", IsDefault = true},
+ new() {Id = 1, Name = "Paypal", IconCss = "fa-cc-paypal paypal"}
+ };
+ }
+}
+
+public class PaymentType
+{
+ public int Id { get; set; }
+ public string Name { get; set; }
+ public string IconCss { get; set; }
+ public bool IsDefault { get; set; } = false;
+}
\ No newline at end of file
diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/ServiceProviders/UserAddressProvider.cs b/apps/public-web/src/EShopOnAbp.PublicWeb/ServiceProviders/UserAddressProvider.cs
index 6e343752..9c69caa0 100644
--- a/apps/public-web/src/EShopOnAbp.PublicWeb/ServiceProviders/UserAddressProvider.cs
+++ b/apps/public-web/src/EShopOnAbp.PublicWeb/ServiceProviders/UserAddressProvider.cs
@@ -26,8 +26,7 @@ public class UserAddressProvider : ITransientDependency
Street = "Yeşilköy Serbest Bölge Mah. E-Blok Sk. Bakırköy",
City = "İstanbul",
Country = "Turkey",
- ZipCode = "34149",
- Description = "Near Ataturk Airport"
+ ZipCode = "34149"
}
};
}
@@ -38,7 +37,6 @@ public class AddressDto
public int Id { get; set; }
public string Type { get; set; }
public bool IsDefault { get; set; } = false;
- public string Description { get; set; }
public string Street { get; set; }
public string City { get; set; }
public string Country { get; set; }
diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/components/payment/payment-widget.css b/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/components/payment/payment-widget.css
index 1b38f784..90e9a095 100644
--- a/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/components/payment/payment-widget.css
+++ b/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/components/payment/payment-widget.css
@@ -17,4 +17,16 @@
.is-selected {
border: solid #bfbfe3;
+}
+
+.payment-type-header {
+ font-weight: 500;
+}
+
+.paypal {
+ color: #6c84fa;
+}
+
+.demo {
+ color: darkgray;
}
\ No newline at end of file
diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/components/payment/payment-widget.js b/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/components/payment/payment-widget.js
index b246c5f1..1c541575 100644
--- a/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/components/payment/payment-widget.js
+++ b/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/components/payment/payment-widget.js
@@ -6,12 +6,20 @@
$wrapper
.find('.address-list .card')
.click(function () {
- var $this = $(this);
- var addressId = $this.attr('data-address-id');
- abp.utils.setCookieValue("selected-address", addressId);
+ const $this = $(this);
+ // const addressId = $this.attr('data-address-id');
$this.parents(".address-list").find('.card').removeClass("is-selected");
$this.addClass("is-selected");
});
+
+ $wrapper
+ .find('.payment-list .card')
+ .click(el => {
+ const $this = $(el.currentTarget);
+ // const paymentTypeId = $this.attr('data-payment-id');
+ $this.parents(".payment-list").find('.card').removeClass("is-selected");
+ $this.addClass("is-selected");
+ });
};
return {