第16章 Braintree


Braintree コンポーネント

Camel 2.17 以降で利用可能
Braintree コンポーネントは、以下の支払い方法をサポートする Braintree Payments サービスへのアクセスを提供します。
camel-braintree を使用するには、アカウント(サンドボックス または 実稼働)から取得できる API クレデンシャル を指定する必要があります。
Maven ユーザーは、このコンポーネントの以下の依存関係を pom.xml に追加する必要があります。
<dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-braintree</artifactId>
    <version>x.x.x</version>
    <!-- use the same version as your Camel core version -->
</dependency>
Copy to Clipboard Toggle word wrap

URI 形式

braintree://endpoint-prefix/endpoint?[options]
Copy to Clipboard Toggle word wrap
エンドポイント接頭辞は以下のいずれかになります。
  • addOn
  • address
  • clientToken
  • creditCardverification
  • customer
  • discount
  • merchantAccount
  • paymentmethod
  • paymentmethodNonce
  • plan
  • settlementBatchSummary
  • subscription
  • transaction
  • webhookNotification

BraintreeComponent

Braintree コンポーネントは、以下のオプションで設定できます。これらのオプションは、org.apache.camel.component.braintree.BraintreeConfiguration タイプのコンポーネントの Bean プロパティー 設定 を使用して指定できます。
Expand
オプションタイプ説明
environment String 要求の転送先を指定する値 - サンドボックスまたは実稼働
merchantId String 使用するゲートウェイアカウントの一意の識別子。これは、実際の業者アカウント ID とは異なります。
publicKey String ユーザー固有のパブリック ID
privateKey String 共有すべきでないユーザー固有のセキュアな ID。
httpLogLevel java.util.logging.Level HTTP 呼び出し の Camel 2.17.1 ロギングレベル
httpLogName String http 呼び出しをログに記録するために使用する Camel 2 .17.1 ログカテゴリー。デフォルトは Braintree です。
httpReadTimeout Integer HTTP 呼び出しの Camel 2.17.1 の読み取りタイムアウト
上記のオプションはすべて Braintree Payments によって提供されます。

プロデューサーエンドポイント:

