Braintree Component

Available as of Camel 2.17

The Braintree component provides access to Braintree Payments services which support the following payment methods:

In order to use camel-braintree you need to provide some API credentials you can obtains from your account (Sandbox or Production)

Maven users will need to add the following dependency to their pom.xml for this component:

 

 

URI format

 

 

Endpoint prefix can be one of:

  • addOn
  • address
  • clientToken
  • creditCardverification
  • customer
  • discount
  • merchantAccount
  • paymentmethod
  • paymentmethodNonce
  • plan
  • settlementBatchSummary
  • subscription
  • transaction
  • webhookNotification

 

BraintreeComponent

The Braintree Component can be configured with the options below. These options can be provided using the component's bean property configuration of type org.apache.camel.component.braintree.BraintreeConfiguration.

Option
Type
Description
environmentStringvalue that specifies where requests should be directed – sandbox or production
merchantIdStringa unique identifier for your gateway account, which is different than your merchant account ID
publicKeyStringuser-specific public identifier
privateKeyStringuser-specific secure identifier that should not be shared – even with us!
httpLogLeveljava.util.logging.Levelcamel 2.17.1 Logging level for http calls
httpLogNameStringcamel 2.17.1 Log category to use to log http calls, default "Braintree"
httpReadTimeoutIntegercamel 2.17.1 Read timeout for http calls

All the options above are provided by Braintree Payments

Producer Endpoints:

Producer endpoints can use endpoint prefixes followed by endpoint names and associated options described next. A shorthand alias can be used for some endpoints. The endpoint URI MUST contain a prefix.

Endpoint options that are not mandatory are denoted by []. When there are no mandatory options for an endpoint, one of the set of [] options MUST be provided. Producer endpoints can also use a special option inBody that in turn should contain the name of the endpoint option whose value will be contained in the Camel Exchange In message.

Any of the endpoint options can be provided in either the endpoint URI, or dynamically in a message header. The message header name must be of the format CamelBraintree.<option>. Note that the inBody option overrides message header, i.e. the endpoint option inBody=option would override a CamelBraintree.option header.

For more information on the endpoints and options see Braintree references at https://developers.braintreepayments.com/reference/overview

 

Endpoint prefix addOn

The following endpoints can be invoked with the prefix addOn as follows:

 

Endpoint
Shorthand Alias
Options
Result Body Type
all  List<com.braintreegateway.Addon>

Endpoint prefix address

The following endpoints can be invoked with the prefix address as follows:

 

Endpoint
Shorthand Alias
Options
Result Body Type
create customerId, requestcom.braintreegateway.Result<com.braintreegateway.Address>
delete customerId, idcom.braintreegateway.Result<com.braintreegateway.Address> 
find customerId, idcom.braintreegateway.Address
update customerId, id, requestcom.braintreegateway.Result<com.braintreegateway.Address> 
URI Options for address
Name
Type
customerIdString
requestcom.braintreegateway.AddressRequest
idString

Endpoint prefix clientToken

The following endpoints can be invoked with the prefix clientToken as follows:

 

Endpoint
Shorthand Alias
Options
Result Body Type
generate  requestString
URI Options for clientToken
Name
Type
requestcom.braintreegateway.ClientTokenrequest

Endpoint prefix creditCardVerification

The following endpoints can be invoked with the prefix creditCardverification as follows:

 

Endpoint
Shorthand Alias
Options
Result Body Type
find  idcom.braintreegateway.CreditCardVerification
search querycom.braintreegateway.ResourceCollection<com.braintreegateway.CreditCardVerification>
URI Options for creditCardVerification
Name
Type
idString
querycom.braintreegateway.CreditCardVerificationSearchRequest

Endpoint prefix customer

The following endpoints can be invoked with the prefix customer as follows:

 

Endpoint
Shorthand Alias
Options
Result Body Type
all   
create requestcom.braintreegateway.Result<com.braintreegateway.Customer>
delete idcom.braintreegateway.Result<com.braintreegateway.Customer>
find idcom.braintreegateway.Customer
search querycom.braintreegateway.ResourceCollection<com.braintreegateway.Customer>
update id, requestcom.braintreegateway.Result<com.braintreegateway.Customer>
URI Options for customer
Name
Type
idString
requestcom.braintreegateway.CustomerRequest
querycom.braintreegateway.CustomerSearchRequest

Endpoint prefix discount

The following endpoints can be invoked with the prefix discount as follows:

 

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:

 

