Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
ASP Credit Card Transactions
Old 08-08-2007, 11:36 AM ASP Credit Card Transactions
ExpressoDan's Avatar
Ultra Talker

Posts: 317
Name: This Space for Rent
Location: Georgia
Trades: 0
Hey guys, haven't been around in a while, but I hope you can help.

I've got a few clients wanting to do credit card transactions online. I've implemented paypal into one and that seems okay, but I don't like the disconnect between the site and paypal... it just seems cheap...

I've never really been comfortable with implementing credit card transactions, but I'm going to have to get over that as more people want to do this. So, I'm still using classic asp and I know next to nothing about .net and would like to know what solutions you use to process credit cards. I've looked through the forum and Google without much luck.

If you have some snippets or a boxed example of something you have used, please share it. I'd like a custom script to so I could tailor it to my needs if at all possible.

Thanks!!
__________________

Please login or register to view this content. Registration is FREE

"I think therefore I am, I think." <!-- George Carlin
ExpressoDan is offline
Reply With Quote
View Public Profile Visit ExpressoDan's homepage!
 
 
Register now for full access!
Old 08-08-2007, 11:40 AM Re: ASP Credit Card Transactions
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
Hey Dan,

The reason you can't find anything custom that you can use is because it's payment processor specific. The different payment processors have different APIs and different code snippets, depending on how their end of things is set up.

I've worked with BeanStream in Canada, and LinkPoint in the US, and both have ASP-friendly APIs.

Hope that helps!
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 08-08-2007, 03:27 PM Re: ASP Credit Card Transactions
ExpressoDan's Avatar
Ultra Talker

Posts: 317
Name: This Space for Rent
Location: Georgia
Trades: 0
Thanks Adam.

Yeah, now that you mention it that does make sense and collaborates what I've seen with different payment processors. in short duh...

I suppose what I get hung up on is the process of how it all comes together. And I also have a bit of paranoia and don't know who to trust.

I'll give LinkPoint a look... but i might be back with more questions...
__________________

Please login or register to view this content. Registration is FREE

"I think therefore I am, I think." <!-- George Carlin
ExpressoDan is offline
Reply With Quote
View Public Profile Visit ExpressoDan's homepage!
 
Old 08-08-2007, 08:15 PM Re: ASP Credit Card Transactions
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
I have a VbScript function for WorldPay which is pretty straightforward to integrate as well.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-09-2007, 08:16 AM Re: ASP Credit Card Transactions
ExpressoDan's Avatar
Ultra Talker

Posts: 317
Name: This Space for Rent
Location: Georgia
Trades: 0
Thanks Chris.

I have heard a great deal about worldpay. Whats does your function do? Does it allow the user to stay on the site by asking for card info or does it redirect them to worldpay?

Do you have a demo? How much would you charge or can I take a peek?

Thanks guys!
__________________

Please login or register to view this content. Registration is FREE

"I think therefore I am, I think." <!-- George Carlin
ExpressoDan is offline
Reply With Quote
View Public Profile Visit ExpressoDan's homepage!
 
Old 08-09-2007, 06:20 PM Re: ASP Credit Card Transactions
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Ok, my payment gateway class
has WorldPay, PayPal and NoChex gateways built in
Code:
<%
class ClGateway

'Class constants 
' (have to be declared as variables because constants cannot be declared in a VbScript class)

' replace 999999 with your WorldPay installation ID
' replace sales@domain.com with your reference

private m_sWPInstID
private m_sNochexID
private m_sPayPalID
private m_sPPThanks
private m_sPPCancel

private m_scItemCode
private m_scItemprice
private m_scItemQty
private m_scProdInfo
private m_sCurrencyCode

'	m_scItemCode = Catalogue product ID
'	m_scItemprice = Unit price for item
'	m_scItemQty = Quantity purchased
'	m_scProdInfo = Description of item purchased that will appear on the payment page


private sub class_initialize()
	m_sWPInstID = "999999"
	m_sNochexID =  "sales@domain.com"
	m_sPayPalID =  "sales@domain.com"
' paypal return pages. Set these to empty string if not required
	m_sPPThanks = "http://www.domain.com/thanks.asp"
	m_sPPCancel = "http://www.domain.com/cancel.asp"
end sub


public property let ItemCode(ByVal val)
	m_scItemCode = val
end property

public property let ItemPrice(ByVal val)
	m_scItemprice = val
end property

public property let ItemQty(ByVal val)
	m_scItemQty = val
end property

public property let ProdInfo(ByVal val)
	m_scProdInfo = val
end property

public property let CurrencyCode(ByVal val)
	m_sCurrencyCode = val
end property


