Stripe Q36。What is the difference between “stripe.handleCardPayment (clientSecret)” and “stripe.retrievePaymentIntent (clientSecret)”?

StripeQA

目次一覧

 状態:-  閲覧数:721  投稿日:2019-04-23  更新日:2019-04-24  
質問履歴36 / 質問後に気が付いたこと / A抜粋

感想

質問履歴36 / 質問後に気が付いたこと / A抜粋

 閲覧数:336 投稿日:2019-04-23 更新日:2019-04-24 

質問履歴36


What is the difference between “stripe.handleCardPayment (clientSecret)” and “stripe.retrievePaymentIntent (clientSecret)”?
・2019/4/23
What is the difference below? Please tell me the pros and cons of each.

・stripe.handleCardPayment(clientSecret)
(async () => {
 let {paymentIntent, error} = await stripe.handleCardPayment(clientSecret);
 if (error) {
   // Handle error here
 } else if (paymentIntent && paymentIntent.status === 'succeeded') {
   // Handle successful payment here
 }
})();


・stripe.retrievePaymentIntent(clientSecret)
(async () => {
 let {paymentIntent, error} = await stripe.retrievePaymentIntent(clientSecret);
 if (error) {
   // Handle error here
 } else if (paymentIntent && paymentIntent.status === 'succeeded') {
   // Handle successful payment here
 }
})();


「stripe.handleCardPayment(clientSecret)」と「stripe.retrievePaymentIntent(clientSecret)」の違いは何ですか?
下の違いは何ですか? それぞれの長所と短所を教えてください。

What is the difference between "stripe.handleCardPayment (clientSecret)" and "stripe.retrievePaymentIntent (clientSecret)"?

質問後に気が付いたこと


指定可能な引数の数
・異なる

handleCardPaymentメソッド
・第3引数まで指定可能
stripe.handleCardPayment(clientSecret, cardElement[, data])

Retrieve a PaymentIntent
・第1引数のみ指定可能

恐らく
・第1引数のみ指定した場合の挙動は同じ
→ 誤り。両者の挙動は明確に異なる

両者の違い
・handleCardPaymentメソッドは第3引数まで指定可能なので、handleCardPaymentメソッドの方が出来ることが多い

A抜粋


両者は明確に異なる
・2つの方法で全く異なることをする

handleCardPaymentメソッド
・支払い情報を収集し、ユーザーから支払いを収集しようとするようにStripeに指示し、成功するとPaymentIntentオブジェクトを返す

retrievePaymentIntentメソッド
・支払回収を試行せずにPaymentIntentを再試行する

感想

 閲覧数:288 投稿日:2019-04-24 更新日:2019-04-24 

感想


そもそも公式サイトで確認すべき場所を間違えていた
・公式サイトで確認すべき場所は、「document」と「API」の2つだと思っていたが、「Stripe.js Reference」はそれらとは別にある
・つまり、確認すべき場所は、「document」「API」「Stripe.js Reference」の3つである


Stripe Q35。「Payment Intents API」で、3Dセキュアなどの認証手順を(顧客が)使用しないことは出来ますか?

Stripe Q37。PaymentIntentで支払いを行った後、成功画面を表示させるためにはどうすれば良いですか?

コメント投稿(ログインが必要)



