...
The Braintree component provides access to Braintree Payments trough through theirs Java SDK. services which support the following payment methods:
In All client applications need API credential in order to process payments. In order to use camel-braintree with your account, you 'll need to create a new provide some API credentials you can obtains from your account (Sandbox or Production account. )
Maven users will need to add the following dependency to their pom.xml for this component:
Code Block | ||
---|---|---|
| ||
<dependency> |
<groupId>org.apache.camel</groupId> |
<artifactId>camel-braintree</artifactId> |
<version>${camel-version}</version>
</dependency>
<version>x.x.x</version>
<!-- use the same version as your Camel core version -->
</dependency>
|
URI format
Code Block |
---|
braintree://endpoint-prefix/endpoint?[options] |
Endpoint prefix can be one of:
...
Option | Type | Description |
---|---|---|
environment | String | value that specifies where requests should be directed – sandbox or production |
merchantId | String | a unique identifier for your gateway account, which is different than your merchant account ID |
publicKey | String | user-specific public identifier |
privateKey | String | user-specific secure identifier that should not be shared – even with us! |
httpLogLevel | java.util.logging.Level | camel 2.17.1 Logging level for http calls |
httpLogName | String | camel 2.17.1 Log category to use to log http calls, default "Braintree" |
httpReadTimeout | Integer | camel 2.17.1 Read timeout for http calls |
All the options above are provided by Braintree Payments
...
The following endpoints can be invoked with the prefix addOn as follows:
Code Block |
---|
braintree://addOn/endpoint |
Endpoint | Shorthand Alias | Options | Result Body Type |
---|---|---|---|
all | List<com.braintreegateway.Addon> |
...
The following endpoints can be invoked with the prefix address as follows:
Code Block |
---|
braintree://address/endpoint?[options] |
Endpoint | Shorthand Alias | Options | Result Body Type |
---|---|---|---|
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> |
...
The following endpoints can be invoked with the prefix clientToken as follows:
Code Block |
---|
braintree://clientToken/endpoint?[options] |
Endpoint | Shorthand Alias | Options | Result Body Type |
---|---|---|---|
generate | request | String |
...
The following endpoints can be invoked with the prefix creditCardverification as follows:
Code Block |
---|
braintree://creditCardVerification/endpoint?[options] |
Endpoint | Shorthand Alias | Options | Result Body Type |
---|---|---|---|
find | id | com.braintreegateway.CreditCardVerification | |
search | query | com.braintreegateway.ResourceCollection<com.braintreegateway.CreditCardVerification> |
...
The following endpoints can be invoked with the prefix customer as follows:
Code Block |
---|
braintree://customer/endpoint?[options] |
Endpoint | Shorthand Alias | Options | Result Body Type |
---|---|---|---|
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> |
...
The following endpoints can be invoked with the prefix discount as follows:
Code Block |
---|
braintree://discount/endpoint |
Endpoint | Shorthand Alias | Options | Result Body Type |
---|---|---|---|
all | List<com.braintreegateway.Discount> |
...
Endpoint prefix merchantAccount
The following endpoints can be invoked with the prefix merchantAccount as follows:
Code Block |
---|
braintree://merchantAccount/endpoint?[options] |
Endpoint | Shorthand Alias | Options | Result Body Type |
---|---|---|---|
create | request | com.braintreegateway.Result<com.braintreegateway.MerchantAccount> | |
find | id | com.braintreegateway.MerchantAccount | |
update | id, request | com.braintreegateway.Result<com.braintreegateway.MerchantAccount> |
URI Options for merchantAccount
Name | Type |
---|---|
id | String |
request | com.braintreegateway.MerchantAccountRequest |
Endpoint prefix paymentMethod
The following endpoints can be invoked with the prefix paymentMethod as follows:
Code Block |
---|
braintree://paymentMethod/endpoint?[options] |
Endpoint | Shorthand Alias | Options | Result Body Type |
---|---|---|---|
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> |
URI Options for paymentMethod
Name | Type |
---|---|
token | String |
request | com.braintreegateway.PaymentMethodRequest |
Endpoint prefix paymentMethodNonce
The following endpoints can be invoked with the prefix paymentMethodNonce as follows:
Code Block |
---|
braintree://paymentMethodNonce/endpoint?[options] |
Endpoint | Shorthand Alias | Options | Result Body Type |
---|---|---|---|
create | paymentMethodToken | com.braintreegateway.Result<com.braintreegateway.PaymentMethodNonce> | |
find | paymentMethodNonce | com.braintreegateway.PaymentMethodNonce |
URI Options for paymentMethodNonce
Name | Type |
---|---|
paymentMethodToken | String |
paymentMethodNonce | String |
Endpoint prefix plan
The following endpoints can be invoked with the prefix plan as follows:
Code Block |
---|
braintree://plan/endpoint |
Endpoint | Shorthand Alias | Options | Result Body Type |
---|---|---|---|
all | List<com.braintreegateway.Plan> |
Endpoint prefix settlementBatchSummary
The following endpoints can be invoked with the prefix settlementBatchSummary as follows:
Code Block |
---|
braintree://settlementBatchSummary/endpoint?[options] |
Endpoint | Shorthand Alias | Options | Result Body Type |
---|---|---|---|
generate | request | com.braintreegateway.Result<com.braintreegateway.SettlementBatchSummary> |
URI Options for settlementBatchSummary
Name | Type |
---|---|
settlementDate | Calendar |
groupByCustomField | String |
Endpoint prefix subscription
The following endpoints can be invoked with the prefix subscription as follows:
Code Block |
---|
braintree://subscription/endpoint?[options] |
Endpoint | Shorthand Alias | Options | Result Body Type |
---|---|---|---|
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> |
URI Options for subscription
Name | Type |
---|---|
id | String |
request | com.braintreegateway.SubscriptionRequest |
customerId | String |
subscriptionId | String |
amount | BigDecimal |
searchRequest | com.braintreegateway.SubscriptionSearchRequest. |
Endpoint prefix transaction
The following endpoints can be invoked with the prefix transaction as follows:
Code Block |
---|
braintree://transaction/endpoint?[options] |
Endpoint | Shorthand Alias | Options | Result Body Type |
---|---|---|---|
cancelRelease | id | com.braintreegateway.Result<com.braintreegateway.Transaction> | |
cloneTransaction | id, cloneRequest | com.braintreegateway.Result<com.braintreegateway.Transaction> | |
credit | 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> |
URI Options for transaction
Name | Type |
---|---|
id | String |
request | com.braintreegateway.TransactionCloneRequest |
cloneRequest | com.braintreegateway.TransactionCloneRequest |
amount | BigDecimal |
query | com.braintreegateway.TransactionSearchRequest |
Endpoint prefix webhookNotification
The following endpoints can be invoked with the prefix webhookNotification as follows:
Code Block |
---|
braintree://webhookNotification/endpoint?[options] |
Endpoint | Shorthand Alias | Options | Result Body Type |
---|---|---|---|
parse | signature, payload | com.braintreegateway.WebhookNotification | |
verify | challenge | String |
URI Options for webhookNotification
Name | Type |
---|---|
signature | String |
payload | String |
challenge | String |
Consumer Endpoints
Any of the producer endpoints can be used as a consumer endpoint. Consumer endpoints can use Scheduled Poll Consumer Options with a consumer. prefix to schedule endpoint invocation. By default Consumer endpoints that return an array or collection will generate one exchange per element, and their routes will be executed once for each exchange. To change this behavior use the property consumer.splitResults=true to return a single exchange for the entire list or array.
Message Headers
Any URI option can be provided in a message header for producer endpoints with a CamelBraintree. prefix.
Message body
All result message bodies utilize objects provided by the Braintree Java SDK. Producer endpoints can specify the option name for incoming message body in the inBody endpoint parameter.
Examples
Use casesCode Block | ||||
---|---|---|---|---|
| ||||
<?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 httphttps://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> |
...