Καλησπέρα,
Χρησιμοποιώντας το nopCommerce φτιάχνω ένα νέο payment way για το σύστημα DeltaPay Gateway της Alpha Bank ακολουθώντας τα παρακάτω βήματα:
1) Create a new Class Library project Named "Nop.Payment.DeltaPay"
2)
Create a new Class named "DeltaPayPaymentProcessor" which implements
IPaymentMethod interface (add references to Nop.BusinessLogic,
Nop.Common, System.Web)
3) Transform PostProcessPayment()
4) Build and copy/paste the "Nop.Payment.DeltaPay.dll" file to bin directory of the web site
5) Add a record to the Nop.PaymentMethod table
Στην συνέχεια ανοίγοντας το web site από το VS:
1) δημιουργώ τον φάκελο ~/Templates/Payment/DeltaPay
2)
προσθέτω Web User Control με όνομα "PaymentModule.ascx" which inherited from
BaseNopfrontendUserControl and implement IPaymentMethodModule interface
<%@ Control Language="C#" AutoEventWireup="true"
Inherits="NopSolutions.NopCommerce.Web.Templates.Payment.DeltaPay.PaymentModule" Codebehind="PaymentModule.ascx.cs" %>
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td>
<b><%=GetLocaleResourceString("DeltaPayPaymentModule.Message")%></b>
</td>
</tr>
</table>
code file:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using NopSolutions.NopCommerce.BusinessLogic.Payment;
namespace NopSolutions.NopCommerce.Web.Templates.Payment.DeltaPay
{
public partial class PaymentModule: BaseNopFrontendUserControl, IPaymentMethodModule
{
public bool ValidateForm()
{
return true;
}
public PaymentInfo GetPaymentInfo()
{
PaymentInfo paymentInfo = new PaymentInfo();
paymentInfo.CreditCardType = string.Empty;
paymentInfo.CreditCardName = string.Empty;
paymentInfo.CreditCardNumber = string.Empty;
paymentInfo.CreditCardExpireYear = 0;
paymentInfo.CreditCardExpireMonth = 0;
paymentInfo.CreditCardCvv2 = string.Empty;
return paymentInfo;
}
}
}
Και εμφανίζει το παρακάτω error: "The name 'GetLocaleResourceString' does not exist in the current context
Εάν αφαιρέσω το <%=GetLocaleResourceString("DeltaPayPaymentModule.Message")%>
και στη συνέχεια τρέξω το site, κάνω μια παραγγελία τότε στη σελίδα checkoutpaymentmethod.aspx page μόλις "κλικάρω" το κουμπί "next"
χτυπαέι το λάθος:
Could not load type "NopSolutions.NopCommerce.Web.Templates.Payment.DeltaPay.PaymentModule".Εάν αντιγράψω τα PaymentModule files από το PaypalStandard δουλεύει κανονικά
Μήπως κάποιος γνωρίζει τι δεν κάνω καλά; (Στο site του nopCommerce έχω ανατρέξει ήδη...)
Ευθύμης Δ.