繁体   English   中英

如何使用Authorize.Net API更新SubscriptionRequest调用的发票编号?

[英]How do I update the invoice number of a SubscriptionRequest call using the Authorize.Net API?

好的,这是我的问题。 我正在尝试为我要构建的产品构建定期付款服务。 我现在正在使用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,我似乎无法做到这一点。

有谁知道我可以使用这种方法更新发票编号吗?

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

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM