This shows you the differences between two versions of the page.
developer:soap-1.2:methods:runcredit [2010/02/12 10:32] epouchak created |
developer:soap-1.2:methods:runcredit [2010/09/15 15:48] (current) irina |
||
---|---|---|---|
Line 158: | Line 158: | ||
</code> | </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> | ||
==== XML ==== | ==== XML ==== |