Jump to Page:   1 · 2  |  Next Page
Urgent Help!!! with PayFlow Pro Payment Process   [ Edited ]
Options    Options  
mhoque78
Visitor
Posts: 8
Registered: 07-06-2007


mhoque78

Message 1 of 13

Viewed 9,929 times


This works thanks everyone.



Message Edited by mhoque78 on 07-18-2007 09:54 AM
Kudos!
07-10-2007 07:24 AM  
Re: Urgent Help!!! with PayFlow Pro Payment Process
Options    Options  
PayPal_ToddS Moderator
Moderator
Posts: 3878
Registered: 07-19-2006


PayPal_ToddS

Message 2 of 13

Viewed 9,903 times


Seems you If statement is not in the correct location.
 
Try something like this:
 
'loop until we're done processing the entire string
Do while Len(curString) <> 0
 'get the next name value pair
 if InStr(curString,"&") Then
  varString = Left(curString, InStr(curString , "&" ) -1)
 else
  varString = curString
 end if
 
 Response.Write "<br>"
 
 'get the name part of the name/value pair
 name = Left(varString, InStr(varString, "=" ) -1)
 
 'get the value out of the name/value pair
 value = Right(varString, Len(varString) - (Len(name)+1))
 
  if name = "RESULT" Then
  if value = 0 Then
   Response.Write("Transaction Approved.")
  elseif value = 12 Then
    Response.Write("Transaction Declined.")
  else
   Response.Write("Other Error, Result = " + value)
  end if
 end if
 
 'write out the name/value pair in "name = value" format
 response.write name
 response.write " = "
 Response.Write value
 
 Response.Write "<br>"
 
 'skip over the &
 if Len(curString) <> Len(varString) Then
  curString = Right(curString, Len(curString) - (Len(varString)+1))
 else
  curString = ""
 end if
Loop
1
Kudos!
07-10-2007 11:57 AM  
Re: Urgent Help!!! with PayFlow Pro Payment Process
Options    Options  
mhoque78
Visitor
Posts: 8
Registered: 07-06-2007


mhoque78

Message 3 of 13

Viewed 9,897 times


Thanks that works.
Kudos!
07-10-2007 01:34 PM  
Re: Urgent Help!!! with PayFlow Pro Payment Process
Options    Options  
mikedopp
Regular Visitor
Posts: 11
Registered: 07-06-2007


mikedopp

Message 4 of 13

Viewed 9,873 times


How do you do this in asp.net2.0?
 
 
Kudos!
07-11-2007 09:30 AM  
Re: Urgent Help!!! with PayFlow Pro Payment Process   [ Edited ]
Options    Options  
PayPal_ToddS Moderator
Moderator
Posts: 3878
Registered: 07-19-2006


PayPal_ToddS

Message 5 of 13

Viewed 9,869 times


Use the .NET SDK, see the post at the top of this forum.  Click Here.
 
Todd


Message Edited by PayPal_ToddS on 07-11-2007 10:16 AM
1
Kudos!
07-11-2007 10:15 AM  
Re: Urgent Help!!! with PayFlow Pro Payment Process
Options    Options  
mikedopp
Regular Visitor
Posts: 11
Registered: 07-06-2007


mikedopp

Message 6 of 13

Viewed 9,862 times


Ok so its downloaded I took all the bits out of the SDK and now I am working inside the web.config.
What am I doing wrong?
 

<appSettings>

<!-- Add your Host Name here Add Machine name,domain name and your site name-->

<add key="hostName" value="lifetimetest.net"/>

<!-- Add PayPal host URL for Express Checkout here. The user will be redirected to this url in a secure session for express checkout. -->

<!-- Live PayPal Server for Express Checkout: -->

<!-- <add key="PayPalHost" value="https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&amp;token="/> -->

<!-- Pilot (test) PayPal Server for Express Checkout: -->

<!-- <add key="PayPalHost" value="https://test-expresscheckout.paypal.com/cgi-bin/webscr?cmd=_express-checkout&amp;token="/>-->

<!-- Turn value to ON if on hosted service and unable to use the certificate as designed. Usually

due to trust level set to Medium. -->

<add key="CERT_OVERRIDE" value="OFF"/>

<!-- Change TRACE value to "ON" to display any stack trace errors in the response message.-->

<add key="TRACE" value="OFF"/>

<!-- This is a LOG level tag.To switch on logging change the logger level from "OFF" to any of the following:

a. DEBUG

b. INFO

c. WARN

d. ERROR

e. FATAL

-->

<add key="PAYFLOW_HOST" value="pilot-payflowpro.verisign.com/transaction"/>

<!-- <add key="PAYFLOWPRO_HOST" value="test-payflow.verisign.com"/>-->

<!-- <add key="CERT_PATH" value="C:\Windows\System32\certs"/>-->

<add key="PFPRO_CERT_PATH " value="C:\Windows\System32\certs\"/>

<add key="LOG_LEVEL" value="DEBUG"/>

