Sage Payments Integration (not SagePay)

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
14 years ago
Long story short, I've realized that SagePay (which operates solely in the UK and is supported by nopCommerce) is not the same thing as Sage Payments (US based). Same umbrella company, but different APIs so might as well be apples and oranges as far as payment processing is concerned.

My question is, has anyone implemented a Sage Payments (www.sagepayments.com) payment option into nopCommerce 1.90? At the moment I'm trying to reverse engineer spaghetti code to figure this out so any help is hugely appreciated!
14 years ago
We need this capability also. I received the website integration documents from Sage Payment Solutions but am somewhat clueless. They do have ASP.net sample code.

Has anybody done this or is anybody interested in doing it for a fee?
13 years ago
Update: I've gotten as far as getting error messages from the SagePayments gateway asking for the correct C_NAME which I understand to be the name on the customer's credit card. I know this info can be called with paymentInfo.CreditCardName, but the PostProcessPayment method cannot be overloaded to work with the checkout process without changing every other payment option as well (please tell me I'm wrong). Here's the relevant code in the likely event this makes no sense:


namespace NopSolutions.NopCommerce.Payment.Methods.SagePayments
{
    public class SagePaymentsProcessor : IPaymentMethod
    {
.
.
//blah blah  tons of variables declared
.
.

public void ProcessPayment(PaymentInfo paymentInfo, Customer customer, Guid orderGuid, ref ProcessPaymentResult processPaymentResult)
        {
            
            processPaymentResult.PaymentStatus = PaymentStatusEnum.Pending;
            
            C_NAME = paymentInfo.CreditCardName;
            C_CVV = paymentInfo.CreditCardCvv2;
            C_CARDNUMBER = paymentInfo.CreditCardNumber;
            C_EXP = paymentInfo.CreditCardExpireMonth.ToString() + paymentInfo.CreditCardExpireYear.ToString();
        }
//TRIED TO OVERLOAD HERE
        public string PostProcessPayment(Order order, PaymentInfo paymentInfo)
        {
            C_NAME = paymentInfo.CreditCardName;
            C_CVV = paymentInfo.CreditCardCvv2;
            C_CARDNUMBER = paymentInfo.CreditCardNumber;
            C_EXP = paymentInfo.CreditCardExpireMonth.ToString() + paymentInfo.CreditCardExpireYear.ToString();
            return "blah";
        }
        public string PostProcessPayment(Order order)
        {
            
            M_ID = "************";
            M_KEY = "**************";
            //C_NAME = order.CardName;
            C_ADDRESS = order.BillingAddress1;
            C_CITY = order.BillingCity;
            C_STATE = order.BillingStateProvince;
            C_ZIP = order.BillingZipPostalCode;
            C_COUNTRY = order.BillingCountry;
            C_EMAIL = order.BillingEmail;
            //C_CARDNUMBER = order.CardNumber;
            //C_EXP = order.CardExpirationMonth + order.CardExpirationYear;
            //C_CVV = order.CardCvv2;
            T_CUSTOMER_NUMBER = order.CustomerId.ToString();
            T_AMT = order.OrderTotal.ToString();
            T_SHIPPING = order.OrderShippingExclTaxInCustomerCurrency.ToString();
            T_TAX = order.PaymentMethodAdditionalFeeExclTaxInCustomerCurrency.ToString();
            T_ORDERNUM = order.OrderId.ToString();
            C_TELEPHONE = order.BillingPhoneNumber;
            C_FAX = order.BillingFaxNumber;
            C_SHIP_NAME = order.ShippingFullName;
            C_SHIP_ADDRESS = order.ShippingAddress1;
            C_SHIP_CITY = order.ShippingCity;
            C_SHIP_STATE = order.ShippingStateProvince;
            C_SHIP_ZIP = order.ShippingZipPostalCode;
            C_SHIP_COUNTRY = order.ShippingCountry;


            Nop.Payment.SagePayments.net.sagepayments.www.TRANSACTION_PROCESSING sagepayments = new Nop.Payment.SagePayments.net.sagepayments.www.TRANSACTION_PROCESSING();
            DataSet dataset = sagepayments.BANKCARD_AUTHONLY(M_ID, M_KEY, C_NAME, C_ADDRESS, C_CITY, C_STATE, C_ZIP, C_COUNTRY, C_EMAIL, C_CARDNUMBER, C_EXP, C_CVV,
                T_CUSTOMER_NUMBER, T_AMT, T_SHIPPING, T_TAX, T_ORDERNUM, C_TELEPHONE, C_FAX, C_SHIP_NAME, C_SHIP_ADDRESS, C_SHIP_CITY, C_SHIP_STATE, C_SHIP_ZIP, C_SHIP_COUNTRY);

            DataRow row = dataset.Tables[0].Rows[0];

            string message = row[2].ToString();
            string indicator = row[0].ToString(); //A = approved, E= front-end error, X= Gateway Error
            string code = row[1].ToString();
            string resp = "";

            for (int i = 0; i < dataset.Tables[0].Columns.Count; i++)
            {
                resp += (dataset.Tables[0].Columns[i].ColumnName + ": " + row[i].ToString() + "<br />");
            }
            return resp;
        }


Any help is much appreciated.
13 years ago
awpg -

Have you been successful with getting this going? We need it also but I am not as technical as you obviously are.

Please let us know if you got it working and what the final solution is.

Thank you in advance
13 years ago
Hey, sorry for the late reply.

We more or less gave up and moved the client to authorize.net instead. Good luck!
13 years ago
Darn ... Our client already has a merchant account using Sage Payments integrated with their Peachtree accounting system. They don't want to add another merchant account with the accompanying monthly fees. I don't blame them.

Would anybody be interested in developing what is needed for Sage Payments for a fee??. Sage sent the specs to us.

Or is there a better place to post this request?

Thanks
11 years ago
I'm looking into integrating with Sage Payments now; could you send me the specs or any info on whether you ever got it going?
11 years ago
Hi,
Did you completed this task.
please help me to complete this task
Thanks in advance
9 years ago
I need help integrating Sage Payments Pro (US & Canada) with X-Payments for X-Cart. Any takers?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.