コンテンツにスキップ
アカウントを作成
または
サインイン
Stripe ドキュメントのロゴ
/
AI に質問する
アカウントを作成
サインイン
始める
支払い
売上
プラットフォームおよびマーケットプレイス
資金管理
開発者向けのツール
概要
Stripe Payments について
構築済みのシステムをアップグレード
支払いの分析
オンライン決済
概要ユースケースを見つけるManaged Payments
Payment Links を使用する
決済ページを構築
高度なシステムを構築
アプリ内実装を構築
決済手段
決済手段を追加
    概要
    支払い方法の導入オプション
    ダッシュボードで支払い方法を管理
    決済手段のタイプ
    カード
    Stripe 残高で支払う
    仮想通貨
    銀行口座引き落とし
    銀行へのリダイレクト
    銀行振込
    クレジットトランスファー (Sources)
    後払い
    リアルタイム決済
    店舗支払い
      Boleto
        決済を受け付ける
        サブスクリプションで Boleto を使用する
        請求書で Boleto を使用する
      コンビニ決済
      Multibanco
      OXXO
    ウォレット
    国ごとに現地の支払い方法を有効化
    カスタムの決済手段
決済手段を管理
Link による購入の迅速化
支払いインターフェイス
Payment Links
Checkout
Web Elements
アプリ内 Elements
決済シナリオ
カスタムの決済フロー
柔軟なアクワイアリング
オーケストレーション
店頭支払い
端末
他の Stripe プロダクト
Financial Connections
仮想通貨
Climate
ホーム支払いAdd payment methodsVouchersBoleto

注

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

Boleto 支払い

ブラジルで一般的な支払い方法である Boleto を受け付ける方法をご紹介します。

ページをコピー

ブラジルの Stripe ユーザーは、Payment Intents API および Payment Methods API を使用して、ブラジルの顧客から Boleto での支払いを受け付けることができます。顧客は ATM、銀行、オンラインバンクポータル、または公認の代理店のいずれかで、生成された番号が記載された Boleto の支払い票を使用して支払います。

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'

PaymentIntent を作成する
サーバ側

Stripe uses a PaymentIntent object to represent your intent to collect payment from a customer, tracking state changes from Boleto voucher creation to payment completion.

Create a PaymentIntent on your server with an amount and the brl currency (Boleto does not support other currencies). If you already have an integration using the Payment Intents API, add boleto to the list of payment method types for your PaymentIntent.

Included in the returned PaymentIntent is a client secret, which you have to use to securely complete the payment process. Send the client secret back to the client so you can use it in later steps.

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

その他の支払い方法オプション

You can specify an optional expires_after_days parameter in the payment method options for your PaymentIntent that sets the number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto voucher will expire on Wednesday at 23:59 America/Sao_Paulo (UTC-3) time. If you set it to 0, the Boleto voucher will expire at the end of the day. The expires_after_days parameter can be set from 0 to 60 days. The default is 3 days. You can customize the default expiration days on your account in the Payment methods settings

支払い方法の詳細を収集する
クライアント側

クライアントで支払いフォームを作成し、必要な請求先情報を顧客から収集します。

フィールド値
name顧客の氏名。
email顧客のメールアドレス。
tax_id顧客の CPF (個人の場合) または CNPJ (ビジネスの場合)。CPF は 11 桁で、000.000.000-00 または 00000000000 の形式にする必要があります。CNPJ は 14 桁で、00.000.000/0000-00 または 00000000000000 の形式にする必要があります。
address顧客の住所の町名と番地。
city顧客の住所の市区町村。
state顧客住所のブラジルの 2 文字の州 コード (ISO_3166-2:BR)。
postal_code顧客住所の郵便番号。郵便番号の形式は、XXXXX-XXX または XXXXXXXX にする必要があります。

注

name、address、city のフィールドには、基本ラテン文字 (ASCII) ユニコードブロックの英数字を 1 文字以上含める必要があります。

checkout.html
<form id="payment-form"> <div class="form-row"> <label for="name"> Name </label> <input id="name" name="name" required> </div> <div class="form-row"> <label for="tax_id"> CPF/CNPJ </label> <input id="tax_id" name="tax_id" required> </div> <div class="form-row"> <label for="email"> Email </label> <input id="email" name="email" required> </div> <div class="form-row"> <label for="address"> Address </label> <input id="address" name="address" required> </div> <div class="form-row"> <label for="city"> City </label> <input id="city" name="city" required> </div> <div class="form-row"> <label for="state"> State </label> <input id="state" name="state" required> </div> <div class="form-row"> <label for="postal_code"> Postal Code </label> <input id="postal_code" name="postal_code" required> </div> <!-- Used to display form errors. --> <div id="error-message" role="alert"></div> <button id="submit-button">Pay with Boleto</button> </form>

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

When a customer clicks to pay with Boleto, use Stripe.js to submit the payment to Stripe. Stripe.js is our foundational JavaScript library for building payment flows.

Stripe.js スクリプトを決済ページに含めるには、このスクリプトを HTML ファイルの head に追加します。

checkout.html
<head> <title>Checkout</title> <script src="https://js.stripe.com/v3/"></script> </head>

決済ページで以下の JavaScript を使用して、Stripe.js のインスタンスを作成します。

client.js
// Set your publishable key. Remember to switch to your live publishable key in production! // See your keys here: https://dashboard.stripe.com/apikeys const stripe = Stripe(
'pk_test_TYooMQauvdEDq54NiTphI7jx'
);

Use stripe.confirmBoletoPayment and the client secret of the PaymentIntent object that you created in Step 2 to submit the customer’s billing details.

確定されると、Stripe はモーダルを自動的に開き、顧客に Boleto の取引詳細を表示します。

