使用他们的建议PHP库进行Chargebee集成。
我在页面顶部有包含语句,以包括库。并设置环境变量,从控制面板复制粘贴测试服务器信息.
无论我尝试什么,当我使用它们的示例代码时,我的页面加载中断,我得到一个白色的屏幕。如果没有这段代码,页面就会很好地加载,所有的dbase调用都能很好地工作。
还有更多关于Chargebee图书馆的事我没有抓到吗?
(in the top of the php)
include("/app/includes/chargebee-php-master/lib/ChargeBee.php");
ChargeBee_Environment::configure("SERVERNAME-test",
"test_KEYFROMCONTROLPANEL");
(inline code in a function)
$result = ChargeBee_Subscription::create(array(
"planId" => "pond_ripple",
"customer" => array(
"email" => "john@user.com",
"firstName" => "John",
"lastName" => "Doe",
"phone" => "+1-949-999-9999"
),
"billing_address" => array(
"firstName" => "John",
"lastName" => "Doe",
"line1" => "PO Box 9999",
"city" => "Walnut",
"state" => "CA",
"zip" => "91789",
"country" => "US"
)
));
$subscription = $result->subscription();
$customer = $result->customer();
$card = $result->card();
$invoice = $result->invoice();
$sampleString = $customer["id"];发布于 2014-02-24 11:19:37
您的包含路径正确吗?
include("/app/includes/chargebee-php-master/lib/ChargeBee.php");你能交叉检查它是否从一个基本目录开始吗?即。/app/includes/chargebee-php-master/lib/ChargeBee.php还是相对的?即app/includes/chargebee-php-master/lib/ChargeBee.php
如果您的路径是正确的(完整路径),您可以提供错误日志来进一步调试吗?此外,您还需要以$ customer ->id的形式访问ChargeBee customer对象,而不是作为数组访问。
https://stackoverflow.com/questions/21975091
复制相似问题