PDA

View Full Version : VB.NET and IP*Works CC ICharge w/ Authorize.net


meadowstrav
09-08-2003, 04:53 AM
Bruce,

I did a little something like this and I am getting some weird results...

Private Sub bCharge_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bCharge.Click

If (Me.cardIsValid()) Then
Icharge1.Gateway = System.Enum.Parse(GetType(nsoftware.IPWorksCC.Icha rgeGateways), "1")
Icharge1.CardExpMonth = 12
Icharge1.CardExpYear = 6
Icharge1.CardNumber = "5424000000000015"
Icharge1.InvoiceNumber = 9876
Icharge1.MerchantLogin = "xxxxxxx"
Icharge1.MerchantPassword = "xxxxxx"
Icharge1.TransactionAmount = 16
Try
Icharge1.Authorize() ' DO AUTHORIZATION
If (Icharge1.TransactionApprove) Then
litOutput.Text += "Transaction Approved."
Else
litOutput.Text += "<font color='red'>Transaction Declined:</font> " + Icharge1.ResponseText
End If
Catch Ex As nsoftware.IPWorksCC.IPWorksCCException
litOutput.Text += "Transaction Error: " + Ex.Message + "
"
End Try

pnlAuthResults.Visible = True
Me.Page.DataBind()
End If

End Sub

Private Function cardIsValid() As Boolean
'Lets preauthorize first:
Icharge1.CardExpMonth = 12
Icharge1.CardExpYear = 6
Icharge1.CardNumber = "5424000000000015"
Try
litOutput.Text += "Pre-Authorization Status:

"
Icharge1.PreAuthorize()
litOutput.Text += "<font color='blue'><i>Pre-Authorization checks passed. </i></font>

"
Return True
Catch ex As nsoftware.IPWorksCC.IPWorksCCException
litOutput.Text += "<font color='red'>Pre-Authorization checks failed: </font>" + ex.Message
End Try

Return False
End Function

...My results are weird because it reads "Transaction Declined: *This transaction has been approved." and it also returned a response code of 1. How come the Icharge1.TransactionApprove returned false and not true if the response code was 1.

Can someone tell me what is wrong?

David Silva


[b]quote:Originally posted by bruce

Did you download the helpfile yet?

http://kb.discountasp.net/article.aspx?id=10103

Also see the very simple snippet


<%@ Page Language="VB" %>
<%@ import namespace="nsoftware.ipworksCC" %>
<script runat="server">

Sub Page_Load()

Dim iCharge1 as new nsoftware.IPWorksCC.ICharge()

' This line set the gateway to authorize.net
iCharge1.gateway = System.Enum.Parse(GetType(nsoftware.IPWorksCC.Icha rgeGateways), "1")
Icharge1.CardExpMonth = 12
Icharge1.CardExpYear = 06
Icharge1.CardNumber = "4111111111111111"
Icharge1.InvoiceNumber = 9876
Icharge1.MerchantLogin =
Icharge1.TransactionAmount = 1


End Sub


</script>
<html>
<head>
</head>
[b]
<form runat="server">
<!-- Insert content here -->
</form>
</body>
</html>



[b]quote:Originally posted by meadowstrav

Has anyone written a shopping cart written in vb.net and IP*Works CC ICharge that was integrated with PayFlow Pro or Authorize.net's payment services. I currently have a cart application that was based off of the IBuySpyStore. The only problem is that I am not sure how to integrate IP*Works CC ICharge with Verisign's payflow pro or authorize.net's payment services. Any help would be greatly appreciated.

Thanks,

djsilva46
</blockquote id="quote"></font id="quote">
</blockquote id="quote"></font id="quote">

meadowstrav
09-08-2003, 08:51 AM
Has anyone written a shopping cart written in vb.net and IP*Works CC ICharge that was integrated with PayFlow Pro or Authorize.net's payment services. I currently have a cart application that was based off of the IBuySpyStore. The only problem is that I am not sure how to integrate IP*Works CC ICharge with Verisign's payflow pro or authorize.net's payment services. Any help would be greatly appreciated.

Thanks,

djsilva46

bruce
09-08-2003, 11:44 AM
Did you download the helpfile yet?

http://kb.discountasp.net/article.aspx?id=10103

Also see the very simple snippet


<%@ Page Language="VB" %>
<%@ import namespace="nsoftware.ipworksCC" %>
<script runat="server">

Sub Page_Load()

Dim iCharge1 as new nsoftware.IPWorksCC.ICharge()

' This line set the gateway to authorize.net
iCharge1.gateway = System.Enum.Parse(GetType(nsoftware.IPWorksCC.Icha rgeGateways), "1")
Icharge1.CardExpMonth = 12
Icharge1.CardExpYear = 06
Icharge1.CardNumber = "4111111111111111"
Icharge1.InvoiceNumber = 9876
Icharge1.MerchantLogin =
Icharge1.TransactionAmount = 1


End Sub


</script>
<html>
<head>
</head>
[b]
<form runat="server">
<!-- Insert content here -->
</form>
</body>
</html>



[b]quote:Originally posted by meadowstrav

Has anyone written a shopping cart written in vb.net and IP*Works CC ICharge that was integrated with PayFlow Pro or Authorize.net's payment services. I currently have a cart application that was based off of the IBuySpyStore. The only problem is that I am not sure how to integrate IP*Works CC ICharge with Verisign's payflow pro or authorize.net's payment services. Any help would be greatly appreciated.

Thanks,

djsilva46
</blockquote id="quote"></font id="quote">

nava
10-04-2003, 02:23 AM
How do I reference nsoftware.IPWorksCC.dll? My 'Imports' statements in my code behinds error out with '...cannot be found':

--
Imports nsoftware.IPWorksCC

Public Class CheckOut
Inherits System.Web.UI.Page
--

In my local development environment, I downloaded the .dll from nsoftware, put it in the bin, then set a reference to it, but the .dll is for limited use.

Thanks!

John D

bruce
10-05-2003, 02:49 AM
Once you put the reference into your project, you should be able to compile your project. The code will not run on your machine, unless if you buy the license from nsoftware.

Once you upload it to our server, it should run fine


[b]quote:Originally posted by nava

How do I reference nsoftware.IPWorksCC.dll? My 'Imports' statements in my code behinds error out with '...cannot be found':

--
Imports nsoftware.IPWorksCC

Public Class CheckOut
Inherits System.Web.UI.Page
--

In my local development environment, I downloaded the .dll from nsoftware, put it in the bin, then set a reference to it, but the .dll is for limited use.

Thanks!

John D
</blockquote id="quote"></font id="quote">

nava
10-18-2003, 08:15 AM
Works great. Thanks, Bruce.

nava