Click here to Skip to main content
15,867,308 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Forms Authentication Pin
ZurdoDev2-May-12 4:56
professionalZurdoDev2-May-12 4:56 
GeneralRe: Forms Authentication Pin
MWRivera2-May-12 4:58
MWRivera2-May-12 4:58 
QuestionPaypal Payflow Link/Paypal Advanced Payments Integration in C# Pin
masterprogrammertech1-May-12 5:58
masterprogrammertech1-May-12 5:58 
AnswerRe: Paypal Payflow Link/Paypal Advanced Payments Integration in C# Pin
jkirkerx1-May-12 13:14
professionaljkirkerx1-May-12 13:14 
GeneralRe: Paypal Payflow Link/Paypal Advanced Payments Integration in C# Pin
masterprogrammertech2-May-12 7:34
masterprogrammertech2-May-12 7:34 
GeneralRe: Paypal Payflow Link/Paypal Advanced Payments Integration in C# Pin
jkirkerx2-May-12 8:17
professionaljkirkerx2-May-12 8:17 
QuestionRe: Paypal Payflow Link/Paypal Advanced Payments Integration in C# Pin
masterprogrammertech2-May-12 19:22
masterprogrammertech2-May-12 19:22 
AnswerRe: Paypal Payflow Link/Paypal Advanced Payments Integration in C# Pin
jkirkerx3-May-12 6:36
professionaljkirkerx3-May-12 6:36 
That's called a named / value pair, it's not a query string. Don't confuse what you transmit in a web request with what you type in the browser url window.

name = value
amount = value

and is separated by any char you choose. They just happen to choose a ampersand, so it looks like a query string. The separator char can be a | as well. JSON uses something similar as well. Other companies let you choose the sep character when transmitting the request, so we use the | char. PayPal wants to use the ampersand to make it more confusing.

[LESSON]

A web response is the pure essence, or purpose of response.write. response.write is not for returning a html tag like response.write("<
><
>""), but is made to return a request like response.write("name=John Doe&amount=40.00¤cycode=USD") in which there is no html.

So when you transmit, you build your name/value string
VB
strPostBuild = New StringBuilder
With strPostBuild
	.Append("USER=" & API_UserName)
	.Append("&PWD=" & API_Password)
	.Append("&SIGNATURE=" & API_Signature)
	.Append("&VERSION=" & API_Version)
	.Append("&METHOD=" & API_Method)
	.Append("&TRANACTIONID=" & API_TransactionID)
	.Append("&AMT=" & API_Amount)
	.Append("&TRANSACTIONENTITY=" & "ORDER")
	.Append("&CURRENCYCODE=" & API_CurrencyCode)
End With
strPost = strPostBuild.ToString


Then you parse the response from PayPal

VB
Dim values As String
values = TheGatewayResponse
Dim Capture As String() = Nothing
Capture = values.Split(&quot;&amp;&quot;)

Dim ResponseCollection As NameValueCollection = New NameValueCollection
Dim ResponseName As String = Nothing
Dim ResponseValue As String = Nothing
Dim slashPosition As Integer = 0

'Grab the Data and put it in an array
For Each DataField In Capture
       slashPosition = DataField.LastIndexOf(&quot;=&quot;)
       ResponseName = Left(DataField, slashPosition)
       ResponseValue = DataField.Substring(slashPosition + 1)
       ResponseCollection.Add(ResponseName, ResponseValue)
Next


I can't tell you what the Form is for, you would have to paste response string only in order for me to interpret it.

[WARNING]
Oh, a warning to you. I mock PayPal for providing sample code for programmers, because they never end up learning how it really works. Entry level programmers will make a few tweaks to the code, get it to work, and think they are code god, but when it breaks, they can't fix it, and run back to the paypal forum for help, in which perhaps maybe 1 guy knows how it works.

You should write your own code from scratch, and build on it to make it better. Then when you write for UPS, Payment Tech, you will have a clue as to how it works.
QuestionDeleting User Cache only for the very first time Pin
masterprogrammertech1-May-12 5:43
masterprogrammertech1-May-12 5:43 
AnswerRe: Deleting User Cache only for the very first time Pin
jkirkerx1-May-12 13:17
professionaljkirkerx1-May-12 13:17 
Questionasp.net communicate with test web server Pin
rachel_m30-Apr-12 7:00
rachel_m30-Apr-12 7:00 
AnswerRe: asp.net communicate with test web server Pin
R. Giskard Reventlov30-Apr-12 7:42
R. Giskard Reventlov30-Apr-12 7:42 
AnswerRe: asp.net communicate with test web server Pin
ZurdoDev30-Apr-12 10:38
professionalZurdoDev30-Apr-12 10:38 
GeneralRe: asp.net communicate with test web server Pin
rachel_m30-Apr-12 11:57
rachel_m30-Apr-12 11:57 
GeneralRe: asp.net communicate with test web server Pin
R. Giskard Reventlov30-Apr-12 12:08
R. Giskard Reventlov30-Apr-12 12:08 
GeneralRe: asp.net communicate with test web server Pin
ZurdoDev30-Apr-12 14:47
professionalZurdoDev30-Apr-12 14:47 
GeneralRe: asp.net communicate with test web server Pin
rachel_m30-Apr-12 17:51
rachel_m30-Apr-12 17:51 
Questionasp.net test setup Pin
rachel_m30-Apr-12 6:58
rachel_m30-Apr-12 6:58 
AnswerRe: asp.net test setup Pin
ZurdoDev30-Apr-12 10:40
professionalZurdoDev30-Apr-12 10:40 
GeneralRe: asp.net test setup Pin
rachel_m30-Apr-12 17:54
rachel_m30-Apr-12 17:54 
GeneralRe: asp.net test setup Pin
ZurdoDev1-May-12 1:55
professionalZurdoDev1-May-12 1:55 
QuestionHelp with dynamic buttons Pin
Ubbi2330-Apr-12 2:54
Ubbi2330-Apr-12 2:54 
AnswerRe: Help with dynamic buttons Pin
Sandeep Mewara30-Apr-12 9:35
mveSandeep Mewara30-Apr-12 9:35 
AnswerRe: Help with dynamic buttons Pin
jkirkerx1-May-12 19:08
professionaljkirkerx1-May-12 19:08 
Questionredirect to the page that was previously visited Pin
hardik mer29-Apr-12 21:46
hardik mer29-Apr-12 21:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.