I am using PayPal's Payflow Pro SDK. I am trying to set something up where users can save and reuse their credit card after using it once. I think (correct me if I'm wrong) the right process to do this is as follows:
What I can't figure out is what the code should actually be. When I submit the initial transaction, there are a bunch of codes that come back (ex: PNREF, AUTHCODE). I can't figure out which is supposed to be the one that I store and then use as the origin id in the reference transaction. I've tried using a bunch of different ones, and each comes back with an error saying "Invalid tender".
Below is a code snippet of my code for the reference transaction part:
public Response processOrderViaReferenceTransaction(String originId){
UserInfo userInfo = new UserInfo("user", "vendor", "partner", "pwd"); //my actual username/password are in my code, not this
PayflowConnectionData connection = new PayflowConnectionData("pilot-payflowpro.paypal.com", 443, 45, "", 0, "", "");
String requestId = PayflowUtility.RequestId;
Invoice invoice = new Invoice();
CultureInfo us = new CultureInfo("en-US");
String usCurrency = "USD";
Currency amount = new Currency(new decimal(2.00), usCurrency);
invoice.Amt = amount;
ReferenceTransaction referenceTransaction = new ReferenceTransaction("S", originId, userInfo, connection, invoice, requestId);
referenceTransaction.Verbosity = "HIGH";
Response response = referenceTransaction.SubmitTransaction();
return response;
}
Does anyone know what I am doing wrong?
Page 40 of the PayFlow Pro Developer guide...
The PNREF returned in the original transaction is valid for use in reference transactions for a period of 12 months.
A PNREF returned by Account Verification also can be used in a reference transaction.