sub WorldPay()
' worldpay form code
with response
	.write "<form action="
	.write chr(34)
	.write "https://select.worldpay.com/wcc/purchase"
	.write chr(34)
	.write " method="
	.write chr(34)
	.write "post"
	.write chr(34)
	.write ">" & vbCrLf
	.write "<input type="
	.write chr(34)
	.write "hidden"
	.write chr(34)
	.write " name="
	.write chr(34)
	.write "instId"
	.write chr(34)
	.write " value="
	.write chr(34)
	.write m_sWPInstID
	.write chr(34)
	.write ">" & vbCrLf
	.write "<input type="
	.write chr(34)
	.write "hidden"
	.write chr(34)
	.write " name="
	.write chr(34)
	.write "cartId"
	.write chr(34)
	.write " value="
	.write chr(34)
	.write m_scItemCode
	.write chr(34)
	.write ">" & vbCrLf
	.write "<input type="
	.write chr(34)
	.write "hidden"
	.write chr(34)
	.write " name="
	.write chr(34)
	.write "amount"
	.write chr(34)
	.write " value="
	.write chr(34)
	.write FormatNumber(m_scItemprice * m_scItemQty,2)
	.write chr(34)
	.write ">" & vbCrLf
	.write "<input type="
	.write chr(34)
	.write "hidden"
	.write chr(34)
	.write " name="
	.write chr(34)
	.write "currency"
	.write chr(34)
	.write " value="
	.write chr(34)
	.write m_sCurrencyCode
	.write chr(34)
	.write ">" & vbCrLf
	.write "<input type="
	.write chr(34)
	.write "hidden"
	.write chr(34)
	.write " name="
	.write chr(34)
	.write "desc"
	.write chr(34)
	.write " value="
	.write chr(34)
	.write m_scProdInfo
	.write chr(34)
	.write ">" & vbCrLf
	' uncomment the following lines to set test mode on
	'		.write "<input type="
	'		.write chr(34)
	'		.write "hidden"
	'		.write chr(34)
	'		.write " name="
	'		.write chr(34)
	'		.write "testMode"
	'		.write chr(34)
	'		.write " value="
	'		.write chr(34)
	'		.write "100"
	'		.write chr(34)
	'		.write ">" & vbCrLf
	' end of test mode
	.write "<input type="
	.write chr(34)
	.write "image"
	.write chr(34)
	.write " src="
	.write chr(34)
	.write "/images/payment/poweredby.gif"
	.write chr(34)
	.write "  name="
	.write chr(34)
	.write "submit"
	.write chr(34)
	.write " alt="
	.write chr(34)
	.write "WorldPay"
	.write chr(34)
	.write " title="
	.write chr(34)
	.write "Worldpay Secure Credit Card payment"
	.write chr(34)
	.write ">" & vbCrLf
	.write "</form>" & vbCrLf
end with
end sub

sub NoChex()
' nochex form code
with response
	.write "<a href="
	.write chr(34)
	.write "https://www.nochex.com/nochex.dll/checkout?email="
	.write m_sNochexID
	.write "&amount="
	.write FormatNumber(m_scItemprice * m_scItemQty,2)
	.write "&description="
	.write m_scItemQty
	.write " "
	.write m_scItemCode
	.write " "
	.write m_scProdInfo
	.write chr(34)
	.write ">" & vbCrLf
	.write "<img border="
	.write chr(34)
	.write "0"
	.write chr(34)
	.write " src="
	.write chr(34)
	.write "/images/payment/payme4.gif"
	.write chr(34)
	.write " alt="
	.write chr(34)
	.write "Nochex"
	.write chr(34)
	.write " title="
	.write chr(34)
	.write "Nochex Debit Card Payments"
	.write chr(34)
	.write "></a>" & vbCrLf
end with
end sub

sub PayPal()
' paypal form code
with response
	.write "<form action="
	.write chr(34)
	.write "https://www.paypal.com/cgi-bin/webscr"
	.write chr(34)
	.write " method="
	.write chr(34)
	.write "post"
	.write chr(34)
	.write ">" & vbCrLf
if m_sPPThanks <> "" then 
	.write "<input type="
	.write chr(34)
	.write "hidden"
	.write chr(34)
	.write " name="
	.write chr(34)
	.write "return"
	.write chr(34)
	.write " value="
	.write chr(34)
	.write m_sPPThanks
	.write chr(34)
	.write ">" & vbCrLf
end if
if m_sPPCancel <> "" then 
	.write "<input type="
	.write chr(34)
	.write "hidden"
	.write chr(34)
	.write " name="
	.write chr(34)
	.write "cancel_return"
	.write chr(34)
	.write " value="
	.write chr(34)
	.write m_sPPCancel
	.write chr(34)
	.write ">" & vbCrLf
