2

尝试向订单添加人工付款。首先很难显示订单项目,当我对其进行硬编码时 - 它可以显示订单项目。

更大的问题是付款也没有适用?

if ($myApp->cfgCon("ds")) {
//$date = $myApp->infuDate(date("Y-m-d"));
$date = $myApp->infuDate(date('Ymd\TH:i:s'));

$invoiceId = $myApp->blankOrder($contactID,"Product A", $date, 0, 0);

$currentDate = date('Ymd\TH:i:s');
$odate = new DateTime($currentDate); 


$iresult = $myApp->addOrderItem($invoiceId, 60, 4, 9.95, 1, "Product A", "Product A");  

//$iresult = $myApp->addOrderItem($invoiceId, $infprodid, 4, $prodPrice, 1, $prodName, $prodName);  
//$pDate = $myApp->infuDate(date("Y-m-d"));
//  $presult = $myApp->manualPmt(intval($invoiceId),$prodPrice,$odate,'Credit Card','paid by Credit Card',false);

$presult = $myApp->manualPmt(intval($invoiceId),9.95,$odate,'Credit Card','paid by Credit Card',false);
4

1 回答 1

1

我面临着同样的问题。我认为这是由于传递了错误数据类型的参数。

就您而言,我认为您的日期格式不符合 infusionsoft 的日期格式。好吧,这段代码对我有用。

$currentDate = date('Y-m-d H:i:s');
$now = new DateTime($currentDate);
$invoiceID=$infusionsoft->invoices()->createBlankOrder($contactID, 'New Test Order by Junaid', $d, 0, 0);
$re=$infusionsoft->invoices()->addOrderItem($invoiceID, 4, 4, 200.0, 1,   'This is New test item added by junaid', 'New testing by junaid','');
$infusionsoft->invoices()->addManualPayment((int) 160,(float) 200.0, $now, 'API', 'New Test Payment by juanid',true);

最佳实践也是提及带有参数的数据类型。

于 2016-11-11T06:02:45.900 回答