第16章 Braintree
Braintree コンポーネント リンクのコピーリンクがクリップボードにコピーされました!
リンクのコピーリンクがクリップボードにコピーされました!
Camel 2.17 以降で利用可能
Braintree コンポーネントは、以下の支払い方法をサポートする Braintree Payments サービスへのアクセスを提供します。
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>
URI 形式 リンクのコピーリンクがクリップボードにコピーされました!
リンクのコピーリンクがクリップボードにコピーされました!
braintree://endpoint-prefix/endpoint?[options]
エンドポイント接頭辞は以下のいずれかになります。
addOnaddressclientTokencreditCardverificationcustomerdiscountmerchantAccountpaymentmethodpaymentmethodNonceplansettlementBatchSummarysubscriptiontransactionwebhookNotification
BraintreeComponent リンクのコピーリンクがクリップボードにコピーされました!
リンクのコピーリンクがクリップボードにコピーされました!
Braintree コンポーネントは、以下のオプションで設定できます。これらのオプションは、org.apache.camel.component.braintree.BraintreeConfiguration タイプのコンポーネントの Bean プロパティー 設定 を使用して指定できます。
| オプション | タイプ | 説明 |
|---|---|---|
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=option は CamelBraintree.option ヘッダーを上書きすることに注意してください。
エンドポイントおよびオプションの詳細は、Braintree リファレンス( https://developers.braintreepayments.com/reference/overview)を参照してください。
endpoint prefix addOn リンクのコピーリンクがクリップボードにコピーされました!
リンクのコピーリンクがクリップボードにコピーされました!
以下のエンドポイントは、以下のように接頭辞 addOn で呼び出すことができます。
braintree://addOn/endpoint
| エンドポイント | 短縮形エイリアス | オプション | 結果ボディーのタイプ |
|---|---|---|---|
| all | List<com.braintreegateway.Addon> |
エンドポイント接頭辞 アドレス リンクのコピーリンクがクリップボードにコピーされました!
リンクのコピーリンクがクリップボードにコピーされました!
以下のエンドポイントは、以下のように接頭辞 address で呼び出すことができます。
braintree://address/endpoint?[options]
| エンドポイント | 短縮形エイリアス | オプション | 結果ボディーのタイプ |
|---|---|---|---|
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>
|
| 名前 | タイプ |
|---|---|
customerId
|
String
|
request
|
com.braintreegateway.AddressRequest
|
id
|
String
|
エンドポイント接頭辞 clientToken リンクのコピーリンクがクリップボードにコピーされました!
リンクのコピーリンクがクリップボードにコピーされました!
以下のエンドポイントは、以下のように接頭辞 clientToken で呼び出すことができます。
braintree://clientToken/endpoint?[options]
| エンドポイント | 短縮形エイリアス | オプション | 結果ボディーのタイプ |
|---|---|---|---|
generate
|
request
|
String
|
| 名前 | タイプ |
|---|---|
request
|
com.braintreegateway.ClientTokenrequest
|
エンドポイント接頭辞 creditCardVerification リンクのコピーリンクがクリップボードにコピーされました!
リンクのコピーリンクがクリップボードにコピーされました!
以下のエンドポイントは、以下のように creditCardverification 接頭辞で呼び出すことができます。
braintree://creditCardVerification/endpoint?[options]
| エンドポイント | 短縮形エイリアス | オプション | 結果ボディーのタイプ |
|---|---|---|---|
find
|
id
|
com.braintreegateway.CreditCardVerification
|
|
search
|
query
|
com.braintreegateway.ResourceCollection<com.braintreegateway.CreditCardVerification>
|
| 名前 | タイプ |
|---|---|
id
|
String
|
query
|
com.braintreegateway.CreditCardVerificationSearchRequest
|
エンドポイント接頭辞 customer リンクのコピーリンクがクリップボードにコピーされました!
リンクのコピーリンクがクリップボードにコピーされました!
以下のエンドポイントは、以下のように接頭辞 customer で呼び出すことができます。
braintree://customer/endpoint?[options]
| エンドポイント | 短縮形エイリアス | オプション | 結果ボディーのタイプ |
|---|---|---|---|
| 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>
|
| 名前 | タイプ |
|---|---|
| id | 文字列 |
| request |
com.braintreegateway.CustomerRequest
|
| query |
com.braintreegateway.CustomerSearchRequest
|
エンドポイント接頭辞 discount リンクのコピーリンクがクリップボードにコピーされました!
リンクのコピーリンクがクリップボードにコピーされました!
以下のエンドポイントは、以下のように接頭辞 discount を使用して呼び出すことができます。
braintree://discount/endpoint
| エンドポイント | 短縮形エイリアス | オプション | 結果ボディーのタイプ |
|---|---|---|---|
| all | List<com.braintreegateway.Discount> |
エンドポイント接頭辞 merchantAccount リンクのコピーリンクがクリップボードにコピーされました!
リンクのコピーリンクがクリップボードにコピーされました!
以下のエンドポイントは、以下のように接頭辞 merchantAccount で呼び出すことができます。
braintree://merchantAccount/endpoint?[options]
| エンドポイント | 短縮形エイリアス | オプション | 結果ボディーのタイプ |
|---|---|---|---|
| create | request | com.braintreegateway.Result<com.braintreegateway.MerchantAccount> | |
| find | id | com.braintreegateway.MerchantAccount | |
| update | Id、request | com.braintreegateway.Result<com.braintreegateway.MerchantAccount> |
| 名前 | タイプ |
|---|---|
| id | 文字列 |
| request |
com.braintreegateway.MerchantAccountRequest
|
エンドポイント接頭辞 paymentMethod リンクのコピーリンクがクリップボードにコピーされました!
リンクのコピーリンクがクリップボードにコピーされました!
以下のエンドポイントは、以下のように接頭辞 paymentMethod で呼び出すことができます。
braintree://paymentMethod/endpoint?[options]
| エンドポイント | 短縮形エイリアス | オプション | 結果ボディーのタイプ |
|---|---|---|---|
| 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> |
| 名前 | タイプ |
|---|---|
| token | 文字列 |
| request | com.braintreegateway.PaymentMethodRequest |
エンドポイント接頭辞 paymentMethodNonce リンクのコピーリンクがクリップボードにコピーされました!
リンクのコピーリンクがクリップボードにコピーされました!
以下のエンドポイントは、以下のように接頭辞 paymentMethodNonce で呼び出すことができます。
braintree://paymentMethodNonce/endpoint?[options]
| エンドポイント | 短縮形エイリアス | オプション | 結果ボディーのタイプ |
|---|---|---|---|
| create | paymentMethodToken | com.braintreegateway.Result<com.braintreegateway.PaymentMethodNonce> | |
| find | paymentMethodNonce | com.braintreegateway.PaymentMethodNonce |
| 名前 | タイプ |
|---|---|
paymentMethodToken
|
文字列 |
paymentMethodNonce
|
String
|
エンドポイント接頭辞 plan リンクのコピーリンクがクリップボードにコピーされました!
リンクのコピーリンクがクリップボードにコピーされました!
以下のエンドポイントは、以下のように接頭辞 プラン で呼び出すことができます。
braintree://plan/endpoint
| エンドポイント | 短縮形エイリアス | オプション | 結果ボディーのタイプ |
|---|---|---|---|
| all | List<com.braintreegateway.Plan> |
エンドポイント接頭辞 settlementBatchSummary リンクのコピーリンクがクリップボードにコピーされました!
リンクのコピーリンクがクリップボードにコピーされました!
以下のエンドポイントは、以下のように接頭辞 settlementBatchSummary で呼び出すことができます。
braintree://settlementBatchSummary/endpoint?[options]
| エンドポイント | 短縮形エイリアス | オプション | 結果ボディーのタイプ |
|---|---|---|---|
| generate | request |
com.braintreegateway.Result<com.braintreegateway.SettlementBatchSummary>
|
| 名前 | タイプ |
|---|---|
| settlementDate | カレンダー |
| groupByCustomField | 文字列 |
エンドポイント接頭辞 subscription リンクのコピーリンクがクリップボードにコピーされました!
リンクのコピーリンクがクリップボードにコピーされました!
以下のエンドポイントは、以下のように subscription 接頭辞で呼び出すことができます。
braintree://subscription/endpoint?[options]
| エンドポイント | 短縮形エイリアス | オプション | 結果ボディーのタイプ |
|---|---|---|---|
| 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>
|
| 名前 | タイプ |
|---|---|
| id | 文字列 |
| request | com.braintreegateway.SubscriptionRequest |
customerId
|
文字列 |
subscriptionId
|
文字列 |
amount
|
BigDecimal |
searchRequest
|
com.braintreegateway.SubscriptionSearchRequest. |
エンドポイント接頭辞 transaction リンクのコピーリンクがクリップボードにコピーされました!
リンクのコピーリンクがクリップボードにコピーされました!
以下のエンドポイントは、以下のように接頭辞 transaction で呼び出すことができます。
braintree://transaction/endpoint?[options]
| エンドポイント | 短縮形エイリアス | オプション | 結果ボディーのタイプ |
|---|---|---|---|
| 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>
|
| 名前 | タイプ |
|---|---|
| id | 文字列 |
| request | com.braintreegateway.TransactionCloneRequest |
cloneRequest
|
com.braintreegateway.TransactionCloneRequest |
| amount | BigDecimal |
query
|
com.braintreegateway.TransactionSearchRequest |
エンドポイント接頭辞 webhookNotification リンクのコピーリンクがクリップボードにコピーされました!
リンクのコピーリンクがクリップボードにコピーされました!
以下のエンドポイントは、以下のように接頭辞 webhookNotification で呼び出すことができます。
braintree://webhookNotification/endpoint?[options]
| エンドポイント | 短縮形エイリアス | オプション | 結果ボディーのタイプ |
|---|---|---|---|
| parse | 署名、ペイロード | com.braintreegateway.WebhookNotification | |
| verify | challenge | 文字列 |
| 名前 | タイプ |
|---|---|
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>