我在infusionsoft的地方订购api但是收到此错误。 没有匹配参数的方法:java.lang.String,java.lang.Integer,java.lang.String,java.lang.String,java.lang.Integer,java.lang.Integer 这是我的api代码。
<?php
require_once("isdk.php");
$client = new xmlrpc_client("https://dv331.infusionsoft.com/api/xmlrpc");
###Return Raw PHP Types###
$client->return_type = "phpvals";
###Dont bother with certificate verification###
$client->setSSLVerifyPeer(FALSE);
class infusionsoft extends iSDK {
public $appName, $information;
public function __construct() {
include('conn.cfg.php');
foreach ($connInfo as $appLine) {
$nameIs['appName'] = substr($appLine, 0, strpos($appLine, ":"));
}
$this->appName = $nameIs['appName'];
if ($this->cfgCon($this->appName)) {
//echo "You Are Connected To Infusionsoft !";
} else {
echo "You Are Not Connected To Infusionsoft !";
exit();
}
}
}
$app = new infusionsoft();
$carray = array(
$key,
@contactId,
$CreditId,
$planId,
array(100,101),
array(100,101),
false,
array("MyPlan1","MyPlan2"));
$result = $app->placeOrder($carray);
答案 0 :(得分:0)
我假设您的代码中正在使用旧的Infusionsoft SDK。
这里是你正在调用的方法placeOrder()的来源:
/**
* @method placeOrder
* @description Builds, creates and charges an order.
* @param int $contactId
* @param int $creditCardId
* @param int $payPlanId
* @param array $productIds
* @param array $subscriptionIds
* @param bool $processSpecials
* @param array $promoCodes
* @param int $leadAff
* @param int $saleAff
* @return array
*/
public function placeOrder($contactId, $creditCardId, $payPlanId, $productIds, $subscriptionIds, $processSpecials, $promoCodes, $leadAff = 0, $saleAff = 0)
{
$carray = array(
php_xmlrpc_encode((int)$contactId),
php_xmlrpc_encode((int)$creditCardId),
php_xmlrpc_encode((int)$payPlanId),
php_xmlrpc_encode($productIds),
php_xmlrpc_encode($subscriptionIds),
php_xmlrpc_encode($processSpecials),
php_xmlrpc_encode($promoCodes),
php_xmlrpc_encode((int)$leadAff),
php_xmlrpc_encode((int)$saleAff));
return $this->methodCaller("OrderService.placeOrder", $carray);
}
因此,要发送的第一个参数是$ contactId,隐式添加API密钥。
发送的参数也在内部进行了类型转换,因此只要提供了正确的参数,就不会有任何问题。