【问题标题】:How do I update the invoice number of a SubscriptionRequest call using the Authorize.Net API?如何使用 Authorize.Net API 更新 SubscriptionRequest 调用的发票编号?
【发布时间】:2014-02-20 02:42:04
【问题描述】:

好的,这是我的问题。我正在尝试为我正在构建的产品构建定期支付服务。我现在正在使用 Authorize.Net 来构建它。我下载了他们的源代码和 API 并将其插入到我的代码隐藏文件中。

这是我的代码现在的样子:

try
{
     // create the address
     var address = new Address
     {
         Street = "123 4th Street",
         City = "Awesome City",
         State = "MD",
         Zip = "12345",
         Country = "US",
         Company = "Doe's Company",
         First = "John",
         Last = "Doe",
         ID = new Guid().ToString(),
         Phone = "(123) 456-7890"
    };

    // create the request
    SubscriptionRequest request =
    SubscriptionRequest.CreateMonthly("john@doe.com", "Test Subscription", 10.00M)
        .UsingCreditCard("John", "Doe", "4007000000027", 2020, 12)
        .WithBillingAddress(address);
    // create the gateway, sending in your credentials
    var gate = new SubscriptionGateway(ConfigurationManager.AppSettings["apiloginid"],                                     ConfigurationManager.AppSettings["transactionkey"], ServiceMode.Test);
    // make some money
    ISubscriptionRequest response = gate.CreateSubscription(request);
    return Json(response.SubscriptionID);
}
catch (Exception ex)
{
    return Json(ex.Message);
}

每次我调用这个,我都会收到一条错误消息:

错误处理请求:E00012 - 您提交了 订阅 1983944。不会创建重复订阅。

我查了一下,发现每当我想提交新订阅时,我都需要更新发票编号。使用 SubscriptionRequest,我似乎无法做到这一点。

有谁知道如何使用这种方法更新发票号码?

【问题讨论】:

  • 我认为错误消息为您提供了所需的所有洞察力。已创建重复订阅...创建订阅后,为什么需要更新发票编号。

标签: c# asp.net-mvc authorize.net


【解决方案1】:

我通过将源代码加载到我的项目中并手动更改代码来解决问题,以便每次都生成发票编号。

我希望他们能更新他们的 API 来做到这一点。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-03-12
    • 1970-01-01
    • 2021-02-18
    • 2016-06-29
    • 2019-07-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多