-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
91 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using AuthorizeNet; | ||
using AuthorizeNet.Api.Controllers; | ||
using AuthorizeNet.Api.Contracts.V1; | ||
using AuthorizeNet.Api.Controllers.Bases; | ||
|
||
namespace net.authorize.sample | ||
{ | ||
public class GetHeldTransactionList | ||
{ | ||
public static ANetApiResponse Run(String ApiLoginID, String ApiTransactionKey) | ||
{ | ||
Console.WriteLine("Get suspicious transaction list sample"); | ||
|
||
ApiOperationBase<ANetApiRequest, ANetApiResponse>.RunEnvironment = AuthorizeNet.Environment.SANDBOX; | ||
// define the merchant information (authentication / transaction id) | ||
ApiOperationBase<ANetApiRequest, ANetApiResponse>.MerchantAuthentication = new merchantAuthenticationType() | ||
{ | ||
name = ApiLoginID, | ||
ItemElementName = ItemChoiceType.transactionKey, | ||
Item = ApiTransactionKey, | ||
}; | ||
|
||
var request = new getUnsettledTransactionListRequest(); | ||
request.status = TransactionGroupStatusEnum.pendingApproval; | ||
request.statusSpecified = true; | ||
request.paging = new Paging | ||
{ | ||
limit = 10, | ||
offset = 1 | ||
}; | ||
request.sorting = new TransactionListSorting | ||
{ | ||
orderBy = TransactionListOrderFieldEnum.id, | ||
orderDescending = true | ||
}; | ||
// instantiate the controller that will call the service | ||
var controller = new getUnsettledTransactionListController(request); | ||
controller.Execute(); | ||
|
||
// get the response from the service (errors contained if any) | ||
var response = controller.GetApiResponse(); | ||
if (response != null && response.messages.resultCode == messageTypeEnum.Ok) | ||
{ | ||
if (response.transactions == null) | ||
return response; | ||
|
||
foreach (var item in response.transactions) | ||
{ | ||
Console.WriteLine("Transaction Id: {0} was submitted on {1}", item.transId, | ||
item.submitTimeLocal); | ||
} | ||
} | ||
else if(response != null) | ||
{ | ||
Console.WriteLine("Error: " + response.messages.message[0].code + " " + | ||
response.messages.message[0].text); | ||
} | ||
|
||
return response; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters