0

我已经使用 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:更新“销售订单”记录引发了一个或多个错误。请查阅。错误:“卡/帐户号”可能不是空的。

是否有另一个必须更新的卡/帐号字段?

4

1 回答 1

0
    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
    };
于 2014-11-21T12:49:29.000 回答