【问题标题】:Can you add an existing customer payment method to an existing sales order through Acumatica API?您可以通过 Acumatica API 将现有客户付款方式添加到现有销售订单吗?
【发布时间】:2014-11-21 20:49:29
【问题描述】:

我已经使用 AR301000 屏幕通过 API 创建了客户付款方式。但是,我在尝试将付款方式添加到销售订单时遇到了错误。这是我当前的代码。

    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
            }
    );

尝试运行时出现以下错误:

System.Web.Services.Protocols.SoapException:服务器无法处理请求。 ---> PX.Data.PXException:错误 #12:更新“销售订单”记录引发了一个或多个错误。请查阅。错误:“卡/帐号”不能为空。

是否还有其他必须更新的卡/帐号字段?

【问题讨论】:

    标签: acumatica


    【解决方案1】:
        You have to use different approach
    
        SO301000Content orderSchema = context.SO301000GetSchema();
        var commands = new Command[]
        {
            new Value 
            {
                Value = orderType, 
                LinkedCommand = orderSchema.OrderSummary.OrderType 
            },
            new Value 
            {
                Value = orderNbr, 
                LinkedCommand = orderSchema.OrderSummary.OrderNbr 
            },
            new Value 
            {
                Value = "TOKENCC", 
                LinkedCommand = orderSchema.PaymentSettings.PaymentMethod 
            },
            new Value 
            {
                Value = "True", 
                LinkedCommand = orderSchema.PaymentSettings.NewCard 
            },
    new Value { Value = "VISA", LinkedCommand = orderSchema.PaymentSettings.PaymentMethod },
    
    //below you have to fill attributes (pairs key-value)
            new Key
            {
                ObjectName = orderSchema.PaymentSettingsCardInfoDescription.Description.ObjectName,
                FieldName = orderSchema.PaymentSettingsCardInfoDescription.Description.FieldName,
                Value = "='CCDNUM'"
            },
            new Value 
            {
                Value = "4321111111111234", 
                LinkedCommand = orderSchema.PaymentSettingsCardInfoDescription.Value 
            },
    
            new Key
            {
                ObjectName = orderSchema.PaymentSettingsCardInfoDescription.Description.ObjectName,
                FieldName = orderSchema.PaymentSettingsCardInfoDescription.Description.FieldName,
                Value = "='CVV'"
            },
            new Value 
            {
                Value = "321", 
                LinkedCommand = orderSchema.PaymentSettingsCardInfoDescription.Value 
            },
    
    
            new Key
            {
                ObjectName = orderSchema.PaymentSettingsCardInfoDescription.Description.ObjectName,
                FieldName = orderSchema.PaymentSettingsCardInfoDescription.Description.FieldName,
                Value = "='EXPDATE'"
            },
            new Value 
            {
                Value = "01/2019", 
                LinkedCommand = orderSchema.PaymentSettingsCardInfoDescription.Value 
            },
    
            new Key
            {
                ObjectName = orderSchema.PaymentSettingsCardInfoDescription.Description.ObjectName,
                FieldName = orderSchema.PaymentSettingsCardInfoDescription.Description.FieldName,
                Value = "='NAMEONCC'"
            },
            new Value 
            {
                Value = "01/2019", 
                LinkedCommand = orderSchema.PaymentSettingsCardInfoDescription.Value 
            },
    
            orderSchema.Actions.Save
        };
    

    【讨论】:

    • 我在上面实际输入的帐户/卡号是与 Authorize.net 支付配置文件相关联的令牌,它应该允许我从 Acumatica 内授权/收取卡。看起来上面的代码建议实际上是将新卡信息(即:卡号、到期日期等)放入 Acumatica 中。对吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-12-13
    • 2020-06-15
    • 1970-01-01
    • 2014-12-28
    • 1970-01-01
    • 2018-10-20
    • 1970-01-01
    相关资源
    最近更新 更多