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
残念ながら、それは私が望むようには機能しません。効きません。何が問題なのですか?