使用Acumatica Rest API创建或检索客户付款方法时出现问题

使用Acumatica Rest API创建或检索客户付款方法时出现问题,acumatica,Acumatica,更新:---提供的代码修复了图形上阻止API允许我创建的问题 public class CustomerPaymentMethodMaint_Extension:PXGraphExtension<CustomerPaymentMethodMaint> { #region Event Handlers protected virtual void CustomerPaymentMethodDetail_RowSelected(PXCache cache, PXRow

更新:---提供的代码修复了图形上阻止API允许我创建的问题

public class CustomerPaymentMethodMaint_Extension:PXGraphExtension<CustomerPaymentMethodMaint>
{

    #region Event Handlers

    protected virtual void CustomerPaymentMethodDetail_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected del)
    {
        if (del != null)
        {
            del(cache, e);
        }
        if (Base.IsContractBasedAPI)
        {
            CustomerPaymentMethodDetail row = (CustomerPaymentMethodDetail)e.Row;
            PXDefaultAttribute.SetPersistingCheck<CustomerPaymentMethodDetail.value>(cache, row, PXPersistingCheck.Nothing);
        }
    }

    #endregion

}
在尝试创建支付方法时,我尝试使用带有以下json主体的CustomerPaymentMethod端点的“PUT”(我还尝试使用这些字段的soap友好名称,而不是UI中的标签“CCDNUM”、“CVV”、“EXPDATE”、“NAMEONCC”)。返回给我的错误是“Value”不能为空

{
    "CustomerID" : { value: "0000467" },
    "PaymentMethod" : { value: "CC" },
    "CustomerPaymentMethodDetail" : [
        {
            "Description" : { value : "Card Number" },
            "Value" : { value : "4111111111111111" },
        },
        {
            "Description" : { value : "Expiration Date" },
            "Value" : { value : "102020" },
        },
        {
            "Description" : { value : "Name on the Card" },
            "Value" : { value : "Test API" },
        }
    ]
}

以下内容适用于我使用APS(美国支付解决方案)作为处理中心的项目

使用
GET
检索特定客户的客户付款方式集合:

/entity/Default/6.00.001/CustomerPaymentMethod/?$filter=CustomerID+eq+'000000'
使用
GET
按ID返回单个客户付款方式:(您可以从上述调用返回的记录中找到ID。)

我认为不可能使用带有Acumatica API的全新卡创建客户付款方式。我认为您首先必须使用处理中心的API创建付款记录。(在我的例子中是APS,但我假设Authorize.net以类似的方式工作。)然后,一旦处理器上存在支付记录,您就可以使用
PUT
在Acumatica中添加客户支付记录,以填充支付配置文件ID,该ID是对令牌化卡的引用。从那里,您可以使用上面的GET调用返回所需的内容,以便对销售订单进行身份验证/捕获


我现在正在处理这个问题,一旦我了解了更多信息,我会更新我的评论。

对我来说,以下几点很有效

/entity/Default/{version}/CustomerPaymentMethod/{customerID}/{customerPaymentMethodId}

现在,要获取
customerPaymentMethodId
,可以在展开
PaymentInstructions
时通过客户端点完成


但是不幸的是,
PaymentInstructions
只返回客户的默认付款方式。

谢谢您的回复。我们没有启用集成处理,因此信用卡实际上存储在我们的系统中,因此使用第三方api不适用于我们。我在Acumatica开了一张票,他们提供了一个“解决方案”,让我的问题得以解决我将其添加到原始问题Hello Chris,您如何使用RestAPI解决此问题?我收到相同的错误“PX.Data.PXException:错误:'Value'不能为空”。请指导我解决此问题。快速的帮助是非常感谢的。提前谢谢你。克里斯,如果你从Acumatica那里得到了答案,而不是提出你的问题,你应该回答你自己的问题并接受答案。
/entity/Default/6.00.001/CustomerPaymentMethod/?$filter=CustomerID+eq+'000000'
/entity/Default/6.00.001/CustomerPaymentMethod/guid-from-record?$expand=Details