end if
	.write "<input type="
	.write chr(34)
	.write "hidden"
	.write chr(34)
	.write " name="
	.write chr(34)
	.write "cmd"
	.write chr(34)
	.write " value="
	.write chr(34)
	.write "_xclick"
	.write chr(34)
	.write ">" & vbCrLf
	.write "<input type="
	.write chr(34)
	.write "hidden"
	.write chr(34)
	.write " name="
	.write chr(34)
	.write "business"
	.write chr(34)
	.write " value="
	.write chr(34)
	.write m_sPayPalID
	.write chr(34)
	.write ">" & vbCrLf
	.write "<input type="
	.write chr(34)
	.write "hidden"
	.write chr(34)
	.write " name="
	.write chr(34)
	.write "item_name"
	.write chr(34)
	.write " value="
	.write chr(34)
	.write ""
	.write m_scItemCode
	.write " "
	.write m_scProdInfo
	.write chr(34)
	.write ">" & vbCrLf
	.write "<input type="
	.write chr(34)
	.write "hidden"
	.write chr(34)
	.write " name="
	.write chr(34)
	.write "amount"
	.write chr(34)
	.write " value="
	.write chr(34)
	.write FormatNumber(m_scItemprice * m_scItemQty,2)
	.write chr(34)
	.write ">" & vbCrLf
	.write "<input type="
	.write chr(34)
	.write "hidden"
	.write chr(34)
	.write " name="
	.write chr(34)
	.write "no_note"
	.write chr(34)
	.write " value="
	.write chr(34)
	.write "1"
	.write chr(34)
	.write ">" & vbCrLf
	.write "<input type="
	.write chr(34)
	.write "hidden"
	.write chr(34)
	.write " name="
	.write chr(34)
	.write "currency_code"
	.write chr(34)
	.write " value="
	.write chr(34)
	.write m_sCurrencyCode
	.write chr(34)
	.write ">" & vbCrLf
	.write "<input type="
	.write chr(34)
	.write "image"
	.write chr(34)
	.write " src="
	.write chr(34)
	.write "/images/payment/x-click-but01.gif"
	.write chr(34)
	.write " border="
	.write chr(34)
	.write "0"
	.write chr(34)
	.write " name="
	.write chr(34)
	.write "submit"
	.write chr(34)
	.write " alt="
	.write chr(34)
	.write "Make payments with PayPal - fast, free and secure!"
	.write chr(34)
	.write " title="
	.write chr(34)
	.write "Make payments with PayPal - fast, free and secure!"
	.write chr(34)
	.write ">" & vbCrLf
	.write "</form>" & vbCrLf
end with
end sub

end class
%>
How to use them follows in the next post
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-09-2007, 06:36 PM Re: ASP Credit Card Transactions
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
save the above code in a file called "cl_gateway.asp" for example

then include it
Code:
<!--#include virtual="/include/class/cl_gateway.asp" -->
Declare the variables and instantiate the class

Code:
<%
dim Gateway
Set Gateway = new ClGateway

Gateway.CurrencyCode = "GBP"
Gateway.ItemCode = "12345"
Gateway.ItemPrice = 101
Gateway.ItemQty = 3
Gateway.ProdInfo = " Test product"
%>
ProdInfo can be a concatenated string to tell the customer what they are paying for.

the forms are written to the page with
HTML Code:
	<p>	
	<%=Gateway.WorldPay%>
	</p>
	<p>
	<%=Gateway.NoChex%>
	</p>
	<p>
	<%=Gateway.PayPal%>
	</p>
Then destroy the class object when done with.
Code:
<%
Set Gateway = nothing
%>
The form transfers to customised secure pages at WorldPay that have the same look as the parent site, then when the payment process ends the buyer is returned to the site.
Return URLs for "Thanks" and/or "Sorry"are set up in the worldpay gateway design interface.

the images can be downloaded from the various payment processors and the class is easy enough to extend to other merchants as well.

(Class file attached as a text file to save the copy 'n' paste)
Attached Files
File Type: txt cl_gateway.txt (7.3 KB, 1 views)
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-16-2007, 03:54 PM Re: ASP Credit Card Transactions
ExpressoDan's Avatar
Ultra Talker

Posts: 317
Name: This Space for Rent
Location: Georgia
Trades: 0
Forgot to mention... Chris, your code is beautiful. Seriously, it puts everything I've ever done to shame...

So I know it's easier to use a third party as the payment gateway, but I'd rather collect all the information on my site instead of redirect to another site... and then use the third party to process the transaction without the user see what's going on. I know it's a bit more risky for me, but I think it would be a lot more fluid for the end user. Has anyone ever used website payments pro form paypal and if so, did anyone use an asp shopping cart?
__________________

Please login or register to view this content. Registration is FREE

"I think therefore I am, I think." <!-- George Carlin
ExpressoDan is offline
Reply With Quote
View Public Profile Visit ExpressoDan's homepage!
 
Old 08-19-2007, 09:20 AM Re: ASP Credit Card Transactions
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Cheers, I long since learned that writing code in reuseable classes and modules makes life much simpler when you go back to it months or years later.

It is simple enough to do and the code I wrote is easy enough to extend to enable collecting all the data required.
Name, Address, CC No, security codes etc can all be pre-populated in to the request data sent to paypal.
I'll take a look over the Payments Pro integration pdf to see what changes are needed sometime during the week.

For other processors and merchant accounts;
You obviously need a SSL cert and a https site and a very secure database system. Also ensure that your business insurance will cover the several million pound (dollar) public liability you will need, I'm taking here that the US banks have at least a similar policy as they do here.

To enable us to do the whole process in-house would have cost the client between £20,000 and £30,000 per year in insurance, security maintenance and testing that the bank insisted on and their fees where about £800 per month even before a payment was taken
So the client decided that maybe it wasn't such a good proposition
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to ASP Credit Card Transactions
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.29306 seconds with 13 queries