コンテンツにスキップ
アカウントを作成
または
サインイン
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 methodsWalletsMobilePay

注

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

MobilePay での支払い

デンマークとフィンランドで一般的な支払い方法として使われている MobilePay を受け付ける方法をご紹介します。

MobilePay is a single-use card wallet payment method used in Denmark and Finland. It allows your customer to authenticate and approve payments using the MobilePay app.

When your customer pays with MobilePay, Stripe performs a card transaction using the card data we receive from MobilePay. The processing of the card transaction is invisible to your integration, and Stripe immediately notifies you whether the payment succeeded or failed.

Stripe recommends using the Mobile Payment Element, an embeddable payment form, to add MobilePay and other payment methods to your integration with the least amount of effort.

This guide covers how to accept MobilePay from your native mobile application using your own custom payment form. Your native mobile application redirects your customer to the MobilePay mobile application to complete the payment. Completing the purchase requires no additional action in the MobilePay mobile application.

Stripe を設定する
サーバ側
クライアント側

まず、Stripe アカウントが必要です。今すぐ登録してください。

サーバ側

この組み込みには、サーバ上に Stripe API と通信するエンドポイントが必要です。サーバから 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'

クライアント側

Stripe Android SDK はオープンソースであり、詳細なドキュメントが提供されています。

To install the SDK, add stripe-android to the dependencies block of your app/build.gradle file:

