\Stripe\PaymentIntentオブジェクト / Stripe\PaymentMethodオブジェクト / \Stripe\Checkout\Sessionオブジェクト

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

カテゴリー: Stripe  閲覧数:314 配信日:2019-03-18 09:43


\Stripe\PaymentIntentオブジェクト


顧客から支払いを集めるというあなたの意図を表し、各段階を通して支払いプロセスのライフサイクルを追跡するオブジェクト

チェックアウトフローの開始時に PaymentIntent を作成すると
・「注文に対する支払いの試行」をすべて追跡できる

create()メソッド
// Set your secret key: remember to change this to your live secret key in production
// See your keys here: https://dashboard.stripe.com/account/apikeys
\Stripe\Stripe::setApiKey("sk_test_●●");

$paymentintent = \Stripe\PaymentIntent::create([
 "amount" => 1099,
 "currency" => "eur",
 "payment_method_types" => ["card"],
]);


Stripe\PaymentMethodオブジェクト


顧客の支払い方法を表す
・PaymentIntentsと共に支払いを収集するために使用することも、将来の支払いのために商品の詳細を保存するためにCustomerオブジェクトに保存することもできる

create()メソッド
・非推奨
・サーバで直接createメソッド実行するのではなく、「Stripe.js、Stripeモバイルバインディング、Stripe Checkout」の何れかを介した方が(一般的には)良い
// Set your secret key: remember to change this to your live secret key in production
// See your keys here: https://dashboard.stripe.com/account/apikeys
\Stripe\Stripe::setApiKey("sk_test_xxxx");

$paymentMethod = \Stripe\PaymentMethod::create([
 'type' => 'card',
 'card' => [
   'number' => '4000003920000003',
   'exp_month' => 4,
   'exp_year' => 2020,
   'cvc' => '314'
 ]
]);


stripe.createPaymentMethod(type, element[, data])
// Set your secret key: remember to change this to your live secret key in production
// See your keys here: https://dashboard.stripe.com/account/apikeys
\Stripe\Stripe::setApiKey("sk_test_xxxx");

$paymentintent = \Stripe\PaymentIntent::create([
// "amount" => 1099,
"currency" => "jpy",
// "payment_method_types" => ["card"],
]);
?>


<input id="cardholder-name" type="text">
<!-- placeholder for Elements -->
<div id="card-element"></div>
<button id="card-button" data-secret="<?php echo $paymentintent->client_secret; ?>">
Submit Payment
</button>

<script src="https://js.stripe.com/v3/"></script>
<script>
const stripe = Stripe('pk_test_sodaTzCycoslfNFDdujc9U5r');

const elements = stripe.elements();
const cardElement = elements.create('card');
cardElement.mount('#card-element');

const cardholderName = document.getElementById('cardholder-name');
const cardButton = document.getElementById('card-button');
const clientSecret = cardButton.dataset.secret;

cardButton.addEventListener('click', async (ev) => {
// const {paymentIntent, error} = await stripe.handleCardPayment(
// clientSecret, cardElement, {
// payment_method_data: {
// billing_details: {name: cardholderName.value}
// }
// }
// );
const {paymentMethod, error} = await stripe.createPaymentMethod('card', cardElement, {
billing_details: {
name: cardholderName.value,
},
});

if (error) {
// Display error.message in your UI.
console.log(error)
} else {
// The payment has succeeded. Display a success message.
console.log("成功")
console.log(paymentMethod.id)
console.log(paymentMethod)
}
});
</script>



\Stripe\Checkout\Sessionオブジェクト


checkout.session.completed Webhookに含まれている

週間人気ページランキング / 4-18 → 4-24
順位 ページタイトル抜粋 アクセス数
1 YouTube | 動画サービス(課金販売できるプラットフォーム) 8
2 EMVレベル1 / EMVレベル2 / EMVCo とは? 6
3 EMVCo | クレジットカード仕様(仕様) 5
4 クレジットカード決済 | 課金 3
4 pixivFANBOX | クリエイター支援プラットフォーム(課金販売できるプラットフォーム) 3
5 Stripe webhook 配信の問題 / 実際に受け取った警告メールの受信例 2
5 Stripe Q73.CheckoutのSessionオブジェクトをcreateする際、'payment_intent_data'内の'metadata'として渡したデータを、webhookで受け取る件について | QA(Stripe) 2
5 Stripe Q55.Checkout\Session::createする際の、'client_reference_id'パラメータと'payment_intent_data.metadata'パラメータの違いについて | QA(Stripe) 2
5 ログイン 2
5 Stripeアカウントへログインする際、モバイル端末で受信したコード入力を求められる理由は? | その他エントリー(Stripe) 2
5 Off-session Payments with Payment Intents / Payment Intents を使用したオフセッション支払 2
5 Stripe Q32。Webhook のエンドポイントから適切な値を返さなかったときの停止措置について | QA(Stripe) 2
5 Stripe Q16。PaymentIntentの支払いで郵便番号入力を求められる。Radar rules の ZIP code を無効にしているのに | QA(Stripe) 2
5 プリペイドカード | カード 2
5 Squareは、デジタルコンテンツ(デジタル情報)の配信利用が認められないサービス | 「支払」機能を有する決済系サービス(決済サービス) 2
6 Twitchとは?/ Cheeringとは?/ Cheerとは? 1
6 ほしい物リスト | 投げ銭サービス(課金販売できるプラットフォーム) 1
6 Omise | 「支払」機能を有する決済系サービス(決済サービス) 1
6 決済用語 1
6 振込 | 送金 1
2024/4/25 1:02 更新
指定期間人気ページランキング / 2020-5-28 → 2024-4-24
順位 ページタイトル抜粋 アクセス数
1 Stripeアカウントへログインする際、モバイル端末で受信したコード入力を求められる理由は? | その他エントリー(Stripe) 2010
2 EMVCo | クレジットカード仕様(仕様) 1267
3 Stripe Q13。決済成功時に、「請求に紐づけられたメールアドレス」に対して、メール送信したいのですが、 | QA(Stripe) 943
4 Stripe Q16。PaymentIntentの支払いで郵便番号入力を求められる。Radar rules の ZIP code を無効にしているのに | QA(Stripe) 901
5 クレジットカード決済 | 課金 879
6 Twitch | ゲーム実況配信サービス(課金販売できるプラットフォーム) 876
7 決済用語 855
8 Stripe Q50。 Connect 「Standardアカウント」で、自身に連結された子アカウントを、ダッシュボードから削除するには? | QA(Stripe) 824
9 Omise | 「支払」機能を有する決済系サービス(決済サービス) 767
10 Stripe Q1。Stripeにおける個人事業主の定義 | QA(Stripe) 761
11 pixivFANBOX | クリエイター支援プラットフォーム(課金販売できるプラットフォーム) 741
12 Stripe Q31。ダッシュボードでの「支払い作成」の見方について | QA(Stripe) 738
13 EMVレベル1 / EMVレベル2 / EMVCo とは? 727
14 YouTube | 動画サービス(課金販売できるプラットフォーム) 670
15 プリペイドカード | カード 645
16 EPUB | ファイルフォーマット(電子書籍) 587
17 サブスクリプション | 課金 563
18 Stripeで"No such token: src"と表示されたら、最初にAPIキーを確認する | Stripe エラー(Stripe) 544
19 Stripe Q74.「お客様のビジネスの詳細」とは何ですか? | Stripe 542
20 ファンティア | クリエイター支援プラットフォーム(課金販売できるプラットフォーム) 482
2024/4/25 1:02 更新