AuthorizedotNet 在 AuthorizeAndCapture 上的交易 ID

Transaction ID on AuthorizeAndCapture by AuthorizedotNet

我正在尝试通过 AuthorizeAndCapture 方法从 AuthorizeNet API.

获取交易 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 returns 为空。

我尝试从沙箱更改为生产环境,但均无效。

我使用 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);

我们在 "actual" 中找到了 transactionID。

希望能帮助到别人。