コンテンツにスキップ
アカウントを作成
または
サインイン
Stripe ドキュメントのロゴ
/
AI に質問する
アカウントを作成
サインイン
始める
支払い
売上
プラットフォームおよびマーケットプレイス
資金管理
開発者向けリソース
概要
バージョン管理
変更ログ
API バージョンのアップグレード
SDK バージョンをアップグレードする
Essentials
SDK
API
テスト
Stripe CLI
サンプルプロジェクト
ツール
ワークベンチ
開発者ダッシュボード
Stripe Shell
Visual Studio Code をご利用の場合
機能
ワークフロー
イベントの送信先
Stripe 健全性アラートファイルのアップロード
AI ソリューション
エージェントツールキット
セキュリティとプライバシー
セキュリティ
プライバシー
Stripe を拡張する
Build Stripe apps
Use apps from Stripe
    概要
    Stripe-built apps
    Adobe Commerce
    Cegid
    Commercetools
    Mirakl
    NetSuite
    Oracle Opera
    PrestaShop
    Salesforce
      Salesforce B2C Commerce
      Stripe for Salesforce Platform アプリ
        AgnosticInvocable のコード
        Class Invocable コード
        設定
        イベントを設定
        Training
        インストール
      Salesforce Billing Extension
      Stripe Billing for Salesforce CPQ
    SAP
    Shopware 6
    Stripe Tax for BigCommerce
    Stripe Tax for WooCommerce
    Partner apps
    Build your own app
パートナー
Partner Ecosystem
パートナー認定
ホーム開発者向けリソースUse apps from StripeSalesforceStripe app for Salesforce Platform

注

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

Stripe app for Salesforce Platform の呼び出し

このガイドではすぐに使用できるコード例を用いて、Stripe の顧客の作成、Checkout セッションの開始、既存の顧客のリッスンといった重要な作業をすべて Salesforce から直接実行する手順を説明します。Salesforce の管理者、開発者、そして Stripe と Salesforce のシームレスな連携に関心をお持ちの方を対象としています。これらの例では、Stripe API コールを使用したクラスベースの呼び出しに、カスタム Apex クラスを用いています。新たな EC ストアソリューションを構築している場合でも、決済ワークフローを構築している場合でも、このガイドは Salesforce での効率的な Stripe 操作に必要なツールを提供します。

Stripe で顧客を作成する

次のコード例では、name、email、metadata を設定して Stripe の顧客を作成します。

// Step 1: Initialize an instance of the stripeGC.v01_CreateCustomers.V1 class stripeGC.CreateCustomers.V1 params = new stripeGC.CreateCustomers.V1(); List<stripeGC.CreateCustomers.V1> paramsCollection = new List<stripeGC.CreateCustomers.V1>{ params }; // Step 2: Set the accountRecordId parameter to the record ID of the Stripe Account you wish to connect to params.accountRecordId = 'a028B0000029RhlQAE'; // Step 3: Set the metadata field stripeGC.Metadata metadata = new stripeGC.Metadata(); metadata.listAdditionalStringField = new List<stripeGC.AdditionalString>{ new stripeGC.AdditionalString('AccountID', 'abc123') }; params.metadata = metadata; // Step 4: Set the name field params.name = 'Tim Smith'; // Step 5: Set the email field params.email = 'example@example.com'; // Step 6: Call the stripeGC.v01_PostCustomers.postCustomers_2022_11_15 method List<stripeGC.Customer> customers = stripeGC.v01_CreateCustomers.createCustomers_2022_11_15(paramsCollection);

Checkout セッションを作成する

次のコード例は Stripe で Checkout セッションを作成します。

// Step 1: Initialize an instance of the stripeGC.v01_CreateCheckoutSessions.V1 class stripeGC.CreateCheckoutSessions.V1 params = new stripeGC.CreateCheckoutSessions.V1(); List<stripeGC.CreateCheckoutSessions.V1> paramsCollection = new List<stripeGC.CreateCheckoutSessions.V1>{ params }; // Step 2: Set the accountRecordId parameter to the record ID of the Stripe Account you wish to connect to params.accountRecordId = 'a028B0000029RhlQAE'; // Step 3: Set the checkout line items stripeGC.CreateCheckoutSessionsReqLineItem cliparams = new stripeGC.CreateCheckoutSessionsReqLineItem(); cliparams.price = 'price_1NhcVkBSPQ8HL343ZNsBp'; //price id from Stripe. cliparams.quantity = 1; List<stripeGC.CreateCheckoutSessionsReqLineItem> cliparamlist = new List<stripeGC.CreateCheckoutSessionsReqLineItem>(); cliparamlist.add(cliparams); params.lineItems = cliparamlist; // Step 4: Set mode,successurl,client ref fields params.mode = 'payment'; params.successUrl = 'https://stripe.com'; params.clientReferenceId = 'abcd123'; // Step 5: Call the stripeGC.v01_CreateCheckoutSessions.CreateCheckoutSessions_2022_11_15 method List<stripeGC.CheckoutSession> results = stripeGC.v01_CreateCheckoutSessions.createCheckoutSessions_2022_11_15(paramsCollection);

顧客をリストに表示する

次のコード例は、Stripe に保存されているすべての顧客をリストに表示します。

// Step 1: Initialize an instance of the stripeGC.v01_ListCustomers.V1 class stripeGC.ListCustomers.V1 params = new stripeGC.ListCustomers.V1(); List<stripeGC.ListCustomers.V1> paramsCollection = new List<stripeGC.ListCustomers.V1>{ params }; // Step 2: Set the accountRecordId parameter to the record ID of the Stripe Account you wish to connect to params.accountRecordId = 'a028B0000029RhlQAE'; // Step 3: Call the stripeGC.v01_ListCustomers.listCustomers_2022_11_15 method List<stripeGC.CustomerResourceCustomerList > results = stripeGC.v01_ListCustomers.listCustomers_2022_11_15(paramsCollection); System.debug(results[0]);

参照情報

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