Cardオブジェクト / \Stripe\Chargeオブジェクト / \Stripe\Productオブジェクト

「決済」及び「開発」関連用語集

カテゴリー: Stripe  閲覧数:254 配信日:2019-02-14 11:17


Cardオブジェクト


Stripeオブジェクトと継承関係がない
・他とは異なり、このオブジェクトだけは「Stripeオブジェクト」と継承関係がない
→ 他とは異なり、createメソッドがない
→ 他とは異なり、deleteメソッドがない

階層
・Customerオブジェクトのsourcesプロパティ内にあるdataプロパティ内にリスト構造化されて配置される仕様

Link
Stripe API Reference
stripe-php/Card.php

既存Customerオブジェクトに"source"パラメータとして、トークンID(tok_xxxx)を追加
\Stripe\Stripe::setApiKey("sk_test_xxxx");

$customer = \Stripe\Customer::retrieve("cus_EiZRT8YsFHonSq");
$customer->sources->create(["source" => "tok_mastercard"]);



(新規作成直後の)既存Customerオブジェクトに"source"パラメータとして、ソースID(src_xxxx)を追加
\Stripe\Stripe::setApiKey("sk_test_xxxx");

$customer1 = \Stripe\Customer::create([
   "description" => "Customer 「Stripe.js and Elements」→ ソースID(src_xxxx)指定。4.既存Customerオブジェクトに'source'パラメータとして、ソースID(src_xxxx)を追加",
   'email' => '20190316@example.com',
]);

$customer = \Stripe\Customer::retrieve($customer1->id);
$sourceObj = $customer->sources->create(["source" => $sourceId]);


新規Customerオブジェクト作成時に'source'パラメータとして、ソースID(src_xxxx)を指定
\Stripe\Stripe::setApiKey("sk_xxxx");

$customer = \Stripe\Customer::create([
   "description" => "Customer 「Stripe.js and Elements」→ ソースID(src_xxxx)指定。3.新規Customerオブジェクト作成時に'source'パラメータとして、ソースID(src_xxxx)を指定",
   'email' => '20190316@example.com',
   'source' => $sourceId,
]);


\Stripe\Chargeオブジェクト


create()メソッド
\Stripe\Stripe::setApiKey("sk_test_●●");

\Stripe\Charge::create([
 "amount" => 2000,
 "currency" => "jpy",
 "source" => "tok_visa", // obtained with Stripe.js
 "description" => "Charge for jenny.rosen@example.com"
]);


\Stripe\Productオブジェクト


製品やサービス
・その配下に料金や通貨などが異なる Plan を複数紐付けることができる

一つの Product へ対して出来ること
・複数の料金プランを持つことができる
・毎月、毎年など異なる請求間隔プランを持つことができる。月額500円のプラン。年額5,000円のプラン
・複数の通貨プランを持つことができる。日本円の料金プラン。USドルの料金プラン。ユーロの料金プラン

create()メソッド
・次のコードは、'type'が'good'タイプのProductを作成する方法を示している
\Stripe\Stripe::setApiKey("sk_test_●●");

\Stripe\Product::create([
 "name" => 'T-shirt',
 "type" => "good",
 "description" => "Comfortable cotton t-shirt",
 "attributes" => ["size", "gender"]
]);


・次のコードは、'type'が'service'タイプのProductを作成する方法を示している
\Stripe\Stripe::setApiKey("'sk_test_●●");

$product = \Stripe\Product::create([
   'name' => 'My SaaS Platform',
   'type' => 'service',
]);

Managing Plans

指定期間人気ページランキング / 2020-5-28 → 2023-4-1
順位 ページタイトル抜粋 アクセス数
1 Stripeアカウントへログインする際、モバイル端末で受信したコード入力を求められる理由は? | その他エントリー(Stripe) 1947
2 Stripe Q13。決済成功時に、「請求に紐づけられたメールアドレス」に対して、メール送信したいのですが、 | QA(Stripe) 897
3 EMVCo | クレジットカード仕様(仕様) 834
4 Stripe Q16。PaymentIntentの支払いで郵便番号入力を求められる。Radar rules の ZIP code を無効にしているのに | QA(Stripe) 816
5 Stripe Q50。 Connect 「Standardアカウント」で、自身に連結された子アカウントを、ダッシュボードから削除するには? | QA(Stripe) 788
6 Stripe Q31。ダッシュボードでの「支払い作成」の見方について | QA(Stripe) 671
7 決済用語 573
8 Stripe Q1。Stripeにおける個人事業主の定義 | QA(Stripe) 534
9 クレジットカード決済 | 課金 505
10 Stripeで"No such token: src"と表示されたら、最初にAPIキーを確認する | Stripe エラー(Stripe) 484
11 「Gumroad」は、決済サービス「PayPal」を利用したオンラインコンテンツ販売サービス | デジタルコンテンツ販売可能なサービス(課金販売できるプラットフォーム) 421
12 ファンティア | クリエイター支援プラットフォーム(課金販売できるプラットフォーム) 381
13 Stripe Payments > PREPARING FOR SCA > Payment Intents | documentation(Stripe) 373
13 EMVレベル1 / EMVレベル2 / EMVCo とは? 373
14 Stripe webhook 配信の問題 | その他エントリー(Stripe) 367
15 Stripe エラー(Stripe) カテゴリー 352
16 documentation(Stripe) カテゴリー 349
17 Stripe Q11。テストAPIで、実際のカード番号を入力したらどうなりますか? | QA(Stripe) 339
18 Stripe Q15。PaymentIntent でエラー。カード番号に不備があります。 | QA(Stripe) 336
19 プリペイドカード | カード 334
2023/4/2 1:01 更新