![]() |
VOOZH | about |
The CData Cmdlets for Authorize.Net are standard PowerShell cmdlets that make it easy to accomplish data cleansing, normalization, backup, and other integration tasks by enabling real-time access to Authorize.Net.
The Cmdlets are not only a PowerShell interface to Authorize.Net, but also an SQL interface; this tutorial shows how to use both to retrieve Authorize.Net data. We also show examples of the ADO.NET equivalent, which is possible with the CData ADO.NET Provider for Authorize.Net. To access Authorize.Net data from other .NET applications, like LINQPad, use the CData ADO.NET Provider for Authorize.Net.
Once you have acquired the necessary connection properties, accessing Authorize.Net data in PowerShell can be enabled in three steps.
You can obtain the necessary connection properties on the Security Settings -> General Settings page after logging into your Merchant Account.
Install the module:
Install-Module AuthorizeNetCmdlets
Connect:
$authorizenet = Connect-AuthNet -LoginId "$LoginId" -TransactionKey "$TransactionKey"
Search for and retrieve data:
$includestatistics = "True" $settledbatchlist = Select-AuthNet -Connection $authorizenet -Table "SettledBatchList" -Where "IncludeStatistics = `'$IncludeStatistics`'" $settledbatchlist
You can also use the Invoke-AuthNet cmdlet to execute SQL commands:
$settledbatchlist = Invoke-AuthNet -Connection $authorizenet -Query 'SELECT * FROM SettledBatchList WHERE IncludeStatistics = @IncludeStatistics' -Params @{'@IncludeStatistics'='True'}
Load the provider's assembly:
[Reflection.Assembly]::LoadFile("C:\Program Files\CData\CData ADO.NET Provider for Authorize.Net\lib\System.Data.CData.AuthorizeNet.dll")
Connect to Authorize.Net:
$conn= New-Object System.Data.CData.AuthorizeNet.AuthorizeNetConnection("LoginId=MyLoginId;TransactionKey=MyTransactionKey;")
$conn.Open()
Instantiate the AuthorizeNetDataAdapter, execute an SQL query, and output the results:
$sql="SELECT MarketType, TotalCharge from SettledBatchList"
$da= New-Object System.Data.CData.AuthorizeNet.AuthorizeNetDataAdapter($sql, $conn)
$dt= New-Object System.Data.DataTable
$da.Fill($dt)
$dt.Rows | foreach {
Write-Host $_.markettype $_.totalcharge
}
Download a free trial of the Authorize.Net Data Provider to get started:
Download NowLearn more:
👁 Authorize.Net IconEasy-to-use Authorize.Net client enables .NET-based applications to easily consume Authorize.NET Transactions, Customers, BatchStatistic, etc.