对于那些熟悉使用 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
对此的任何见解将不胜感激。
谢谢