カテゴリー:
Stripe
閲覧数:289 配信日:2019-03-07 11:01
\Stripe\Planオブジェクト
create()メソッド
・ 'product'パラメータ値として「サービス製品の作成に使用されるフィールド、を含む辞書型データ」を指定
\Stripe\Stripe::setApiKey("sk_test_●●");
\Stripe\Plan::create([
"amount" => 5000,
"interval" => "month",
"product" => [
"name" => "Gold special"
],
"currency" => "jpy",
"id" => "gold-special"
]);
・Managing Plans
・ 'product'パラメータ値として「既存の製品のID」を指定
\Stripe\Stripe::setApiKey("sk_test_●●");
$plan = \Stripe\Plan::create([
'currency' => 'usd',
'interval' => 'month',
'product' => 'prod_CHxGUqw1dyKsDM',
'nickname' => 'Pro Plan',
'amount' => 3000,
]);
\Stripe\Customerオブジェクト
create()メソッド
\Stripe\Stripe::setApiKey("'sk_test_●●");
\Stripe\Customer::create([
"description" => "Customer for jenny.rosen@example.com",
"source" => "tok_mastercard" // obtained with Stripe.js
]);
\Stripe\Subscriptionオブジェクト
create()メソッド
\Stripe\Stripe::setApiKey("sk_test_●●");
\Stripe\Subscription::create([
"customer" => "cus_EWcle5LgHORJY6",
"items" => [
[
"plan" => "sample-monthly",
],
]
]);