Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Payment Gateway

Status
Not open for further replies.

bobbyr

Programmer
Nov 30, 2000
66
0
0
US
I am using the PayStream Gateway to process a credit card transactions for a website. All I have to do is pass it a set of defined variables, then the gateway will return a comma delimited list back. I assume the CFHTTP tag will be used to send the data. Does anybody have some sample script that might show me how to do this? All I have to do is pass the variables to a process.asp page, then parse the data that is returned:

CardName
CardNumber
CardExpDate
CustEmail
TotalPrice

Any help would be greatly appreciated.

Thanks,
Bobby R
 
i don't understand your question ... is it "how to pass parameters from a web page to another ?" ??
if yes then just use a form !!!
 
No. I need to do a CFHTTP Post to send the data, and then parse a list of data that is returned (the gateway's response). I figured out the CFHTTP post already. Now I'm working on parsing out a comma delimited string:

True,34567,AA,Yes,1567,NA

True means the transaction was approved, 34567 is the Order Id, AA means Authorized, Yes means Address Verification was done, 1567 is the Address Verification Text, and NA means that it was a charge (not a void, credit, pre-authorize, etc.)

My ASP department says a ListToArray should do the trick.. now it's just a matter of doing it.
 
Try this :

<cfset my_array = ListToArray(your_list ,&quot;,&quot;)>


Now my_array[1] is &quot;True&quot;, my_array[2] is &quot;34567&quot; and so on!


 
Great. Got everything working except one thing. Depending on the status (approved or denied), I may have some null values returned:

False,32123,,,,,NA

This changes my ListLen value depending on how many nulls there are. What I wanted to do was replace a null with N/A. I did a Replace(value, &quot;,,&quot;,&quot;,N/A,&quot;,&quot;All&quot;), but for some reason, it does them in blocks. What I mean is that it will format it like this:

False,32123,N/A,,N/A,,NA

My QUE book says that I can use &quot;Recursive&quot; instead of &quot;All&quot;, but I don't think that's the case... Is there a better way than Replace() ??
 
i had the same problem.
ListToArray adds no item when it finds ,,
I fixed it by doing the replace all thing twice :

toto = Replace(value, &quot;,,&quot;,&quot;,N/A,&quot;,&quot;All&quot;)
Replace(toto, &quot;,,&quot;,&quot;,N/A,&quot;,&quot;All&quot;)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top