APIを介して支払い方法のリストを取得する方法は?
url:http://www.namedoseusite.com.br/api_ds_orders.php?action = payment_method
<テーブルスタイル= "幅:100%;">
パラメーター | フォーマット | 説明 |
国 | get | 国番号 番号のみが必要です< /td> |
phpサンプル:
//サンプル支払い_Method
$ url = $ tabain_url。 &#39; /api_ds_orders.php?action = payment_method&amp; country =&#39; $ _ get [&#39; country&#39;];
$ data_products [0] = array( "products_id" =&gt; $ _get [&#39; products_id&#39;]、//例:130(番号のみが必要) *フィールドが必要です
「Products_Quantity」=&gt; $ _get [&#39; products_quantity&#39;] //例:1(番号のみが必要です) *フィールドが必要です
);$ data_products [1] = array( "products_id" =&gt; $ _get [&#39; products_id1&#39;]、//例:130(番号のみが必要) *フィールドが必要です
「Products_Quantity」=&gt; $ _get [&#39; products_quantity1&#39;] //例:1(番号のみが必要です) *フィールドが必要です
);$ data = array( "products" =&gt; $ data_products // * field required
);$ data_string = json_encode($ date);
$ ch = curl_init($ url);
curl_setopt($ ch、curlopt_customrequest、 "post");
curl_setopt($ ch、curlopt_postfields、$ data_string);
curl_setopt($ ch、curlopt_returntransfer、true);
curl_setopt($ ch、curlopt_ssl_verifypeer、false);
curl_setopt($ ch、curlopt_httpheader、array(
&#39; content-type:application/json&#39;、
「キャッシュコントロール:キャッシュなし」、
&#39;トークン:&#39; 。 base64_encode($ token)、
&#39;秘密:&#39; 。 base64_encode($ secret)、
&#39;電子メール:&#39; 。 base64_encode($ email)、
&#39;コンテンツレングス:&#39; 。 strlen($ data_string)))
);$ result = curl_exec($ ch);
curl_close($ ch);print_r($ result);
// sumple payment_method eof
返品:
id
テキスト< /p>