对于那些熟悉使用Chargify和PHP的人,我正在尝试执行一个应该很简单的请求。我用代码点火器创建了一个购物车,现在我试图在它的托管页面URL上传递名字、姓氏、电子邮件和overall_total -但我一直收到一个错误,说找不到页面。这是我到目前为止所得到的:
<?
$site_shared_key = 'h8X9-jj2doSwOX4l__Zb';
$token = SHA1($site_shared_key);
?>
<form name="chargifySignupForm" method="get" action="https://leavereview-chargify-test.chargify.com/update_payment/2989648/<?=$token;?>">
First Name
<input type="text" name="firstname" value="<?=$firstname;?>" readonly>
Last Name
<input type="text" name="lastname" value="<?=$lastname;?>" readonly>
Email
<input type="text" name="email" value="<?=$email;?>" readonly>
<?
$overall_total = $profile_rate + $locations_rate_total;
?>
Your Overall Total (To be paid on Chargify)
<input type="text" name="overall_total" value="<?=$overall_total;?>" readonly>
<input type="submit" value="Pay Now to Chargify" />
</form>我认为问题出在$token部分,希望有人能给我一个提示,告诉我如何修复它。文档(http://docs.chargify.com/hosted-page-integration#hosted-page-urls)不需要API键,所以我不确定是否还需要这个键才能让我的脚本工作。
提前谢谢。
发布于 2013-01-22 19:50:40
根据chargify文档,您不能提交到chargify托管页面,您只需要将其超链接到该页面,并且您还可以使托管页面的外观与您的网站相匹配。
以下是托管页面Hosted page integration上的文档
如果你真的想让它解耦,那就放弃这个托管页面的想法,尝试使用API,无论你通过托管页面实现了什么,你也可以通过API实现同样的效果。
以下是chargify的文档链接
API integration notes
您也可以在这里获得示例代码sample code
在针对您的需求的示例代码列表中,您可以使用ChargeIgniter - Chargify API For CodeIgniter。这真的很适合作为起点。
希望这能有所帮助
https://stackoverflow.com/questions/14370658
复制相似问题