【发布时间】:2023-03-15 10:16:02
【问题描述】:
我正在尝试为 Coinbase 比特币支付创建回调脚本。这是我的支付控制器的以下功能:
function callback($secret = NULL) {
if ($secret == 'testSECRETkey') {
//If order is "completed", please proceed.
$data = json_decode(file_get_contents('php://input'), TRUE);
$status = $data['order']['status'];
$userid = '507';
if (($status === 'completed')) {
$this->db->query( 'update users set user_money=user_money+15, user_credits=user_credits+5 WHERE users_id=' . $userid );
}
}
如何包含special parameter,所以当我请求url时:www.example.com/payments/callback
添加特殊密钥,如果拒绝访问脚本无效。示例:
www.example.com/payments/callback?secret=testSECRETkey
不幸的是,它不能按我的意愿工作。它没有生效。有什么问题吗?
【问题讨论】:
标签: php codeigniter parameters coinbase-api