Endpoint
Shorthand Alias
Options
Result Body Type
create requestcom.braintreegateway.Result<com.braintreegateway.MerchantAccount>
find idcom.braintreegateway.MerchantAccount
update id, requestcom.braintreegateway.Result<com.braintreegateway.MerchantAccount>
URI Options for merchantAccount
Name
Type
idString
requestcom.braintreegateway.MerchantAccountRequest

Endpoint prefix paymentMethod

The following endpoints can be invoked with the prefix paymentMethod as follows:

 

Endpoint
Shorthand Alias
Options
Result Body Type
create requestcom.braintreegateway.Result<com.braintreegateway.PaymentMethod>
delete tokencom.braintreegateway.Result<com.braintreegateway.PaymentMethod>
find tokencom.braintreegateway.PaymentMethod
update token, requestcom.braintreegateway.Result<com.braintreegateway.PaymentMethod>
URI Options for paymentMethod
Name
Type
tokenString
requestcom.braintreegateway.PaymentMethodRequest

Endpoint prefix paymentMethodNonce

The following endpoints can be invoked with the prefix paymentMethodNonce as follows:

 

Endpoint
Shorthand Alias
Options
Result Body Type
create paymentMethodTokencom.braintreegateway.Result<com.braintreegateway.PaymentMethodNonce>
find paymentMethodNoncecom.braintreegateway.PaymentMethodNonce
URI Options for paymentMethodNonce
Name
Type
paymentMethodTokenString
paymentMethodNonceString

Endpoint prefix plan

The following endpoints can be invoked with the prefix plan as follows:

 

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:

 

Endpoint
Shorthand Alias
Options
Result Body Type
generate  requestcom.braintreegateway.Result<com.braintreegateway.SettlementBatchSummary>
URI Options for settlementBatchSummary
Name
Type
settlementDateCalendar
groupByCustomFieldString

Endpoint prefix subscription

The following endpoints can be invoked with the prefix subscription as follows:

 

Endpoint
Shorthand Alias
Options
Result Body Type
cancel  id com.braintreegateway.Result<com.braintreegateway.Subscription>
create requestcom.braintreegateway.Result<com.braintreegateway.Subscription>
delete customerId, idcom.braintreegateway.Result<com.braintreegateway.Subscription>
find idcom.braintreegateway.Subscription
retryCharge subscriptionId, amountcom.braintreegateway.Result<com.braintreegateway.Transaction>
search searchRequestcom.braintreegateway.ResourceCollection<com.braintreegateway.Subscription>
update id, requestcom.braintreegateway.Result<com.braintreegateway.Subscription>
URI Options for subscription
Name
Type
idString
requestcom.braintreegateway.SubscriptionRequest
customerIdString
subscriptionIdString
amountBigDecimal
searchRequestcom.braintreegateway.SubscriptionSearchRequest.

 

Endpoint prefix transaction

The following endpoints can be invoked with the prefix transaction as follows:

 

Endpoint
Shorthand Alias
Options
Result Body Type
cancelRelease idcom.braintreegateway.Result<com.braintreegateway.Transaction>
cloneTransaction id, cloneRequestcom.braintreegateway.Result<com.braintreegateway.Transaction>
credit requestcom.braintreegateway.Result<com.braintreegateway.Transaction>
find idcom.braintreegateway.Transaction
holdInEscrow idcom.braintreegateway.Result<com.braintreegateway.Transaction>
releaseFromEscrow idcom.braintreegateway.Result<com.braintreegateway.Transaction>
refund id, amountcom.braintreegateway.Result<com.braintreegateway.Transaction>
sale requestcom.braintreegateway.Result<com.braintreegateway.Transaction>
search querycom.braintreegateway.ResourceCollection<com.braintreegateway.Transaction>
submitForPartialSettlement id, amountcom.braintreegateway.Result<com.braintreegateway.Transaction>
submitForSettlement id, amount, requestcom.braintreegateway.Result<com.braintreegateway.Transaction>
voidTransaction idcom.braintreegateway.Result<com.braintreegateway.Transaction>
URI Options for transaction
Name
Type
idString
requestcom.braintreegateway.TransactionCloneRequest
cloneRequestcom.braintreegateway.TransactionCloneRequest
amountBigDecimal
querycom.braintreegateway.TransactionSearchRequest

Endpoint prefix webhookNotification

The following endpoints can be invoked with the prefix webhookNotification as follows:

 

Endpoint
Shorthand Alias
Options
Result Body Type
parse  signature, payloadcom.braintreegateway.WebhookNotification
verify challengeString
URI Options for webhookNotification
Name
Type
signatureString
payloadString
challengeString

 

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


Blueprint



© 2004-2015 The Apache Software Foundation.
Apache Camel, Camel, Apache, the Apache feather logo, and the Apache Camel project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.
Graphic Design By Hiram