แอปพลิเคชันถูกสร้างขึ้นเพื่อการศึกษา โครงการใช้รูปแบบการเก็บข้อมูลและรูปแบบการฉีดพึ่งพา
ไม่ควรใช้สำหรับธุรกิจจริงใด ๆ ฉันไม่ได้รับการตอบโต้ใด ๆ หากคุณตัดสินใจที่จะใช้สำหรับการทำธุรกรรมจริง ก่อนที่คุณจะทำตรวจสอบให้แน่ใจว่าแอปพลิเคชันเป็นไปตามมาตรฐานความปลอดภัย
update-databaselogin: [email protected] password: Qwerty1! คุณสามารถเปลี่ยนได้ที่แท็บ "บัญชีของคุณ" ทำหลังจากที่คุณตั้งค่าการตั้งค่า SMTP ของคุณที่ "แผงผู้ดูแลระบบ" - ขั้นตอนด้านล่างข้อผิดพลาดของแอปพลิเคชันกำลังเข้าสู่ระบบใน APP_DATA/บันทึก
ไปที่ E -Shop -Engine.Services -> บริการ -> การชำระเงินและสร้างโฟลเดอร์ใหม่
มี 2 คลาสรุ่นที่การชำระเงินสามารถสืบทอดได้จาก: PaymentDetails (มีวัตถุประสงค์เพื่อส่งข้อมูลไปยังเซิร์ฟเวอร์ภายนอก) และ PaymentResponse (มีวัตถุประสงค์เพื่อรับข้อมูลจากเซิร์ฟเวอร์ภายนอก)
สร้างอินเทอร์เฟซสำหรับบริการที่สืบทอดมาจาก iPaymentservice จากนั้นสร้างการใช้งาน
public class DotPayPaymentService : IDotPayPaymentService
{
private static Settings settings;
public DotPayPaymentService(ISettingsRepository settingsRepository)
{
settings = settingsRepository.Get();
}
// The implementation...
}
ตอนนี้ไปที่ e -shop -engine.website -> คอนโทรลเลอร์ -> การชำระเงินและสร้างคอนโทรลเลอร์ใหม่
คอนโทรลเลอร์ควรสืบทอดจาก basepaymentcontroller
public class DotPayController : BasePaymentController
{
public DotPayController(
IOrderRepository orderRepository,
ICartRepository cartRepository,
ISettingsRepository settingsRepository,
IMailingService mailingService,
IDotPayPaymentService paymentService,
IAppUserManager userManager,
IUnitOfWork unitOfWork)
: base(
orderRepository,
cartRepository,
settingsRepository,
mailingService,
paymentService,
userManager,
unitOfWork)
{
//
}
ลงทะเบียนวิธีการชำระเงินใหม่ใน autofac (e -shop -engine.website -> app_start -> autofacconfig) builder.RegisterType<DotPayPaymentService>().As<IDotPayPaymentService>().InstancePerRequest();
ไปที่มุมมอง -> การชำระเงิน -> เลือกและเพิ่มการชำระเงินใหม่ โปรดจำไว้ว่าให้ตั้งค่าองค์ประกอบอินพุตเหมือนกับชื่อคอนโทรลเลอร์ <div class="custom-control custom-checkbox form-control-lg"> <input type="radio" name="paymentMethod" class="custom-control-input" id="dotpay" value="DotPay"> <label class="custom-control-label" for="dotpay"> <img src="~/Content/payment/dotpay_logo.jpg" class="payment-img" /> </label> </div>
โครงการนี้ได้รับใบอนุญาตภายใต้ใบอนุญาต MIT