目次一覧
状態:回答待
閲覧数:552
投稿日:2019-04-16
更新日:2019-04-16
質問履歴34 / 質問した後に気が付いたこと
質問履歴34 / 質問した後に気が付いたこと
質問履歴34
I could create a Stripe account with the code below, but where can I find the code for this create method?
・2019/4/16
I could create a Stripe account with the code below, but where can I find the code for this create method?
・Stripe API
I tried to check the code of the Account object's create method, but I did not find it.
・Where is it?
・There is a similarly named createExternalAccount method, but I have not called this method name.
・GitHub stripe-php/lib/Account.php
\Stripe\Stripe::setApiKey("sk_test_xxxx");
$result = \Stripe\Account::create([
"type" => "custom",
"country" => "US",
"email" => "bob@example.com",
]);
・Stripe API
I tried to check the code of the Account object's create method, but I did not find it.
・Where is it?
・There is a similarly named createExternalAccount method, but I have not called this method name.
・GitHub stripe-php/lib/Account.php
私は下記コードでStripeアカウントを作成できたのですが、しかし、このcreateメソッドのコードはどこで確認できますか?
・Stripe API
Accountオブジェクトのcreateメソッドのコードを確認しようと思って探したのですが、見つかりません。
・どこにあるのですか?
・似た名前のcreateExternalAccountメソッドはありますが、このメソッド名を私は呼び出していません。
・GitHub stripe-php/lib/Account.php
\Stripe\Stripe::setApiKey("sk_test_xxxx");
$result = \Stripe\Account::create([
"type" => "custom",
"country" => "US",
"email" => "bob@example.com",
]);
・Stripe API
Accountオブジェクトのcreateメソッドのコードを確認しようと思って探したのですが、見つかりません。
・どこにあるのですか?
・似た名前のcreateExternalAccountメソッドはありますが、このメソッド名を私は呼び出していません。
・GitHub stripe-php/lib/Account.php
・I could create a Stripe account with the code below, but where can I find the code for this create method?
質問した後に気が付いたこと
Accountクラスのcreateメソッド呼出
→ Createトレイトのcreateメソッドが実行されている
▼/lib/Account.php
class Account extends ApiResource
{
const OBJECT_NAME = "account";
use ApiOperations\All;
use ApiOperations\Create;
//中略
}
▼/lib/ApiOperations/Create.php
namespace Stripe\ApiOperations;
/**
* Trait for creatable resources. Adds a `create()` static method to the class.
*
* This trait should only be applied to classes that derive from StripeObject.
*/
trait Create
{
/**
* @param array|null $params
* @param array|string|null $options
*
* @return \Stripe\ApiResource The created resource.
*/
public static function create($params = null, $options = null)
{
self::_validateParams($params);
$url = static::classUrl();
list($response, $opts) = static::_staticRequest('post', $url, $params, $options);
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
$obj->setLastResponse($response);
return $obj;
}
}
・Stripeにおけるトレイト使用例
Stripe Q33。CustomerオブジェクトのcreateSourceメソッドのAPIドキュメントについて
Stripe Q35。「Payment Intents API」で、3Dセキュアなどの認証手順を(顧客が)使用しないことは出来ますか?