Trying to add a new gateway - error

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 years ago
I have a created a new payment gateway for a company called SafePay but I am getting a runtime error so there must be something I missed. Just not sure what.

Here is the error: PaymentManager.cs line 86 (version 1.5)

var iPaymentMethod = Activator.CreateInstance(Type.GetType(paymentMethod.ClassName)) as IPaymentMethod;

value cannot be null

Any ideas?
13 years ago
Please ensure that Class name of your payment module (payment module details page in admin area) really exists. And ensure that you referenced your assembly in NopCommerceStore project (presume, you didn't)
13 years ago
Andrei,

Thanks for the quick response.


-Please ensure that Class name of your payment module (payment module details page in admin area) really exists.
--(yep it does)

- And ensure that you referenced your assembly in NopCommerceStore project (presume, you didn't)
--no, I did.

These are the steps that I have taken.

1.Create class library called Nop.Payment.SafePay
2.Added class SafePayPaymentProcessor.cs as a public class and implement the IPaymentmethod.
3. Add NopBusinessLogic and Nop.Common references to this project
4. compile this class library
5. reference this class in the nopcommerce store
6.Go to Administration in store and add SafePay directory to Payment
7. Add ConfigurePaymentMethod control to this
8. ConfigurePaymentMethod implements BaseNopAdministrationUserControl and IConfigurePaymentMethodModule
9. Go to Templates/Payment
10. Add SafePay directory with PaymentModule control
11. Payment module implements BaseNopUserControl, IPaymentMethodModule
12. Go to Admin and select SafePay under configure. Add the corresponding references and make Active. Save.

That's it but there must be something else I'm missing as it still gives me same error?
13 years ago
Fixed it. It was a typo. Left out the class name when configuring in the administrator. Done, it works.
13 years ago
Hello, I try to implement a new payment method, but after everythink goes well till the checkout Confirm page, after the click to checkout button skips back to checkout Information page. What I do wrong ? Bellow is my code: Thanks for any help.

RemotePost remotposthelp=new RemotePost();
                MobilpayEncrypt encrypt = new MobilpayEncrypt();
                Mobilpay_Payment_Request_Card card = new Mobilpay_Payment_Request_Card();
                Mobilpay_Payment_Invoice invoice = new Mobilpay_Payment_Invoice();
                Mobilpay_Payment_Address billing = new Mobilpay_Payment_Address();
                Mobilpay_Payment_Address shipping = new Mobilpay_Payment_Address();
                Mobilpay_Payment_Invoice_Item itmm = new Mobilpay_Payment_Invoice_Item();
                Mobilpay_Payment_Invoice_Item itmm1 = new Mobilpay_Payment_Invoice_Item();
                Mobilpay_Payment_ItemCollection itmColl = new Mobilpay_Payment_ItemCollection();
                Mobilpay_Payment_Exchange_RateCollection exColl = new Mobilpay_Payment_Exchange_RateCollection();
                Mobilpay_Payment_Exchange_Rate ex = new Mobilpay_Payment_Exchange_Rate();
                Mobilpay_Payment_Request_Contact_Info ctinfo = new Mobilpay_Payment_Request_Contact_Info();
                Mobilpay_Payment_Confirm conf = new Mobilpay_Payment_Confirm();
                Mobilpay_Payment_Request_Url url = new Mobilpay_Payment_Request_Url();
                
                MobilpayEncryptDecrypt.MobilpayEncryptDecrypt encdecr = new MobilpayEncryptDecrypt.MobilpayEncryptDecrypt();
                card.OrderId = yourtransactionId;
                card.Type = "card";
                card.Signature = signature;
                url.ConfirmUrl = CommonHelper.GetStoreLocation(false) + "TestsReturn.aspx";
                url.ReturnUrl = CommonHelper.GetStoreLocation(false);
                //card.Service = service;
                card.Url = url;
                card.TimeStamp = DateTime.Now.ToString("yyyyMMddhhmmss");
                invoice.Amount = youramount;
                invoice.Currency = yourcurrency;
                invoice.Details = yourdetails;
                billing.FirstName =order.BillingFirstName;
                billing.LastName = order.BillingLastName;
                billing.IdentityNumber = "";
                billing.FiscalNumber = "";
                billing.MobilPhone = order.BillingPhoneNumber;
                billing.Type = "";
                billing.ZipCode = order.BillingZipPostalCode;
                billing.Iban = "";
                billing.Address = order.BillingAddress1+order.BillingAddress2;
                billing.Bank = "";
                billing.City = order.BillingCity;
                billing.Country = order.BillingCountry;
                billing.County = order.BillingStateProvince;
                billing.Email = order.BillingEmail;

                shipping.FirstName = order.ShippingFirstName;
                shipping.LastName = order.ShippingLastName;
                shipping.IdentityNumber = "";
                shipping.FiscalNumber = "";
                shipping.MobilPhone = order.ShippingPhoneNumber;
                shipping.Type = "";
                shipping.ZipCode = order.ShippingZipPostalCode;
                shipping.Iban = "";
                shipping.Address = order.ShippingAddress1+order.ShippingAddress2;
                shipping.Bank = "";
                shipping.City = order.ShippingCity;
                shipping.Country =order.ShippingCountry;
                shipping.County = order.BillingStateProvince;
                shipping.Email = order.ShippingEmail;
              
                ctinfo.Billing = billing;
                ctinfo.Shipping = shipping;
                invoice.ContactInfo = ctinfo;
                card.Invoice = invoice;
                encrypt.Data = encdecr.GetXmlText(card);
                encrypt.X509CertificateFilePath = @"D:\public.cer";
                encdecr.Encrypt(encrypt);
                remotposthelp.Url = GetMobilPayUrl();
                remotposthelp.FormName = "mobilpay";
                remotposthelp.Add("data", encrypt.EncryptedData);
                    remotposthelp.Add("env_key",encrypt.EnvelopeKey);
                remotposthelp.Method="POST";
                    remotposthelp.Post();
                
                return string.Empty;
13 years ago
Hi,
This is your processor class ? and whats your error  ? did u try step by step on the code ...
13 years ago
Thank you for you answer. Yes this is my processor class, is NO ERROR message generated, but after PAYMENT CONFIRMATION page when I click <Next> is not oppening the the page of the Mobilpay card handler page but is skiping back to the PAYMENT INFORMATION page, and the application cycling between these 2 pages and I can not arrive to the page of card processor company.
12 years ago
Hi,
My implementation is almost identical to yours and it works. Check the GetMobilPayUrl() method. Also, you should use a modified version of the RemotePost class where the parameters "data" and "env_key" are not HtmlEncoded.

Bafta
12 years ago
thank you :) ! I also found the problem in this time. Multumesc mult ;)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.