build.gradle.kts
Kotlin
plugins { id("com.android.application") } android { ... } dependencies { // ... // Stripe Android SDK implementation("com.stripe:stripe-android:21.18.0") // Include the financial connections SDK to support US bank account as a payment method implementation("com.stripe:financial-connections:21.18.0") }

注

SDK の最新リリースおよび過去バージョンの詳細については、GitHub の Releases ページをご覧ください。新しいリリースの公開時に通知を受け取るには、リポジトリのリリースを確認してください。

Stripe の公開可能キーを使用して SDK を設定し、 Application サブクラスなどで、Stripe API へのリクエストを実行できるようにします。

Kotlin
import com.stripe.android.PaymentConfiguration class MyApp : Application() { override fun onCreate() { super.onCreate() PaymentConfiguration.init( applicationContext,
"pk_test_TYooMQauvdEDq54NiTphI7jx"
) } }

注

Use your test keys while you test and develop, and your live mode keys when you publish your app.

Stripe サンプルでは、サーバへの HTTP リクエストの作成に、OkHttp および GSON も使用します。

PaymentIntent を作成する
サーバー側
クライアント側

サーバー側

A PaymentIntent is an object that represents your intent to collect payment from a customer and tracks the lifecycle of the payment process through each stage.

サーバーで PaymentIntent を作成して確定するには、以下のようにします。

  • Specify the amount to collect and a supported currency (eur, dkk, sek, or nok).
  • Add mobilepay to the list of payment method types. Make sure that you enable MobilePay in the Dashboard.
  • payment_method_data[type] を mobilepay に設定すると、PaymentMethod を作成して、PaymentIntent ですぐに使用できます。
Command Line
cURL
curl https://api.stripe.com/v1/payment_intents \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d amount=1099 \ -d currency=dkk \ -d "payment_method_types[]"=mobilepay \ -d "payment_method_data[type]"=mobilepay

The PaymentIntent includes a client secret. Send the client secret to the client to confirm the PaymentIntent in the next step.

クライアント側

On the client, request a PaymentIntent from your server and store its client secret.

CheckoutActivity.kt
Kotlin
サンプル全体を表示
class CheckoutActivity : AppCompatActivity() { private lateinit var paymentIntentClientSecret: String override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) // ... startCheckout() } private fun startCheckout() { // Request a PaymentIntent from your server and store its client secret in paymentIntentClientSecret // Click View full sample to see a complete implementation } }

Stripe に支払いを送信する
クライアント側

When a customer taps to pay with MobilePay, confirm the PaymentIntent to complete the payment. Configure a ConfirmPaymentIntentParams object with the PaymentIntent client secret.

client secret は、Stripe API リクエストを認証する API キーとは異なります。このデバイスは支払いを完了できるため、慎重に扱う必要があります。記録したり、URL に埋め込んだり、当該の顧客以外に漏洩することがないようにしてください。

支払いを確定する

Use the PaymentIntent client secret from step 2 to confirm the PaymentIntent using PaymentLauncher confirm. This opens the MobilePay application directly (if present) or a webview showing the MobilePay landing page. After the customer authorizes the payment, onPaymentResult contains the status of the payment.

Kotlin
class CheckoutActivity : AppCompatActivity() { // ... private lateinit var paymentIntentClientSecret: String private val paymentLauncher: PaymentLauncher by lazy { PaymentLauncher.create( this, PaymentConfiguration.getInstance(applicationContext).publishableKey, PaymentConfiguration.getInstance(applicationContext).stripeAccountId, ::onPaymentResult ) } private fun startCheckout() { // ... val confirmParams = ConfirmPaymentIntentParams .createWithPaymentMethodCreateParams( paymentMethodCreateParams = PaymentMethodCreateParams.createMobilePay(), clientSecret = paymentIntentClientSecret ) paymentLauncher.confirm(confirmParams) } private fun onPaymentResult(paymentResult: PaymentResult) { val message = when (paymentResult) { is PaymentResult.Completed -> { "Completed!" } is PaymentResult.Canceled -> { "Canceled!" } is PaymentResult.Failed -> { // This string comes from the PaymentIntent's error message. // See: https://docs.stripe.com/api/payment_intents/object#payment_intent_object-last_payment_error-message "Failed: " + paymentResult.throwable.message } } } }

Your customer has 5 minutes to authorize the payment in the MobilePay app. If the underlying card charge fails, your customer can choose a different card and retry in the MobilePay app.

Handle post-payment events

支払いが完了すると、Stripe は payment_intent.succeeded イベントを送信します。ダッシュボード、カスタム Webhook、またはパートナーソリューションを使用してこれらのイベントを受信し、また、顧客への注文確認メールの送信、データベースでの売上の記録、配送ワークフローの開始などのアクションを実行します。

クライアントからのコールバックを待つのではなく、これらのイベントをリッスンします。クライアント側では、コールバックが実行される前に顧客がブラウザーのウィンドウを閉じたり、アプリを終了したりする可能性があります。また、悪意を持つクライアントがレスポンスを不正操作する恐れもあります。非同期型のイベントをリッスンするよう構築済みのシステムを設定することで、これ以降はより多くの決済手段を簡単に受け付けられるようになります。サポートされているすべての決済手段の違いをご確認ください。

手動

Stripe ダッシュボードは、すべての Stripe 支払いの確認、メールでの領収書の送信、入金処理、または失敗した支払いの再試行に使用できます。

  • ダッシュボードでテスト支払いを確認する

カスタムコード

Webhook ハンドラを作成してイベントをリッスンし、カスタムの非同期決済フローを作成します。Stripe CLI を使用し、ローカルで Webhook 組み込みのテストとデバッグを行います。

  • カスタム Webhook を作成する

事前構築のアプリ

オートメーションやマーケティングとセールスなどの一般的なビジネスイベントを、パートナーアプリケーションとの連携によって処理します。

Test the integration

Use your test API keys to create a PaymentIntent. After confirming the PaymentIntent, follow the next_action redirect URL to a test page with options to authorize or fail the payment.

  • Click Authorize test payment to test the case when the payment is successful. The PaymentIntent’s status transitions from requires_action to succeeded.
  • Click Fail test payment to test the case when the customer fails to authenticate. The PaymentIntent’s status transitions from requires_action to requires_payment_method.

オプションCancellation

失敗した支払い

MobilePay transactions can fail if the underlying card transaction is declined. Learn more about card declines. In this case, the PaymentMethod is detached and the PaymentIntent’s status automatically transitions to requires_payment_method.

When the PaymentIntent’s status is requires_action, your customer must authenticate the payment within 5 minutes. If no action is taken after 5 minutes, the PaymentMethod detaches and the PaymentIntent’s status automatically transitions to requires_payment_method.

返金と不審請求の申請

Stripe performs a card transaction using standard card rails as part of a MobilePay transaction. Refunds and disputes are subject to the Visa and Mastercard network rules.

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