在infusionsoft中为发票/订单添加人工付款

时间:2016-08-20 22:52:44

标签: php infusionsoft

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

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

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

1 个答案:

答案 0 :(得分:0)

我遇到了同样的问题。我认为这是由于传递带有错误数据类型的参数。

在您的情况下,我认为您的日期格式不符合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);

最佳做法是提及带参数的数据类型。