我試圖使用Acumatica Web服務API創建銷售訂單。我已經能夠通過除付款設置以外的所有必填字段。我們的安裝使用Authorize.NET(PX.CCProcessing.AuthorizeNetTokenizedProcessing)加載項。是否可以通過API與Authorize.NET加載項進行交互,方法是創建新的付款方式並授權付款,以便員工可以從Acumatica內部處理訂單並在那裏捕獲付款。如何通過Acumatica API創建包含付款設置的銷售訂單
以下是我用來創建我的銷售訂單的代碼。我不確定要通過API本身激活「創建新的付款資料ID」操作的結構。通過GUI,它打開一個彈出窗口,將該卡複製到Authorize.Net並在Acumatica中保存一個支付配置文件ID記錄。
SO301000Content SO301000 = context.SO301000GetSchema();
context.SO301000Clear();
SO301000Content[] SO30100content = context.SO301000Submit
(
new Command[]
{
//add header info
new Value { Value = "SO", LinkedCommand = SO301000.OrderSummary.OrderType },
new Value { Value = "<NEW>", LinkedCommand = SO301000.OrderSummary.OrderNbr },
new Value { Value = "999999", LinkedCommand = SO301000.OrderSummary.Customer },
//add line items
SO301000.DocumentDetails.ServiceCommands.NewRow,
new Value { Value = "SS1121", LinkedCommand = SO301000.DocumentDetails.InventoryID },
new Value { Value = "2", LinkedCommand = SO301000.DocumentDetails.Quantity },
SO301000.DocumentDetails.ServiceCommands.NewRow,
new Value { Value = "SS1122", LinkedCommand = SO301000.DocumentDetails.InventoryID },
new Value { Value = "2", LinkedCommand = SO301000.DocumentDetails.Quantity },
SO301000.DocumentDetails.ServiceCommands.NewRow,
new Value { Value = "SS1123", LinkedCommand = SO301000.DocumentDetails.InventoryID },
new Value { Value = "2", LinkedCommand = SO301000.DocumentDetails.Quantity },
//add shipping information
new Value { Value = "True", LinkedCommand = SO301000.ShippingSettingsShipToInfoOverrideContact.OverrideContact },
new Value { Value = "DEMO CHURCH SHIP", LinkedCommand = SO301000.ShippingSettingsShipToInfoOverrideContact.BusinessName },
new Value { Value = "True", LinkedCommand = SO301000.ShippingSettingsShipToInfo.OverrideAddress },
new Value { Value = "123 TEST STREET", LinkedCommand = SO301000.ShippingSettingsShipToInfo.AddressLine1 },
new Value { Value = "BUFORD", LinkedCommand = SO301000.ShippingSettingsShipToInfo.City },
new Value { Value = "GA", LinkedCommand = SO301000.ShippingSettingsShipToInfo.State },
new Value { Value = "30519", LinkedCommand = SO301000.ShippingSettingsShipToInfo.PostalCode },
new Value { Value = "FREESHIP", LinkedCommand = SO301000.ShippingSettingsShippingInformation.ShipVia },
//add totals
new Value { Value = "10.00", LinkedCommand = SO301000.Totals.PremiumFreight },
new Value { Value = "94.0000", LinkedCommand = SO301000.Totals.PackageWeight },
//add payment
SO301000.Actions.Save,
SO301000.OrderSummary.OrderNbr
}
);
新代碼錯誤 - 我現在可以嘗試該卡插入到現有的銷售訂單時,插入客戶付款記錄,但收到一個錯誤。
這裏是我的代碼:
SO301000Content SO301000 = context.SO301000GetSchema();
context.SO301000Clear();
SO301000Content[] SO30100content = context.SO301000Submit
(
new Command[]
{
//add header info
new Value { Value = "SO", LinkedCommand = SO301000.OrderSummary.OrderType },
new Value { Value = "000129", LinkedCommand = SO301000.OrderSummary.OrderNbr },
//add payment
new Value { Value = "VISA", LinkedCommand = SO301000.PaymentSettings.PaymentMethod },
new Value { Value = "VISA:****-****-****-7261", LinkedCommand = SO301000.PaymentSettings.CardAccountNo },
SO301000.Actions.Save
}
);
如果任何人有任何想法,我將不勝感激。謝謝。
您能否提供示例源代碼來顯示您正在做什麼,以及詳細描述您遇到的錯誤? – Gabriel 2014-10-31 01:21:17
我已編輯我的帖子以包含當前的代碼以創建新的銷售訂單。我並沒有真正遇到錯誤,因爲我不確定添加卡並通過Authorize.NET插件連接它的步驟。 – 2014-10-31 03:44:16
Thx,我正在努力:) – Gabriel 2014-10-31 15:34:03