<!-- Absolute path for LOG file. -->

<!-- Default of "logs\PayflowSDK.log" will create the file in AppDomain.CurrentDomain.BaseDirectory + "log"

which would probably be bin\.

If the web application folder does not have enough permissions to create a folder within it, then application

logging may be disabled. Verify access rights on web application folder. -->

<!-- <add key="LOG_FILE" value="I:\Integrations\dotnet1_1_updated\src\SampleStoreCS_BA_EC\logs\PayflowSDK.log"/>-->

<!-- Log file filesize constant. -->

<!-- <add key="LOGFILE_SIZE" value="102300"/> -->

</appSettings>

I also have added  Cert_Path, CertPath and PFPRO_Cert_Path to the system variables and pointed them to C:\Windows\System32\certs

Also reDownloaded the SDK since 7/6/07

But to no avail What am I missing? Do I need to pass a string or something somewhere?

Thanks.

Mike

Kudos!
07-11-2007 10:52 AM  
Re: Urgent Help!!! with PayFlow Pro Payment Process
Options    Options  
mikedopp
Regular Visitor
Posts: 11
Registered: 07-06-2007


mikedopp

Message 7 of 13

Viewed 9,851 times


Looks like I got this one. Here is the code I was falling all over.
 
This is simplistic and without web.config for now:
 
First Create a button on anyold aspx page. Now go to the code behind and add:
<!---------------Syntax Starts Here-------------------------------------->
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Net;
using System.Text;
using System.IO;
using System.Text.RegularExpressions;
public partial class vps_home : System.Web.UI.Page
{
   
