AGA Neto,
Você já viu esse exemplo?
É preciso ter o pacote instalado...
PM> Install-Package AuthorizeNet
==============================================
Authorize.Net | A Visa Solution
using System;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.Generic;
using AuthorizeNet.Api.Controllers;
using AuthorizeNet.Api.Contracts.V1;
using AuthorizeNet.Api.Controllers.Bases;
namespace net.authorize.sample
{
public class ChargeCreditCard
{
public static void Run(String ApiLoginID, String ApiTransactionKey)
{
Console.WriteLine("Charge Credit Card Sample");
ApiOperationBase.RunEnvironment = AuthorizeNet.Environment.SANDBOX;
// define the merchant information (authentication / transaction id)
ApiOperationBase.MerchantAuthentication = new merchantAuthenticationType()
{
name = ApiLoginID,
ItemElementName = ItemChoiceType.transactionKey,
Item = ApiTransactionKey,
};
var creditCard = new creditCardType
{
cardNumber = "4111111111111111",
expirationDate = "0718"
};
//standard api call to retrieve response
var paymentType = new paymentType { Item = creditCard };
var transactionRequest = new transactionRequestType
{
transactionType = transactionTypeEnum.authCaptureTransaction.ToString(), // charge the card
amount = 133.45m,
payment = paymentType
};
var request = new createTransactionRequest { transactionRequest = transactionRequest };
// instantiate the contoller that will call the service
var controller = new createTransactionController(request);
controller.Execute();
// get the response from the service (errors contained if any)
var response = controller.GetApiResponse();
if (response.messages.resultCode == messageTypeEnum.Ok)
{
if (response.transactionResponse != null)
{
Console.WriteLine("Success, Auth Code : " + response.transactionResponse.authCode);
}
}
else
{
Console.WriteLine("Error: " + response.messages.message[0].code + " " + response.messages.message[0].text);
if (response.transactionResponse != null)
{
Console.WriteLine("Transaction Error : " + response.transactionResponse.errors[0].errorCode + " " + response.transactionResponse.errors[0].errorText);
}
}
}
}
}
https://developer.authorize.net/hello_world/
==============================================
Veja também:
==============================================
Where in the Authorize.net database is login_id, custtoken and paytoken?
https://community.developer.authorize.net/t5/Integration-and-Testing/Where-in-the-Authorize-net-database-is-login-id-custtoken-and/td-p/68739
==============================================
Authorize.Net ODBC Driver
SQL-based Access to Authorize.Net through ODBC
Easily connect live Authorize.Net data with BI, ETL, Reporting, & Custom Apps.
https://www.cdata.com/drivers/authorizedotnet/odbc/
==============================================
understanding database schema
https://community.developer.authorize.net/t5/Integration-and-Testing/understanding-database-schema/td-p/18824
==============================================
[]'s,
Fabio I.