YetAnotherForum
Welcome Guest Search | Active Topics | Log In | Register

Trans.SubmitTransaction() Options
jadrianb
#1 Posted : Wednesday, July 13, 2011 1:50:00 PM
Rank: Starting Member

Groups: Registered

Joined: 7/13/2011
Posts: 1
Location: Knoxville, TN
I copied code from DoSale.aspx in a PayPay sample project. The code works great in dev, but when I convert it to use production payment servers, the sale always fails. Any ideas? The failure says "Declined." The expiration dates are always shown as 2020, even though I am passing the correct date. I am trying to get more details from the customer, but they won't let me into the PayPal backend so I can see the errors for myself. Thanks!



Code:
        UserInfo User = new UserInfo(sUSER, sVENDOR, sPARTNER, sPWD);

        // Create the Payflow  Connection data object with the required connection details.
        // The PAYFLOW_HOST property is defined in the App config file.
        PayflowConnectionData Connection = new PayflowConnectionData();

        // Create a new Invoice data object with the Amount, Billing Address etc. details.
        Invoice Inv = new Invoice();

        string sCardNo = txtCreditNo.Text.Trim();
        string exp = cboCCMonth.SelectedItem.Value + cboCCYear.SelectedItem.Value;

        Inv.Amt = Amt;
        Inv.Comment1 = AccountNo;
        CustomerInfo c = new CustomerInfo();
        c.CustId = AccountNo;

        Inv.CustomerInfo = c;

        // Set the Billing Address details.
        BillTo Bill = new BillTo();
        Bill.FirstName = txtCreditNameFirst.Text;
        Bill.LastName = txtCreditNameLast.Text;
        Bill.Street = txtCreditAddress.Text;
        Bill.BillToStreet2 = txtCreditAddress2.Text;
        Bill.City = txtCreditCity.Text;
        Bill.State = txtCreditState.Text;
        Bill.Zip = txtCreditZip.Text;
        Bill.CompanyName = txtCreditCompanyName.Text;
        Bill.BillToCountry = "US";
        Inv.BillTo = Bill;

        CreditCard CC = new CreditCard(sCardNo, exp);
        CC.Cvv2 = txtCreditCVV2.Text.Trim();

        // Create a new Payment Device - Credit Card data object.
        // The input parameters are Credit Card Number and Expiration Date of the Credit Card.

        // Create a new Tender - Card Tender data object.
        CardTender Card = new CardTender(CC);
       
        // Create a new Sale Transaction.
        SaleTransaction Trans = new SaleTransaction(
            User, Connection, Inv, Card, PayflowUtility.RequestId);

        // Submit the Transaction
        Response Resp = Trans.SubmitTransaction();


Edit: Just an update. I now know what was wrong with the exp. date. However, the transactions are still getting declined with a code 12 and "Declined." Called my card company and they say they aren't getting any transactions reported, to include declines.

Sponsor  
 
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAFVision Theme by Jaben Cargman (Tiny Gecko)
Powered by YAF | YAF © 2003-2009, Yet Another Forum.NET
This page was generated in 0.181 seconds.