client.js
var form = document.getElementById('payment-form'); form.addEventListener('submit', async (event) => { event.preventDefault(); const result = await stripe.confirmBoletoPayment( '{{PAYMENT_INTENT_CLIENT_SECRET}}', { payment_method: { boleto: { tax_id: document.getElementById('tax_id').value, }, billing_details: { name: document.getElementById('name').value, email: document.getElementById('email').value, address: { line1: document.getElementById('address').value, city: document.getElementById('city').value, state: document.getElementById('state').value, postal_code: document.getElementById('postal_code').value, country: 'BR', }, }, }, } ); // Stripe.js will open a modal to display the Boleto voucher to your customer // This async function finishes when the customer closes the modal if (result.error) { // Display error to your customer const errorMsg = document.getElementById('error-message'); errorMsg.innerText = result.error.message; } });

注

stripe.confirmBoletoPayment の完了には数秒かかる場合があります。この間、フォームが再送信されないように無効化し、スピナーのような待機中のインジケータを表示します。エラーが発生した場合は、それを顧客に表示し、フォームを再度有効化し、待機中のインジケータを非表示にします。

Boleto の取引の詳細が正常に作成されると、返された PaymentIntent の status プロパティの値が requires_action になります。ダッシュボードまたはオブジェクトのステータスプロパティを調べて、PaymentIntent のステータスを確認します。Boleto の取引の詳細が正常に作成されなかった場合は、返された error を調べて原因を特定します (メールアドレス形式が無効であるなど)。

オプション: 顧客に取引の詳細へのリンクをメールで送信する

Stripe sends a payment_intent.requires_action event when a Boleto voucher is created successfully. If you need to email your customers the voucher link, you can locate the hosted_voucher_url in payment_intent.next_action.boleto_display_details.

オプション: 取引の詳細をカスタマイズする

Stripe では、ブランディング設定ページで、顧客に表示される UI をカスタマイズできます。

取引の詳細には、以下のブランド設定を適用できます。

  • アイコン: ブランド画像と公開ビジネス名
  • アクセント— 番号コピーボタンのカラーとして使用されます
  • ブランドカラー: 背景色として使用されます

支払い後のイベントを処理する
サーバ側

Boleto による支払いは非同期型であるため、売上はすぐには利用可能になりません。決済後、顧客が直ちに Boleto の支払いを行わないことがあります。

Stripe sends a payment_intent.succeeded event on the next business day (Monday through Friday excluding Brazilian holidays) for each Boleto voucher that was paid. Use the Dashboard or a custom webhook to receive these events and run actions (for example, sending an order confirmation email to your customer, logging the sale in a database, or starting a shipping workflow).

If a Boleto voucher is not paid before 23:59 America/Sao_Paulo (UTC-3) on the expiry date, Stripe sends a payment_intent.payment_failed event after 1 business day. For example, if a Boleto voucher expires on Thursday, the event is sent on Friday. If a Boleto voucher expires on Friday, the event is sent the following Monday.

イベント説明次のステップ
payment_intent.succeeded顧客が有効期限前に Boleto の支払いを行いました。顧客が購入した商品またはサービスのフルフィルメントを行います。
payment_intent.payment_failed顧客が有効期限までに Boleto の支払いを行いませんでした。Contact the customer through email or push notification and request another payment method.

組み込みをテストする

In a sandbox, set payment_method.billing_details.email to the following values when you call stripe.confirmBoletoPayment to test different scenarios.

メールアドレス説明

{any_prefix}@{any_domain}

顧客が 3 分後に支払い、約 3 分後に payment_intent.succeeded Webhook を受信する Boleto の支払いをシミュレーションします。本番環境では、1 営業日後にこの Webhook が届きます。

例: fulaninho@example.com

{any_prefix}succeed_immediately@{any_domain}

顧客が即座に支払い、数秒以内に payment_intent.succeeded Webhook を受信する Boleto の支払い方法をシミュレーションします。本番環境では、1 営業日後にこの Webhook が届きます。

例: succeed_immediately@example.com

{any_prefix}expire_immediately@{any_domain}

顧客が支払う前に期限切れになり、数秒以内に payment_intent.payment_failed Webhook を受信する Boleto の支払いをシミュレーションします。

The expires_at field in next_action.boleto_display_details is set to the current time regardless of what the expires_after_days parameter in payment method options is set to.

例: expire_immediately@example.com

{any_prefix}expire_with_delay@{any_domain}

顧客が支払う前に期限切れになり、約 3 分後に payment_intent.payment_failed Webhook を受信する Boleto の支払いをシミュレーションします。

The expires_at field in next_action.boleto_display_details is set to 3 minutes in the future regardless of what the expires_after_days parameter in payment method options is set to.

例: expire_with_delay@example.com

{any_prefix}fill_never@{any_domain}

Simulates a Boleto voucher which never succeeds; it expires according to the expires_at field in next_action.boleto_display_details per the provided parameters in the payment method options and the payment_intent.payment_failed webhook arrives after that.

例: fill_never@example.com

納税者番号説明

CPF 000.000.000-00

CNPJ 00.000.000/0000-00

In a sandbox, set tax_id to these values, so they bypass the tax ID validation.

オプション独自に取引の詳細ページを構築する
クライアント側

オプションサーバ側で Payment Intent を確定する
サーバ側

オプション支払い手順メールを送信する

有効期限とキャンセル

Boleto バウチャーは expires_at UNIX タイムスタンプを過ぎると期限切れになり、顧客は有効期限が切れた Boleto バウチャーの支払いはできません。有効期限前に Boleto バウチャーをキャンセルすることはできません。

Boleto の有効期限が切れると、PaymentIntent のステータスは requires_payment_method に変わります。この時点では、別の支払い方法を指定して PaymentIntent を確定するか、キャンセルすることができます。

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