我正在尝试使用Acumatica Web Service API创建销售订单 . 我已经能够传递除付款设置之外的所有必填字段 . 我们的安装使用Authorize.NET(PX.CCProcessing.AuthorizeNetTokenizedProcessing)加载项 . 是否可以通过API与Authorize.NET加载项进行交互,方法是创建新的付款方式并授权付款,以便员工可以在Acumatica内处理订单并在那里捕获付款 .
以下是我用来创建销售订单的代码 . 我不确定要通过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
}
);
如果有人有任何想法,我将不胜感激 . 谢谢 .
2 回答
您不能使用“创建新的付款配置文件ID”,因为它依赖于Web浏览器中的实际用户(我们只是在IFRAME中显示Authorize.net新的配置文件页面) . 我们这样做是为了限制应用程序暴露于PCI合规性,这样,没有信用卡号或敏感信息触及Acumatica服务器 . 您应该直接通过Authorize.net CIM站点或CIM API添加付款配置文件,并将配置文件ID传递给Acumatica .
遗憾的是,您无法将客户资料ID直接传递给订单,只接受付款资料值作为输入,因此您首先需要使用“客户付款方式”屏幕API添加该条目 .
然后,当您创建销售订单时,您只需指定在创建过程之后由AR301000返回的要使用的卡:
以下是显示如何通过基于屏幕的API在销售订单中设置卡号的示例:
对于在Aspx中设置了TextField属性的每个选择器,此模式都是必需的 .