簡體   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