developer:soap-1.4:methods:capturetransaction

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
developer:soap-1.4:methods:capturetransaction [2010/08/30 11:39]
tem
developer:soap-1.4:methods:capturetransaction [2010/08/30 16:43]
epouchak
Line 79: Line 79:
 ?>  ?> 
 </​code>​ </​code>​
- 
 ====VB==== ====VB====
 For directions on how to set up the WSDL link and create the "​token"​ and "​client"​ variables, go to the [[..:​howto:​vb|Visual Basic .Net Soap How-to]]. For directions on how to set up the WSDL link and create the "​token"​ and "​client"​ variables, go to the [[..:​howto:​vb|Visual Basic .Net Soap How-to]].
  
 <code vb> <code vb>
-    ​Dim client As usaepay.usaepayService = New usaepay.usaepayService +        ​Dim client As usaepay.usaepayService = New usaepay.usaepayService 
-    Dim token As usaepay.ueSecurityToken+        Dim token As usaepay.ueSecurityToken 
 + 
 +        token = Me.CreateToken("​714SSUxv1uohng2XkMJ7kLpETsu58G66",​ "​1234"​) 
 + 
 +        Dim transaction As usaepay.TransactionRequestObject = New usaepay.TransactionRequestObject 
 +        transaction.Details = New usaepay.TransactionDetail 
 +        transaction.Details.Amount = "​11.11"​ 
 +        transaction.Details.AmountSpecified = "​true"​ 
 +        transaction.Details.Invoice = "​123456"​ 
 + 
 +        transaction.AuthCode = "​009915"​ 
 +        transaction.RefNum = "​46993455"​ 
 + 
 +        Dim response As usaepay.TransactionResponse = New usaepay.TransactionResponse 
 + 
 +        response = client.captureTransaction(token,​ transaction.RefNum,​ transaction.Details.Amount) 
 + 
 +        If response.ResultCode = "​A"​ Then 
 +            MsgBox("​Transaction Approved, Refnum: " & response.RefNum) 
 +        Else 
 +            MsgBox("​Transaction Error, Reason: " & response.Error) 
 +        End If 
 +</​code>​ 
 + 
 +==== .NET C# ==== 
 +<code c> 
 +usaepay.TransactionRequestObject tran = new usaepay.TransactionRequestObject();​
  
-    token Me.CreateToken("982lz9VsLm87MA54Sv8E582h8OZMArL6", "​443311"​)+            tran.Details ​new usaepay.TransactionDetail(); 
 +            tran.Details.Amount = 1.00; 
 +            tran.Details.AmountSpecified = true; 
 +            tran.Details.Invoice = "123456";
  
-    Dim transaction As usaepay.TransactionRequestObject = New usaepay.TransactionRequestObject +            tran.RefNum ​= "47001545"
-      transaction.Details = New usaepay.TransactionDetail +
-      transaction.Details.Amount = "​9.02"​ +
-      transaction.Details.AmountSpecified = True +
-      transaction.Details.Invoice ​= "434534"+
  
-    transaction.AuthCode ​"​035786"​ +            usaepay.TransactionResponse response ​new usaepay.TransactionResponse();​
-    transaction.RefNum = "​46405618"​+
  
-    Dim response ​As usaepay.TransactionResponse ​New usaepay.TransactionResponse+            try 
 +            { 
 +                ​response = client.captureTransaction(token,​ tran.RefNum,​ tran.Details.Amount);
  
-    ​response = client.captureTransaction(tokentransaction.RefNum, ​transaction.Details.Amount)+                if (response.ResultCode ​== "​A"​) 
 +                { 
 +                    MessageBox.Show(string.Concat("​Transaction ApprovedRefNum: ", 
 +                    response.RefNum)); 
 +                } 
 +                else 
 +                { 
 +                    MessageBox.Show(string.Concat("​Transaction Failed: ", 
 +                    response.Error)); 
 +                } 
 +            } 
 +            catch (Exception err) 
 +            { 
 +                MessageBox.Show(err.Message);
  
-    If response.ResultCode = "​A"​ Then +            }
-      MsgBox("​Transaction Approved, Refnum: " & response.RefNum) +
-    Else +
-      MsgBox("​Transaction Error, Reason: " & response.Error) +
-    End If+
 </​code>​ </​code>​
  
developer/soap-1.4/methods/capturetransaction.txt · Last modified: 2010/08/30 16:43 by epouchak

Page Tools