AuthorizedotNet在AuthorizeAndCapture上的交易ID

时间:2015-02-13 00:15:27

标签: c# authorize.net

我正在尝试通过 AuthorizeNet API 中的AuthorizeAndCapture方法获取交易ID。

private static void CreateTransaction(long profileId, long paymentProfileId)
{
    CustomerGateway target = new CustomerGateway(ApiLogin, TransactionKey);
    var response = target.AuthorizeAndCapture(profileId.ToString(), paymentProfileId.ToString(), 1020.00M);

    Console.WriteLine("Hola" + response.TransactionID);
}

但是,当我执行该方法时,属性response.TransactionID将返回空。

我尝试从沙盒更改为生产,但两者都不起作用。

1 个答案:

答案 0 :(得分:1)

我使用Authorize Net的另一个网关解决了这个问题

private static void CreateTransaction(long profileId, long paymentProfileId)
    {
        Gateway target = new Gateway(ApiLogin, TransactionKey, true);
        Customer cust = new Customer {ProfileID = profileId.ToString()};

        IGatewayRequest request = new AuthorizationRequest("4111111111111111", "0224", 20.10M,
            "AuthCap transaction approved testing", true);
        request.AddCustomer("31358164", "bla_bla@bla.com", "", "", "street", "City",
            "State","256984");

        const string description = "AuthCap transaction approved testing";

        var actual = target.Send(request, description);

进入"实际"我们找到了transactionID。

我希望能帮助别人。