<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://shiyoka.com/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="https://shiyoka.com/feed.php">
        <title>ClownWiki - facebook_credits_api</title>
        <description></description>
        <link>https://shiyoka.com/</link>
        <image rdf:resource="https://shiyoka.com/lib/exe/fetch.php?media=wiki:dokuwiki.svg" />
       <dc:date>2026-05-08T13:31:42+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://shiyoka.com/doku.php?id=facebook_credits_api:about&amp;rev=1739713983&amp;do=diff"/>
                <rdf:li rdf:resource="https://shiyoka.com/doku.php?id=facebook_credits_api:add_test_user&amp;rev=1739713983&amp;do=diff"/>
                <rdf:li rdf:resource="https://shiyoka.com/doku.php?id=facebook_credits_api:flow_data_sample&amp;rev=1739713983&amp;do=diff"/>
                <rdf:li rdf:resource="https://shiyoka.com/doku.php?id=facebook_credits_api:memo&amp;rev=1739713983&amp;do=diff"/>
                <rdf:li rdf:resource="https://shiyoka.com/doku.php?id=facebook_credits_api:official_sample_callback_php&amp;rev=1739713983&amp;do=diff"/>
                <rdf:li rdf:resource="https://shiyoka.com/doku.php?id=facebook_credits_api:official_sample_callback_php_jpn&amp;rev=1739713983&amp;do=diff"/>
                <rdf:li rdf:resource="https://shiyoka.com/doku.php?id=facebook_credits_api:official_sample_index_php&amp;rev=1739713983&amp;do=diff"/>
                <rdf:li rdf:resource="https://shiyoka.com/doku.php?id=facebook_credits_api:overview&amp;rev=1739713983&amp;do=diff"/>
                <rdf:li rdf:resource="https://shiyoka.com/doku.php?id=facebook_credits_api:sample_cakephp_controller&amp;rev=1739713983&amp;do=diff"/>
                <rdf:li rdf:resource="https://shiyoka.com/doku.php?id=facebook_credits_api:sample_cakephp_model_1&amp;rev=1739713983&amp;do=diff"/>
                <rdf:li rdf:resource="https://shiyoka.com/doku.php?id=facebook_credits_api:sample_cakephp_model_2&amp;rev=1739713983&amp;do=diff"/>
                <rdf:li rdf:resource="https://shiyoka.com/doku.php?id=facebook_credits_api:sample_index_php&amp;rev=1739713983&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="https://shiyoka.com/lib/exe/fetch.php?media=wiki:dokuwiki.svg">
        <title>ClownWiki</title>
        <link>https://shiyoka.com/</link>
        <url>https://shiyoka.com/lib/exe/fetch.php?media=wiki:dokuwiki.svg</url>
    </image>
    <item rdf:about="https://shiyoka.com/doku.php?id=facebook_credits_api:about&amp;rev=1739713983&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-02-16T13:53:03+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>about</title>
        <link>https://shiyoka.com/doku.php?id=facebook_credits_api:about&amp;rev=1739713983&amp;do=diff</link>
        <description>Facebook Credits API

Facebook Credits とは

Facebook 内で利用可能な仮想マネー。
事前に購入（換金）しておくことで、ゲーム内でアイテムを購入するなどに利用可能。
国内では 『 Facebook ポイント 』 と翻訳される。</description>
    </item>
    <item rdf:about="https://shiyoka.com/doku.php?id=facebook_credits_api:add_test_user&amp;rev=1739713983&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-02-16T13:53:03+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>add_test_user</title>
        <link>https://shiyoka.com/doku.php?id=facebook_credits_api:add_test_user&amp;rev=1739713983&amp;do=diff</link>
        <description>テストユーザ作成

公式ドキュメント

&lt;http://developers.facebook.com/docs/test_users/&gt;

アクセストークン取得

Facebook アプリの設定ページから、「アプリID」と「アプリの秘訣」を確認する。

調べた情報を使って、ターミナルから以下のコマンドを実行する。</description>
    </item>
    <item rdf:about="https://shiyoka.com/doku.php?id=facebook_credits_api:flow_data_sample&amp;rev=1739713983&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-02-16T13:53:03+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>flow_data_sample</title>
        <link>https://shiyoka.com/doku.php?id=facebook_credits_api:flow_data_sample&amp;rev=1739713983&amp;do=diff</link>
        <description>流れているデータサンプル

payments_get_items


