developer:soap-1.3:methods:runcredit

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.3:methods:runcredit [2010/08/06 11:49]
epouchak
developer:soap-1.3:methods:runcredit [2010/08/26 15:14]
irina
Line 123: Line 123:
     System.out.println("​Soap Exception: " + e.getMessage());​     System.out.println("​Soap Exception: " + e.getMessage());​
 } }
 +</​code>​
 +
 +==== .NET C# ====
 +<code c>
 +usaepay.TransactionRequestObject tran = new usaepay.TransactionRequestObject();​
 + 
 +            //​tran.Command = "​cc:​sale";​
 +            tran.Details =  new usaepay.TransactionDetail();​
 +            tran.Details.Amount = 1.00;
 +            tran.Details.AmountSpecified = true;
 +            tran.Details.Invoice = "​1234";​
 +            tran.Details.Description = "​Sample Credit";​
 + 
 +            tran.CreditCardData = new usaepay.CreditCardData();​
 +            tran.CreditCardData.CardNumber = "​4444555566667779";​
 +            tran.CreditCardData.CardExpiration = "​1212";​
 + 
 +            usaepay.TransactionResponse response = new usaepay.TransactionResponse();​
 +
 +            try
 +            {
 +                response = client.runCredit(token,​ tran);
 +
 +                if (response.ResultCode == "​A"​)
 +                {
 +                    MessageBox.Show(string.Concat("​Transaction Approved, RefNum: ",
 +                    response.RefNum));​
 +                }
 +                else
 +                {
 +                    MessageBox.Show(string.Concat("​Transaction Failed: ",
 +                    response.Error));​
 +                }
 +            }
 +            catch (Exception err)
 +            {
 +                MessageBox.Show(err.Message);​
 +
 +            }
 </​code>​ </​code>​
  
Line 130: Line 169:
 <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("​982lz9VsLm87MA54Sv8E582h8OZMArL6", "443311")+        ​token = Me.CreateToken("​rGzC0rJ8B9RDj8Wm96GrYokgZIRe4eWF", "1234")
  
-Dim transaction As usaepay.TransactionRequestObject = New usaepay.TransactionRequestObject+        ​Dim transaction As usaepay.TransactionRequestObject = New usaepay.TransactionRequestObject
  
-transaction.CreditCardData = New usaepay.CreditCardData +        ​transaction.CreditCardData = New usaepay.CreditCardData 
-transaction.CreditCardData.CardNumber = "​4444555566667779"​ +        transaction.CreditCardData.CardNumber = "​4444555566667779"​ 
-transaction.CreditCardData.CardExpiration = "​1212"​ +        transaction.CreditCardData.CardExpiration = "​1212"​ 
-transaction.CreditCardData.CardCode = "​999"​+        transaction.CreditCardData.CardCode = "​999"​
  
-transaction.Details = New usaepay.TransactionDetail +        ​transaction.Details = New usaepay.TransactionDetail 
-transaction.Details.Amount = "​1.00"​ +        transaction.Details.Amount = "​1.00"​ 
-transaction.Details.AmountSpecified = True +        transaction.Details.AmountSpecified = True 
-transaction.Details.Invoice = "​12345"​ +        transaction.Details.Invoice = "​12345"​ 
-transaction.Details.Description = "​Sample Credit"​+        transaction.Details.Description = "​Sample Credit"​
  
-Dim response As usaepay.TransactionResponse = New usaepay.TransactionResponse+        ​Dim response As usaepay.TransactionResponse = New usaepay.TransactionResponse
  
-response = client.runCredit(token,​ transaction)+        ​response = client.runCredit(token,​ transaction)
  
-If response.ResultCode = "​A"​ Then +        ​If response.ResultCode = "​A"​ Then 
-    MsgBox("​Transaction Approved, Refnum: " & response.RefNum) +            MsgBox("​Transaction Approved, Refnum: " & response.RefNum) 
-Else +        Else 
-    MsgBox("​Transaction Error, Reason: " & response.Error) +            MsgBox("​Transaction Error, Reason: " & response.Error) 
-End If+        End If
 </​code>​ </​code>​
 +
 ==== XML ==== ==== XML ====
  
Line 196: Line 236:
 </​SOAP-ENV:​Envelope>​ </​SOAP-ENV:​Envelope>​
 </​code>​ </​code>​
- 
developer/soap-1.3/methods/runcredit.txt · Last modified: 2010/08/26 15:14 by irina

Page Tools