コンテンツにスキップ
アカウントを作成
または
サインイン
Stripe ドキュメントのロゴ
/
AI に質問する
アカウントを作成
サインイン
始める
支払い
売上
プラットフォームおよびマーケットプレイス
資金管理
Developer resources
概要
Stripe Payments について
構築済みのシステムをアップグレード
支払いの分析
オンライン決済
概要ユースケースを見つけるManaged Payments
Payment Links を使用する
決済ページを構築
高度なシステムを構築
アプリ内実装を構築
決済手段
決済手段を追加
    概要
    支払い方法の導入オプション
    ダッシュボードで支払い方法を管理
    決済手段のタイプ
    カード
    Stripe 残高で支払う
    仮想通貨
    銀行口座引き落とし
    銀行へのリダイレクト
    銀行振込
    クレジットトランスファー (Sources)
    後払い
    リアルタイム決済
    店舗支払い
    ウォレット
      Alipay
      Amazon Pay
      Apple Pay
      Cash App Pay
      Google Pay
      GrabPay
      Link
      MB WAY
        決済を受け付ける
      MobilePay
      PayPal
      PayPay
      Revolut Pay
      Satispay
      Secure Remote Commerce
      Vipps
      WeChat Pay
    国ごとに現地の支払い方法を有効化
    カスタムの決済手段
決済手段を管理
Link による購入の迅速化
支払いインターフェイス
Payment Links
Checkout
Web Elements
アプリ内 Elements
決済シナリオ
複数の通貨を扱う
カスタムの決済フロー
柔軟なアクワイアリング
オーケストレーション
店頭支払い
端末
Beyond payments
Incorporate your company
仮想通貨
Financial Connections
Climate
ホーム支払いAdd payment methodsWalletsMB WAY

注

このページはまだ日本語ではご利用いただけません。より多くの言語で文書が閲覧できるように現在取り組んでいます。準備が整い次第、翻訳版を提供いたしますので、もう少しお待ちください。

MB WAY 支払い招待のみ

MB WAY の支払い方法を受け付ける手順をご紹介します。

MB WAY is a digital wallet payment method in Portugal. When paying with MB WAY, customers initiate payments using their phone number, and authenticate and approve them using their MB WAY app.

You get immediate notification of whether the payment succeeded or failed.

注

MB WAY supports international phone numbers, but the majority of customers use a Portuguese phone number starting with +351. You can test your integration in a sandbox using test phone numbers.

Stripe を設定する
サーバ側

まず、Stripe アカウントを作成するかサインインします。

アプリケーションから Stripe API にアクセスするには、Stripe の公式ライブラリを使用します。

Command Line
Ruby
# Available as a gem sudo gem install stripe
Gemfile
Ruby
# If you use bundler, you can add this line to your Gemfile gem 'stripe'

Create a PaymentIntent
Server-side

A PaymentIntent is an object that represents your intent to collect a payment from a customer and tracks the payment process. To create a PaymentIntent that accepts a MB WAY payment method, specify the amount to collect, eur as the currency, and mb_way in the payment_method_types list. If you maintain a list of payment method types that you pass when creating a PaymentIntent, add mb_way to it.

Command Line
cURL
curl https://api.stripe.com/v1/payment_intents \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d amount=1000 \ -d currency=eur \ -d "payment_method_types[]"=mb_way

client secret を取得する

PaymentIntent には、client secret が含まれています。これは、支払いプロセスを安全に完了するためにクライアント側で使用されます。client secret をクライアント側に渡す際は、いくつかの方法を使用できます。

ブラウザーの fetch 関数を使用して、サーバーのエンドポイントから client secret を取得します。この方法は、クライアント側が 1 ページのアプリケーションで、特に React などの最新のフロントエンドフレームワークで構築されている場合に最適です。client secret を処理するサーバーのエンドポイントを作成します。

main.rb
Ruby
get '/secret' do intent = # ... Create or retrieve the PaymentIntent {client_secret: intent.client_secret}.to_json end

その後、クライアント側で JavaScript を使用して client secret を取得します。

(async () => { const response = await fetch('/secret'); const {client_secret: clientSecret} = await response.json(); // Render the form using the clientSecret })();

Collect payment method details and submit the payment
Client-side

When you confirm the payment, pass the client secret.

注意

Handle the client secret carefully, because it allows access to the PaymentIntent. Don’t log it, embed it in URLs, or expose it to anyone but the customer.

Use stripe.confirmMbWayPayment to initiate the payment authorization with your customer.

The customer receives a notification about the payment request, and authorizes or declines the request in their MB WAY app.

script.js
// Inititates the payment request notification to the customer stripe.confirmMbWayPayment( '{{PAYMENT_INTENT_CLIENT_SECRET}}', { payment_method: { billing_details: { // Phone number is required for all MB WAY payment phone: '+351911111111' } } } ).then(function(result) { if (result.error) { // Inform the customer that there was an error. console.log(result.error.message); } });

By default, Stripe.js polls for updates to the PaymentIntent. The promise returned by confirmMbWayPayment resolves when the PaymentIntent reaches the succeeded state, or when the payment fails and the PaymentIntent returns to the requires_payment_method state. See the PaymentIntent lifecycle for details on how these transitions happen.

To poll yourself, disable automatic polling by setting handleActions: false:

script.js
stripe.confirmMbWayPayment( '{{PAYMENT_INTENT_CLIENT_SECRET}}', { payment_method: { billing_details: { phone: '+351911111111' } } } { handleActions: false } // <---- Like this )

In this case, call the PaymentIntents API to fetch status of the PaymentIntent yourself.

Test your integration

Test your MB WAY integration by using the following test phone numbers. Each set of details reproduces a common live mode scenario.

Phone number説明
+351911111112The PaymentIntent status transitions from requires_action to succeeded after 15 seconds.
+351911111113The PaymentIntent status transitions from requires_action to requires_payment_method immediately. Stripe returns the payment_method_not_available error code.
+351911111114The PaymentIntent status transitions from requires_action to requires_payment_method immediately. Stripe returns the payment_method_provider_decline error code.
+351911111115The PaymentIntent status transitions from requires_action to requires_payment_method immediately. Stripe returns the payment_intent_payment_attempt_expired error code.
+351911111116The PaymentIntent status transitions from requires_action to requires_payment_method immediately. Stripe returns the payment_method_customer_decline error code.
<any other number>The PaymentIntent status immediately transitions from requires_action to succeeded.

オプションHandle post-payment events

このページはお役に立ちましたか。
はいいいえ
お困りのことがございましたら 、サポートにお問い合わせください。
早期アクセスプログラムにご参加ください。
変更ログをご覧ください。
ご不明な点がございましたら、お問い合わせください。
LLM ですか?llms.txt を読んでください。
Powered by Markdoc