Array
(
   [func] =&gt; payments_get_items
   [request] =&gt; Array
       (
           [algorithm] =&gt; HMAC-SHA256
           [credits] =&gt; Array
               (
                   [buyer] =&gt; 100000543667359
                   [receiver] =&gt; 100000543667359
                   [order_id] =&gt; 9004827591922
                   [order_info] =&gt; {&quot;item_id&quot;:&quot;1&quot;,&quot;title&quot;:&quot;item_tilte&quot;,&quot;description&quot;:&quot;item_description&quot;,&quot;price&quot;:&quot;10&quot;,&quot;image_url&quot;:&quot;http://test.com/test.png&quot;,&quot;product_ur…</description>
    </item>
    <item rdf:about="https://shiyoka.com/doku.php?id=facebook_credits_api:memo&amp;rev=1739713983&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-02-16T13:53:03+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>memo</title>
        <link>https://shiyoka.com/doku.php?id=facebook_credits_api:memo&amp;rev=1739713983&amp;do=diff</link>
        <description>雑記 ～2011/05/13～

■日本から銀行振り込みでの購入に対応
&lt;http://developers.facebook.com/blog/post/473&gt;

■150社、350以上のアプリで利用可能
&lt;http://developers.facebook.com/blog/post/451/&gt;

■2011年7月から「Facebook Credit」への対応を義務化
■各ゲーム内の独自通貨は、facebook credit を経由して取得
1) ユーザーが facebook credit 購入
2) ユーザーが facebook credit を使用して 各ゲームの独自通貨を購入（換金）
3) ユーザーが独自通貨でゲーム内のアイテムを購入
■共通通貨を作ることで、特定ゲームでのユーザーの囲い込みを防ぐ
■facebook はfacebook creditsの売り上げから30%の手数料を徴収
■facebook creditのみで決済処理をしているゲーム、デベロッパには宣伝広告など特典あり…</description>
    </item>
    <item rdf:about="https://shiyoka.com/doku.php?id=facebook_credits_api:official_sample_callback_php&amp;rev=1739713983&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-02-16T13:53:03+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>official_sample_callback_php</title>
        <link>https://shiyoka.com/doku.php?id=facebook_credits_api:official_sample_callback_php&amp;rev=1739713983&amp;do=diff</link>
        <description>公式サンプル - callback.php


&lt;?php
// Copyright 2004-2011 Facebook. All Rights Reserved.

/**
   * You should reference http://developers.facebook.com/docs/creditsapi as you
   * familiarize yourself with callback.php. In particular, read all the steps
   * under &quot;Callback Flow in Detail&quot;.
   *
   * Your application needs the following inputs and outputs
   *
   * @param int order_id             
   * @param string status
   * @param string method
   * @param array order_details (JSON-encoded)
   *
 …</description>
    </item>
    <item rdf:about="https://shiyoka.com/doku.php?id=facebook_credits_api:official_sample_callback_php_jpn&amp;rev=1739713983&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-02-16T13:53:03+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>official_sample_callback_php_jpn</title>
        <link>https://shiyoka.com/doku.php?id=facebook_credits_api:official_sample_callback_php_jpn&amp;rev=1739713983&amp;do=diff</link>
        <description>公式サンプル - callback.php（日本語コメント）


&lt;?php
// Copyright 2004-2011 Facebook. All Rights Reserved.

/**
   * You should reference http://developers.facebook.com/docs/creditsapi as you
   * familiarize yourself with callback.php. In particular, read all the steps
   * under &quot;Callback Flow in Detail&quot;.
   *
   * Your application needs the following inputs and outputs
   *
   * @param int order_id             
   * @param string status
   * @param string method
   * @param array order_details (JSON-encode…</description>
    </item>
    <item rdf:about="https://shiyoka.com/doku.php?id=facebook_credits_api:official_sample_index_php&amp;rev=1739713983&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-02-16T13:53:03+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>official_sample_index_php</title>
        <link>https://shiyoka.com/doku.php?id=facebook_credits_api:official_sample_index_php&amp;rev=1739713983&amp;do=diff</link>
        <description>公式サンプル - index.php


&lt;?php
//Enter your APP ID below
define(&#039;APP_ID&#039;, &#039;abc123&#039;);
?&gt;

&lt;!-- Copyright 2004-2011 Facebook. All Rights Reserved.--&gt;

&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;
 xmlns:fb=&quot;http://www.facebook.com/2008/fbml&quot;&gt;
&lt;head&gt;
  &lt;title&gt;Facebook Credits Demo Application&lt;/title&gt;
&lt;/head&gt;

&lt;body&gt;
  &lt;h2&gt; Facebook Credits Demo Application&lt;/h2&gt;

  &lt;p&gt; Create an order by specifying the following attributes:&lt;/br&gt;
  &lt;i&gt;Title, price, description, image URL and product URL&lt;/i&gt;&lt;/p&gt;
  
  &lt;!-- P…</description>
    </item>
    <item rdf:about="https://shiyoka.com/doku.php?id=facebook_credits_api:overview&amp;rev=1739713983&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-02-16T13:53:03+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>overview</title>
        <link>https://shiyoka.com/doku.php?id=facebook_credits_api:overview&amp;rev=1739713983&amp;do=diff</link>
        <description>Overview

Facebook Credits APIは、ユーザがFacebook canvas applicationの中で仮想商品を購入するためにポイント（= facebook credits）が使用できるようになります。 
注意：credits apiはまだFacebook Connect applicationsでは使えません。</description>
    </item>
    <item rdf:about="https://shiyoka.com/doku.php?id=facebook_credits_api:sample_cakephp_controller&amp;rev=1739713983&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-02-16T13:53:03+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>sample_cakephp_controller</title>
        <link>https://shiyoka.com/doku.php?id=facebook_credits_api:sample_cakephp_controller&amp;rev=1739713983&amp;do=diff</link>
        <description>サンプル - cakephp - controller


&lt;?php
class CreditsController extends AppController {

    var $name = &#039;Credits&#039;;
    var $helpers = array(&#039;Js&#039;);
    var $components = array(&#039;RequestHandler&#039;);

    // アイテム一覧作成のために、アイテム情報取得
    public function get_items() {
        $json = $this-&gt;Credit-&gt;get();
        if($json === false) {
            $this-&gt;renderErrorJson($this-&gt;Credits-&gt;validationErrors);
            return;
        }
        $this-&gt;renderJson($json);
    }
    // callback
    public function c…</description>
    </item>
    <item rdf:about="https://shiyoka.com/doku.php?id=facebook_credits_api:sample_cakephp_model_1&amp;rev=1739713983&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-02-16T13:53:03+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>sample_cakephp_model_1</title>
        <link>https://shiyoka.com/doku.php?id=facebook_credits_api:sample_cakephp_model_1&amp;rev=1739713983&amp;do=diff</link>
        <description>サンプル - cakephp - model（1）


&lt;?php
class Credit extends AppModel {
    var $name = &#039;Credit&#039;;
    var $useDbConfig = &#039;credit&#039;;
    var $useTable = &#039;credit_orders&#039;;

    var $validate = array(
        &#039;order_id&#039; =&gt; array(
            &#039;alphanumeric&#039; =&gt; array(
                &#039;rule&#039; =&gt; &#039;alphaNumeric&#039;,
                &#039;required&#039; =&gt; true,
                &#039;message&#039; =&gt; &#039;Alphabets and numbers only&#039;
            )
        ),
        &#039;credit_item_id&#039; =&gt; array(
            &#039;numeric&#039; =&gt; array(
                …</description>
    </item>
    <item rdf:about="https://shiyoka.com/doku.php?id=facebook_credits_api:sample_cakephp_model_2&amp;rev=1739713983&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-02-16T13:53:03+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>sample_cakephp_model_2</title>
        <link>https://shiyoka.com/doku.php?id=facebook_credits_api:sample_cakephp_model_2&amp;rev=1739713983&amp;do=diff</link>
        <description>サンプル - cakephp - model（2）


&lt;?php
class CreditItem extends AppModel {
   var $name = &#039;CreditItem&#039;;
   var $useDbConfig = &#039;credit&#039;;
   var $useTable = &#039;credit_items&#039;;
   var $validate = array(
   );

   var $get_fields = array(
       &#039;CreditItem.id&#039;,
       &#039;CreditItem.title&#039;,
       &#039;CreditItem.description&#039;,
       &#039;CreditItem.image_url&#039;,
       &#039;CreditItem.product_url&#039;,
       &#039;CreditItem.price&#039;,
       &#039;CreditItem.cheer_point&#039;,
   );

   public function get($item_id = null) {
       $params =…</description>
    </item>
    <item rdf:about="https://shiyoka.com/doku.php?id=facebook_credits_api:sample_index_php&amp;rev=1739713983&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-02-16T13:53:03+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>sample_index_php</title>
        <link>https://shiyoka.com/doku.php?id=facebook_credits_api:sample_index_php&amp;rev=1739713983&amp;do=diff</link>
        <description>サンプル - index.php


 &lt;?php
 //Enter your APP ID below
 define(&#039;APP_ID&#039;, &#039;input app id&#039;);
 
 $base=&#039;http://api.sample.com&#039;;
 $val = $base.&#039;/credits/get_items&#039;;
 $val = file_get_contents($val);
 $value = json_decode($val,true);
 $value = $value[&#039;CreditItem&#039;];
 ?&gt;
 
 &lt;!-- Copyright 2004-2011 Facebook. All Rights Reserved.--&gt;
 
 &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;
  xmlns:fb=&quot;http://www.facebook.com/2008/fbml&quot;&gt;
 &lt;head&gt;
   &lt;title&gt;Facebook Credits Demo Application&lt;/title&gt;
 &lt;/head&gt;
 
 &lt;body&gt;
   &lt;…</description>
    </item>
</rdf:RDF>