類似度ページランキング
順位 ページタイトル抜粋
1 Stripe Q36。What is the difference between “stripe.handleCardPayment (clientSecret)” and “stripe.retrievePaymentIntent (clientSecret)”? 25
2 Stripe Q38。Difference between “paymentIntent.status === 'succeeded'” and “payment_intent.succeeded event of Webhook” 22
3 Stripe Q25。Why is it an error to use “token_xxxx” not associated with a Customer object for payment? 21
4 Stripe Q9。Checkout beta version で、webhookを受け取ると、client_reference_idがNULL 20
5 Stripe Q60. Checkout\SessionオブジェクトとPaymentIntentオブジェクトの関係性は1対1ですか? 20
6 Stripe Q48。「Checkout\Session - server」「Charge」「PaymentIntent」の使い分け方 20
7 Stripe Q30。Checkout (new) の「Checkout Server Quickstart」の「Step 2: Add Checkout to your website」について 20
8 Stripe Q8。Stripe Checkout public beta version について 20
9 Q63.No signatures found matching the expected signature for payload について 19
10 Stripe Q20。「webhook」と「synchronous」と「Checkout beta version」について 19
11 Stripe Q16。PaymentIntentの支払いで郵便番号入力を求められる。Radar rules の ZIP code を無効にしているのに 19
12 Stripe Q35。「Payment Intents API」で、3Dセキュアなどの認証手順を(顧客が)使用しないことは出来ますか? 19
13 Stripe Q62.Webhook::constructEventで、SignatureVerificationエラーになるのですが… 19
14 Stripe Q46。Direct Charges で手数料聴取する場合、'payment_intent_data'の「有り」「無し」の違いは? 18
15 Stripe Q34。I could create a Stripe account with the code below, but where can I find the code for this create method? 18
16 Purchase Fulfillment 18
17 Stripe Q39。I want to check the processing for the 'success_url' parameter of the 'Checkout \ Session :: create () method' in the Git-Hub code 18
18 Stripe Payments > COLLECTING PAYMENT DETAILS > Checkout 18
19 Stripe Q26。If you only accept credit card payments, are there any functions that can not be done with src_xxxx but only with tok_xxxx? 18
20 Stripe Q33。CustomerオブジェクトのcreateSourceメソッドのAPIドキュメントについて 18
2024/4/27 5:38 更新
週間人気ページランキング / 4-20 → 4-26
順位 ページタイトル抜粋 アクセス数
1 YouTube | 動画サービス(課金販売できるプラットフォーム) 7
1 EMVCo | クレジットカード仕様(仕様) 7
2 EMVレベル1 / EMVレベル2 / EMVCo とは? 5
3 クレジットカード決済 | 課金 4
3 pixivFANBOX | クリエイター支援プラットフォーム(課金販売できるプラットフォーム) 4
4 Squareは、デジタルコンテンツ(デジタル情報)の配信利用が認められないサービス | 「支払」機能を有する決済系サービス(決済サービス) 3
5 Stripe Q32。Webhook のエンドポイントから適切な値を返さなかったときの停止措置について | QA(Stripe) 2
5 「支払」と「送金」の違い | 違い 2
5 Stripe Q16。PaymentIntentの支払いで郵便番号入力を求められる。Radar rules の ZIP code を無効にしているのに | QA(Stripe) 2
5 プリペイドカード | カード 2
5 Stripe Q13。決済成功時に、「請求に紐づけられたメールアドレス」に対して、メール送信したいのですが、 | QA(Stripe) 2
6 Stripe webhook 配信の問題 / 実際に受け取った警告メールの受信例 1
6 Stripe webhook 配信の問題 | その他エントリー(Stripe) 1
6 Stripe。Stripeアカウントを持っていない人でもクレジットカード決済が出来る | その他エントリー(Stripe) 1
6 決済するためのクレジットカード情報をどこに紐づけるか、あるいはどこにも紐づけないか | 決済(Webサービスビジネス) 1
6 「支払、出金」機能を有する決済系サービス比較 1
6 StripeLinkサービス紹介 / 公式Help / サイト内DocLink 1
6 PaymentIntentで支払を実装する場合の選択肢 /「Payment Intents API」使用によるカードの支払確認方法は2種類 / PaymentMethodオブジェクトは歴史的経緯により3種類ある 1
6 ログイン後のナビゲーション選択肢 / URL一覧 / コンテンツの料金設定 1
6 投げ銭サービス(課金販売できるプラットフォーム) カテゴリー 1
2024/4/27 1:02 更新