2014-11-20 79 views
0

我已經使用AR301000屏幕通過API創建了客戶付款方式。但是,嘗試將付款方式添加到銷售訂單時遇到了錯誤。這是我目前的代碼。您可以通過Acumatica 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:更新'銷售訂單'記錄引發一個或多個錯誤。請查閱。錯誤:「卡/帳號否」不能爲空。

是否有另一個必須更新的卡/帳號號碼字段?

回答

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 
    }; 
+0

我上面實際輸入的帳號/卡號是與Authorize.net付款資料相關聯的令牌,它應該允許我從Acumatica內授權/收費卡。看起來上面的代碼建議實際上將新卡信息(即:卡號,過期日期等)放入Acumatica。那是對的嗎? – 2014-11-21 14:31:43

相關問題