对于那些熟悉使用Chargify和PHP的人,我正在尝试执行一个应该是简单的请求。我正在使用Chargify API创建一个新用户。我的这部分代码正在工作。请求正在发送,Chargify正在录制新客户的信息。我想要做的是获取刚刚创建的客户的ID。这是我正在使用的,而且是抛出的错误。
码
// Create a ChargifyProduct object in test mode.
$customer->email = $_POST['email'];
$customer->first_name = $_POST['first_name'];
$customer->last_name = $_POST['last_name'];
$new_customer = $customer->create();
//Grab customer ID
$customer_x = $new_customer->getByID();误差
Fatal error: Uncaught exception 'ChargifyConnectionException' with message 'An error occurred while connecting to Chargify: Couldn't resolve host '.chargify.com' (6)' in /home/assets/lib/ChargifyConnector.php:99 Stack trace: #0 /home/\assets/lib/ChargifyConnector.php(146): ChargifyConnector->sendRequest('/customers.xml', 'XML', 'POST', '<?xml version="...') #1 /home/assets/lib/ChargifyConnector.php(157): ChargifyConnector->requestCreateCustomer('<?xml version="...') #2 /home/assets/lib/ChargifyCustomer.php(43): ChargifyConnector->createCustomer(Object(ChargifyCustomer)) #3 /home/andfun4/photoappoint.com/register/index.php(20): ChargifyCustomer->create() #4 {main} thrown in /home/assets/lib/ChargifyConnector.php on line 99如果对此有任何见解,我们将不胜感激。
谢谢
发布于 2012-09-07 06:56:26
显示的错误不是来自所示的代码!
从这一行看一看代码,它们会导致错误:
$new_customer = $customer->create();
//Grab customer ID
$customer_x = $new_customer->getByID();在我阅读时,在这些行中,与数据库建立了连接,并且无法解析第一个参数(主机名),因为它不存在。
https://stackoverflow.com/questions/12313074
复制相似问题