プロデューサーエンドポイントはエンドポイント接頭辞を使用し、続いてエンドポイント名と以下で説明する関連オプションを使用できます。一部のエンドポイントには、短縮エイリアスを使用できます。エンドポイント URI には 接頭辞が含まれている必要があります。
必須ではないエンドポイントオプションは [] で示されます。エンドポイントに必須のオプションがない場合は、[] オプションのセットの 1 つを指定する必要があります。プロデューサーエンドポイントは、Camel Exchange In メッセージに含まれる値を持つ endpoint オプションの名前が含まれる必要がある特別なオプション inBody を使用することもできます。
エンドポイントオプションは、エンドポイント URI またはメッセージヘッダーで動的に指定できます。メッセージヘッダー名は CamelBraintree.<option> 形式である必要がありますinBody オプションはメッセージヘッダーを上書きすることに注意してください。つまり、エンドポイントオプションの inBody=optionCamelBraintree.option ヘッダーを上書きすることに注意してください。
エンドポイントおよびオプションの詳細は、Braintree リファレンス( https://developers.braintreepayments.com/reference/overview)を参照してください。

endpoint prefix addOn

以下のエンドポイントは、以下のように接頭辞 addOn で呼び出すことができます。
braintree://addOn/endpoint
Copy to Clipboard Toggle word wrap
Expand
エンドポイント短縮形エイリアスオプション結果ボディーのタイプ
all List<com.braintreegateway.Addon>

エンドポイント接頭辞 アドレス

以下のエンドポイントは、以下のように接頭辞 address で呼び出すことができます。
braintree://address/endpoint?[options]
Copy to Clipboard Toggle word wrap
Expand
エンドポイント短縮形エイリアスオプション結果ボディーのタイプ
create customerId, request com.braintreegateway.Result<com.braintreegateway.Address>
delete customerId, id com.braintreegateway.Result<com.braintreegateway.Address>
find customerId, id com.braintreegateway.Address
update customerId, id, request com.braintreegateway.Result<com.braintreegateway.Address>
Expand
表16.1 の URI オプション address
名前タイプ
customerId String
request com.braintreegateway.AddressRequest
id String

エンドポイント接頭辞 clientToken

以下のエンドポイントは、以下のように接頭辞 clientToken で呼び出すことができます。
braintree://clientToken/endpoint?[options]
Copy to Clipboard Toggle word wrap
Expand
エンドポイント短縮形エイリアスオプション結果ボディーのタイプ
generate request String
Expand
表16.2 の URI オプション clientToken
名前タイプ
request com.braintreegateway.ClientTokenrequest

エンドポイント接頭辞 creditCardVerification

以下のエンドポイントは、以下のように creditCardverification 接頭辞で呼び出すことができます。
braintree://creditCardVerification/endpoint?[options]
Copy to Clipboard Toggle word wrap
Expand
エンドポイント短縮形エイリアスオプション結果ボディーのタイプ
find id com.braintreegateway.CreditCardVerification
search query com.braintreegateway.ResourceCollection<com.braintreegateway.CreditCardVerification>
Expand
表16.3 の URI オプション creditCardVerification
名前タイプ
id String
query com.braintreegateway.CreditCardVerificationSearchRequest

エンドポイント接頭辞 customer

以下のエンドポイントは、以下のように接頭辞 customer で呼び出すことができます。
braintree://customer/endpoint?[options]
Copy to Clipboard Toggle word wrap
Expand
エンドポイント短縮形エイリアスオプション結果ボディーのタイプ
all
create request com.braintreegateway.Result<com.braintreegateway.Customer>
delete id com.braintreegateway.Result<com.braintreegateway.Customer>
find id com.braintreegateway.Customer
search query com.braintreegateway.ResourceCollection<com.braintreegateway.Customer>
update Id、request com.braintreegateway.Result<com.braintreegateway.Customer>
Expand
表16.4 の URI オプション customer
名前タイプ
id 文字列
request com.braintreegateway.CustomerRequest
query com.braintreegateway.CustomerSearchRequest

エンドポイント接頭辞 discount

以下のエンドポイントは、以下のように接頭辞 discount を使用して呼び出すことができます。
braintree://discount/endpoint
Copy to Clipboard Toggle word wrap
Expand
エンドポイント短縮形エイリアスオプション結果ボディーのタイプ
all List<com.braintreegateway.Discount>

エンドポイント接頭辞 merchantAccount

以下のエンドポイントは、以下のように接頭辞 merchantAccount で呼び出すことができます。
braintree://merchantAccount/endpoint?[options]
Copy to Clipboard Toggle word wrap
Expand
エンドポイント短縮形エイリアスオプション結果ボディーのタイプ
create request com.braintreegateway.Result<com.braintreegateway.MerchantAccount>
find id com.braintreegateway.MerchantAccount
update Id、request com.braintreegateway.Result<com.braintreegateway.MerchantAccount>
Expand
表16.5 の URI オプション merchantAccount
名前タイプ
id 文字列
request com.braintreegateway.MerchantAccountRequest

エンドポイント接頭辞 paymentMethod

以下のエンドポイントは、以下のように接頭辞 paymentMethod で呼び出すことができます。
braintree://paymentMethod/endpoint?[options]
Copy to Clipboard Toggle word wrap
Expand
エンドポイント短縮形エイリアスオプション結果ボディーのタイプ
create request com.braintreegateway.Result<com.braintreegateway.PaymentMethod>
delete token com.braintreegateway.Result<com.braintreegateway.PaymentMethod>
find token com.braintreegateway.PaymentMethod
update token、request com.braintreegateway.Result<com.braintreegateway.PaymentMethod>
Expand
表16.6 の URI オプション paymentMethod
名前タイプ
token 文字列
request com.braintreegateway.PaymentMethodRequest

エンドポイント接頭辞 paymentMethodNonce

以下のエンドポイントは、以下のように接頭辞 paymentMethodNonce で呼び出すことができます。
braintree://paymentMethodNonce/endpoint?[options]
Copy to Clipboard Toggle word wrap
Expand
エンドポイント短縮形エイリアスオプション結果ボディーのタイプ
create paymentMethodToken com.braintreegateway.Result<com.braintreegateway.PaymentMethodNonce>
find paymentMethodNonce com.braintreegateway.PaymentMethodNonce
Expand
表16.7 の URI オプション paymentMethodNonce
名前タイプ
paymentMethodToken 文字列
paymentMethodNonce String

エンドポイント接頭辞 plan

以下のエンドポイントは、以下のように接頭辞 プラン で呼び出すことができます。
braintree://plan/endpoint
Copy to Clipboard Toggle word wrap
Expand
エンドポイント短縮形エイリアスオプション結果ボディーのタイプ
all List<com.braintreegateway.Plan>

エンドポイント接頭辞 settlementBatchSummary

以下のエンドポイントは、以下のように接頭辞 settlementBatchSummary で呼び出すことができます。
braintree://settlementBatchSummary/endpoint?[options]
Copy to Clipboard Toggle word wrap
Expand
エンドポイント短縮形エイリアスオプション結果ボディーのタイプ
generate request com.braintreegateway.Result<com.braintreegateway.SettlementBatchSummary>
Expand
表16.8 の URI オプション settlementBatchSummary
名前タイプ
settlementDate カレンダー
groupByCustomField 文字列

エンドポイント接頭辞 subscription

以下のエンドポイントは、以下のように subscription 接頭辞で呼び出すことができます。
braintree://subscription/endpoint?[options]
Copy to Clipboard Toggle word wrap
Expand
エンドポイント短縮形エイリアスオプション結果ボディーのタイプ
cancel id com.braintreegateway.Result<com.braintreegateway.Subscription>
create request com.braintreegateway.Result<com.braintreegateway.Subscription>
delete customerId, id com.braintreegateway.Result<com.braintreegateway.Subscription>
find id com.braintreegateway.Subscription
retryCharge subscriptionId, amount com.braintreegateway.Result<com.braintreegateway.Transaction>
search searchRequest com.braintreegateway.ResourceCollection<com.braintreegateway.Subscription>
update Id、request com.braintreegateway.Result<com.braintreegateway.Subscription>
Expand
表16.9 の URI オプション subscription
名前タイプ
id 文字列
request com.braintreegateway.SubscriptionRequest
customerId 文字列
subscriptionId 文字列
amount BigDecimal
searchRequest com.braintreegateway.SubscriptionSearchRequest.

エンドポイント接頭辞 transaction

以下のエンドポイントは、以下のように接頭辞 transaction で呼び出すことができます。
braintree://transaction/endpoint?[options]
Copy to Clipboard Toggle word wrap
Expand
エンドポイント短縮形エイリアスオプション結果ボディーのタイプ
cancelRelease id com.braintreegateway.Result<com.braintreegateway.Transaction>
cloneTransaction id, cloneRequest com.braintreegateway.Result<com.braintreegateway.Transaction>
クレジット request com.braintreegateway.Result<com.braintreegateway.Transaction>
find id com.braintreegateway.Transaction
holdInEscrow id com.braintreegateway.Result<com.braintreegateway.Transaction>
releaseFromEscrow id com.braintreegateway.Result<com.braintreegateway.Transaction>
refund id、amount com.braintreegateway.Result<com.braintreegateway.Transaction>
sale request com.braintreegateway.Result<com.braintreegateway.Transaction>
search query com.braintreegateway.ResourceCollection<com.braintreegateway.Transaction>
submitForPartialSettlement id、amount com.braintreegateway.Result<com.braintreegateway.Transaction>
submitForSettlement Id, amount, request com.braintreegateway.Result<com.braintreegateway.Transaction>
voidTransaction id com.braintreegateway.Result<com.braintreegateway.Transaction>
Expand
表16.10 の URI オプション transaction
名前タイプ
id 文字列
request com.braintreegateway.TransactionCloneRequest
cloneRequest com.braintreegateway.TransactionCloneRequest
amount BigDecimal
query com.braintreegateway.TransactionSearchRequest

エンドポイント接頭辞 webhookNotification

以下のエンドポイントは、以下のように接頭辞 webhookNotification で呼び出すことができます。
braintree://webhookNotification/endpoint?[options]
Copy to Clipboard Toggle word wrap
Expand
エンドポイント短縮形エイリアスオプション結果ボディーのタイプ
parse 署名、ペイロード com.braintreegateway.WebhookNotification
verify challenge 文字列
Expand
表16.11 の URI オプション webhookNotification
名前タイプ
signature String
payload 文字列
challenge String

コンシューマーエンドポイント

プロデューサーエンドポイントはいずれもコンシューマーエンドポイントとして使用できます。コンシューマーエンドポイントは、consumer. 接頭辞を持つ Scheduled Poll Consumer オプション を使用して、エンドポイント呼び出しをスケジュールできます。デフォルトでは、配列またはコレクションを返すコンシューマーエンドポイントは、要素ごとにエクスチェンジを 1 つ生成し、それらのルートはエクスチェンジごとに 1 回実行されます。この動作を変更するには、consumer.splitResults=true プロパティーを使用して、リストまたは配列全体の単一のエクスチェンジを返します。

メッセージヘッダー

すべての URI オプションは、CamelBraintree. 接頭辞を持つプロデューサーエンドポイントのメッセージヘッダーで指定できます。

Message body

すべての結果メッセージ本文は、Braintree Java SDK によって提供されるオブジェクトを使用します。プロデューサーエンドポイントは、inBody エンドポイントパラメーターに受信メッセージボディーのオプション名を指定できます。

Examples

<?xml version="1.0"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
           xsi:schemaLocation="
             http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0 http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.0.0.xsd
             http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
             http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd">


    <cm:property-placeholder id="placeholder" persistent-id="camel.braintree">
    </cm:property-placeholder>

    <bean id="braintree" class="org.apache.camel.component.braintree.BraintreeComponent">
        <property name="configuration">
            <bean class="org.apache.camel.component.braintree.BraintreeConfiguration">
                <property name="environment" value="${environment}"/>
                <property name="merchantId" value="${merchantId}"/>
                <property name="publicKey" value="${publicKey}"/>
                <property name="privateKey" value="${privateKey}"/>
            </bean>
        </property>
    </bean>

    <camelContext trace="true" xmlns="http://camel.apache.org/schema/blueprint" id="braintree-example-context">
        <route id="braintree-example-route">
            <from uri="direct:generateClientToken"/>
            <to uri="braintree://clientToken/generate"/>
            <to uri="stream:out"/>
        </route>
    </camelContext>

</blueprint>
Copy to Clipboard Toggle word wrap
トップに戻る
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。 最新の更新を見る.

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

Theme

© 2025 Red Hat