    protected void Page_Load(object sender, EventArgs e)
    {
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        //PayPal offers an SDK for .net that can be downloaded here: http://www.pdncommunity.com/pdn/board/message?board.id=payflow&message.id=569
        //this was created because the SDK can be somewhat confusing.
        //*************** Note ***********************
        //before using this code change the following line below: wrWebRequest.Headers.Add("X-VPS-VIT-Client-Certification-Id:14":smileywink:;
        //you need to change the ID to something beside 14 that will be unique
        //1. Set the url to send the transaction to
        //test
        string postURL = "https://pilot-payflowpro.verisign.com/transaction";
        //live
        //string postURL = "https://payflowpro.verisign.com/transaction";
        //2. Set your user info. This is case sensitive
        string PWD = "xxx";
        string USER= "xxx";
        string VENDOR="xxx";
        string PARTNER = "xxx";
        //3. now create the name value pair string to send to the Payflow servers
        //more variables can be found in the docs that can be downloaded from your payflow manager
        StringBuilder postData = new StringBuilder();
        //***************add the user info***************
        postData.Append("PWD=" + PWD);
        postData.Append("&USER=" + USER);
        postData.Append("&VENDOR=" + VENDOR);
        postData.Append("&PARTNER=" + PARTNER);
        //***************add some required info for testing***************
        postData.Append("&CUSTIP=" + Request.UserHostAddress);
        //S for Sale. A for Auth. More in the docs
        postData.Append("&TRXTYPE=S":smileywink:;
        postData.Append("&AMT=1.00":smileywink:;
        //this is in the format MMYY
        postData.Append("&EXPDATE=0109":smileywink:;
        postData.Append("&ACCT=5105105105105100":smileywink:;
        postData.Append("&CVV2=123":smileywink:;
        postData.Append("&FIRSTNAME=bob":smileywink:;
        postData.Append("&LASTNAME=smith":smileywink:;
        postData.Append("&STREET=155515 Q St":smileywink:;
        postData.Append("&STATE=NE":smileywink:;
        postData.Append("&CITY=Omaha":smileywink:;
        postData.Append("&ZIP=68137":smileywink:;
        postData.Append("&COUNTRY=US":smileywink:;
        //C is for credit card, P is for PayPal Express Checkout. More in the docs
        postData.Append("&TENDER=C":smileywink:;
        //*************add some optional feilds***************
        postData.Append("&COMMENT1=ASP.NET Testing":smileywink:;
        //make sure that the "@" is not url encoded or you will get an error
        postData.Append("&email=bob@domain.com":smileywink:;
        //this is if you want to have PayPal send an IPN post
        //postData.Append("&NOTIFYURL=" + xxxx);
        //removed for now: INVNUM=12345678&
        //add the REQUEST_ID
        postData.Append("&REQUEST_ID=" + System.Guid.NewGuid().ToString());
       
        //write out the post data
        Response.Write("PostData:<br> " + postData + "<br><br>":smileywink:;
       
        byte[] requestBytes = Encoding.UTF8.GetBytes(postData.ToString());
        HttpWebRequest wrWebRequest = (HttpWebRequest)WebRequest.Create(postURL);
        //Set WebRequest Properties
        wrWebRequest.Method = "POST";
        wrWebRequest.Accept = "text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5";
        wrWebRequest.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7";
        wrWebRequest.ContentType = "text/namevalue";
        wrWebRequest.ContentLength = requestBytes.Length;
        wrWebRequest.AllowAutoRedirect = false;
       
        //add the custom headers
        wrWebRequest.Headers.Add("X-VPS-Timeout:30":smileywink:;
        wrWebRequest.Headers.Add("X-VPS-VIT-Client-Architecture:x86":smileywink:;
        wrWebRequest.Headers.Add("X-VPS-VIT-Client-Certification-Id:14":smileywink:;
        wrWebRequest.Headers.Add("X-VPS-VIT-Client-Type:ASP.NET":smileywink:;
        wrWebRequest.Headers.Add("X-VPS-VIT-Client-Version:0.0.1":smileywink:;
        wrWebRequest.Headers.Add("X-VPS-VIT-Integration-Product:Homegrown":smileywink:;
        wrWebRequest.Headers.Add("X-VPS-VIT-Integration-Version:0.0.1":smileywink:;
        wrWebRequest.Headers.Add("X-VPS-VIT-OS-Name:windows":smileywink:;
        wrWebRequest.Headers.Add("X-VPS-VIT-OS-Version:2002_SP2":smileywink:;
   
        // write the form values into the request message
        Stream reqStream = wrWebRequest.GetRequestStream();
        reqStream.Write(requestBytes, 0, requestBytes.Length);
        // Get the response.
        HttpWebResponse hwrWebResponse = (HttpWebResponse)wrWebRequest.GetResponse();
        reqStream.Close();
        StreamReader responseReader = new StreamReader(wrWebRequest.GetResponse().GetResponseStream());
   
        string responseData = responseReader.ReadToEnd();
        responseReader.Close();
        Response.Write("Response Data:<br>" + responseData);

    }
}
 
<!--------------Syntax obviously ends Here--------------------------->
 
Special Thanks to:
Ahmad
PayPal Merchant Technical Support
 
Kudos!
07-11-2007 12:48 PM  
Re: Urgent Help!!! with PayFlow Pro Payment Process   [ Edited ]
Options    Options  
PayPal_ToddS Moderator
Moderator
Posts: 3878
Registered: 07-19-2006


PayPal_ToddS

Message 8 of 13

Viewed 9,845 times


You have a bunch of things wrong here.  First, if you downloaded the most current .NET SDK from the top of the forum (v4.0.2.0) you should not have anything in your web.config file regarding to the "cert path".
 
Second, the code you have is for posting via HTTPS.  Truthfully, there is no reason to do this is you are using .NET, use the SDK instead as it handles a bunch of logic for you.
 
You need to stick with one or the other.
 
Also, for the .NET SDK see the Console examples enclosed with it in for examples on how to use it.  Its pretty simple once you look.


Message Edited by PayPal_ToddS on 07-11-2007 12:59 PM
1
Kudos!
07-11-2007 12:57 PM  
Re: Urgent Help!!! with PayFlow Pro Payment Process
Options    Options  
mikedopp
Regular Visitor
Posts: 11
Registered: 07-06-2007


mikedopp

Message 9 of 13

Viewed 9,838 times


Ok I am using .net2.0 Asp.net.
Here is what I have:

eStoreFrontCS

Constants.cs

 

 

//internal static UserInfo PayflowBAUser = new UserInfo("<user>", "<vendor>", "<partner>", "<password>":smileywink:;

 

What information goes where?

//PayPal PayFlowPro:

//Merchant Name:  (our merchant name)

//Merchant Account Number:  (our account  number)

//Partner ID:  (our partner id)

//Merchant Login ID: (our merchant login)

//User*: Leave blank if multi users are not created.

//Password: (our password)

 
Please School me
 
Kudos!
07-11-2007 02:17 PM  
Re: Urgent Help!!! with PayFlow Pro Payment Process
Options    Options  
mikedopp
Regular Visitor
Posts: 11
Registered: 07-06-2007


mikedopp

Message 10 of 13

Viewed 9,838 times


eStoreFrontCS

Constants.cs

 

 

//internal static UserInfo PayflowBAUser = new UserInfo("<user>", "<vendor>", "<partner>", "<password>":smileywink:;

 

What information goes where?

//PayPal PayFlowPro:

//Merchant Name:  (our merchant name)

//Merchant Account Number:  (our account  number)

//Partner ID:  (our partner id)

//Merchant Login ID: (our merchant login)

//User*: Leave blank if multi users are not created.

//Password: (our password)

 

If I use This: internal static UserInfo PayflowBAUser = new UserInfo("","(our account number)","(our partner id)","(our password)":smileywink:;

 

I get error 26 unknown vendor

 

Kudos!
07-11-2007 02:21 PM  
Jump to Page:   1 · 2  |  Next Page
Copyright © PayPal. All Rights Reserved. By using this site, you agree to be bound by PayPal's Legal Disclaimer, User Agreement, and Privacy Policy. This site is subject to change without notice. All other products and company names are trademarks of their respective corporations.