3
votes

I'm using the PayflowNETAPI class of the PayflowPro API (Payflow_dotNET.dll) to submit a transaction to store credit cards so my company doesn't have to (for PCI Compliant reassons). I'm using the PNREF from the credit card store transaction to make reference transaction but I keep getting "RESULT=2&PNREF=&RESPMSG=Invalid tender" I've tried Authorization, Capture, and Sale transactions and they all give the same result. What am I doing wrong?

I've read through the Payflow Gateway Developer Guide and Reference several times (https://developer.paypal.com/docs/classic/payflow/integration-guide/). All the examples for Authorization, Capture, and Sale transactions have the credit card information in the request. There is some small sections that explain and outline credit card uploads but never use the result of the request in a reference transaction.

Below is a sample application and the output

string creditCardUploadRequest = "TRXTYPE=L&TENDER=C&ACCT=4111111111111111&EXPDATE=1218&CVV2=250&BILLTOFIRSTNAME=Homer&BILLTOLASTNAME=Simpson&BILLTOSTREET=350 5th Ave&BILLTOCITY=New York&BILLTOSTATE=NY&BILLTOZIP=10118&BILLTOCOUNTRY=840&USER=<USER>&VENDOR=<VENDOR>&PARTNER=<PARTNER>&PWD=<PASSWORD>&VERBOSITY=HIGH";

var client = new PayPal.Payments.Communication.PayflowNETAPI(HostAddress: "pilot-payflowpro.paypal.com", HostPort: 443, Timeout: 90);
var ccUploadResponse = client.SubmitTransaction(ParamList: creditCardUploadRequest, RequestId: PayflowUtility.RequestId);

//place the responses into collection
var payPalCollection = new NameValueCollection();

foreach (string element in ccUploadResponse.Split('&'))
{
    string[] Temp = element.Split('=');
    payPalCollection.Add(Temp[0], Temp[1]);
}

Console.WriteLine("creditCardUploadRequest succeeded = {0}", payPalCollection.Get("RESPMSG") == "Approved");

string authorizationRequest = "TRXTYPE=A&ORIGID=" + payPalCollection.Get("PNREF") + "&INVNUM=ORD123456&AMT=50&COMMENT1=My Product Sale&USER=<USER>&VENDOR=<VENDOR>&PARTNER=<PARTNER>&PWD=<PASSWORD>&VERBOSITY=HIGH";
var authorizationResponse = client.SubmitTransaction(ParamList: authorizationRequest, RequestId: PayflowUtility.RequestId);

foreach (string element in authorizationResponse.Split('&'))
{
    Console.WriteLine(element);
}
Console.WriteLine("\nDONE");
Console.ReadKey();

OUTPUT:

creditCardUploadRequest succeeded = True

RESULT=2

PNREF=A7X08AB571EC

RESPMSG=Invalid tender

DONE

1

1 Answers

3
votes

In your second call you are missing the variable "TENDER=C" . Add that and it should be fine .

"string authorizationRequest = "TRXTYPE=A&ORIGID=" + payPalCollection.Get("PNREF") + "&INVNUM=ORD123456&AMT=50&COMMENT1=My Product Sale&USER=<USER>&VENDOR=<VENDOR>&PARTNER=<PARTNER>&PWD=<PASSWORD>&VERBOSITY=HIGH"