【发布时间】: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