Braintree

Since Camel 2.17

Only producer is supported

The Braintree component provides access to Braintree Payments trough through theirs Java SDK.

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 Sandbox or Production account.

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

<dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-braintree</artifactId>
    <version>${camel-version}</version>
</dependency>

Braintree Options

The Braintree component supports 3 options, which are listed below.

Name Description Default Type

lazyStartProducer (producer)

Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel’s routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.

false

boolean

autowiredEnabled (advanced)

Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.

true

boolean

configuration (advanced)

Component configuration

BraintreeConfiguration

The Braintree endpoint is configured using URI syntax:

braintree:apiName/methodName

with the following path and query parameters:

Path Parameters (2 parameters):

Name Description Default Type

apiName

Required What kind of operation to perform. There are 17 enums and the value can be one of: ADD_ON, ADDRESS, CLIENT_TOKEN, CREDIT_CARD_VERIFICATION, CUSTOMER, DISCOUNT, DISPUTE, DOCUMENT_UPLOAD, MERCHANT_ACCOUNT, PAYMENT_METHOD, PAYMENT_METHOD_NONCE, PLAN, REPORT, SETTLEMENT_BATCH_SUMMARY, SUBSCRIPTION, TRANSACTION, WEBHOOK_NOTIFICATION

BraintreeApiName

methodName

Required What sub operation to use for the selected operation. There are 31 enums and the value can be one of: accept, addFileEvidence, addTextEvidence, cancel, cancelRelease, cloneTransaction, create, createForCurrency, credit, delete, fetchMerchantAccounts, finalize, find, generate, grant, holdInEscrow, parse, refund, releaseFromEscrow, removeEvidence, retryCharge, revoke, sale, search, submitForPartialSettlement, submitForSettlement, transactionLevelFees, update, updateDetails, verify, voidTransaction

String

Query Parameters (14 parameters):

Name Description Default Type

environment (producer)

The environment Either SANDBOX or PRODUCTION

String

inBody (producer)

Sets the name of a parameter to be passed in the exchange In Body

String

lazyStartProducer (producer)

Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel’s routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.

false

boolean

merchantId (producer)

The merchant id provided by Braintree.

String

httpReadTimeout (advanced)

Set read timeout for http calls.

Integer

synchronous (advanced)

Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported).

false

boolean

httpLogLevel (logging)

Set logging level for http calls, see java.util.logging.Level. There are 9 enums and the value can be one of: OFF, SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST, ALL

String

httpLogName (logging)

Set log category to use to log http calls.

Braintree

String

logHandlerEnabled (logging)

Sets whether to enable the BraintreeLogHandler. It may be desirable to set this to 'false' where an existing JUL - SLF4J logger bridge is on the classpath. This option can also be configured globally on the BraintreeComponent.

true

boolean

proxyHost (proxy)

The proxy host

String

proxyPort (proxy)

The proxy port

Integer

accessToken (security)

The access token granted by a merchant to another in order to process transactions on their behalf. Used in place of environment, merchant id, public key and private key fields.

String

privateKey (security)

The private key provided by Braintree.

String

publicKey (security)

The public key provided by Braintree.

String

API Parameters (14 APIs):

The Braintree endpoint is an API based component and has additional parameters based on which API name and API method is used. The API name and API method is located in the endpoint URI as the apiName/methodName path parameters:

braintree:apiName/methodName

There are 14 API names as listed in the table below:

API Name Type Description

address

Producer

Provides methods to create, delete, find, and update Address objects

clientToken

Producer

Generates client tokens, which are used to authenticate requests made directly on behalf of merchants This class does not need to be instantiated directly

creditCardVerification

Producer

To verify credit card information

customer

Producer

Provides methods to create, delete, find, and update Customer objects

dispute

Producer

Provides methods to interact with Dispute objects

documentUpload

Producer

API to upload evidence documents

merchantAccount

Producer

Provides methods to create, find, and update MerchantAccount objects

paymentMethod

Producer

Provides methods to interact with payments

paymentMethodNonce

Producer

Provides methods to interact with nonce payments

report

Producer

Provides methods to interact with reports

settlementBatchSummary

Producer

Provides methods to interact wit settlement summaries

subscription

Producer

Provides methods to interact with Subscriptions

transaction

Producer

Provides methods to interact with Transactions

webhookNotification

Producer

To retrieve notifications via webhooks

Each API is documented in the following sections to come.

API: address

Only producer is supported

The address API has 4 method(s) which is represented by the following method signatures (an API method may have multiple signatures due to overloading):

com.braintreegateway.Result<com.braintreegateway.Address> create(String customerId, com.braintreegateway.AddressRequest request);

com.braintreegateway.Result<com.braintreegateway.Address> delete(String customerId, String id);

com.braintreegateway.Address find(String customerId, String id);

com.braintreegateway.Result<com.braintreegateway.Address> update(String customerId, String id, com.braintreegateway.AddressRequest request);

The address API is defined in the syntax as follows:

braintree:address/methodName?[parameters]

The 4 method(s) is listed in the table below. (API methods can have a shorthand alias name which can be used in the syntax instead of the name)

Method Alias Description

create

Creates an Address for a Customer

delete

Deletes a Customer’s Address

find

Finds a Customer’s Address

update

Updates a Customer’s Address

The address API method(s) has the following set of parameters listed in the table below:

Method Parameter Description Type

create

customerId

The id of the Customer

String

create

request

The request object

AddressRequest

delete

customerId

The id of the Customer

String

delete

id

The id of the Address to delete

String

find

customerId

The id of the Customer

String

find

id

The id of the Address

String

update

customerId

The id of the Customer

String

update

id

The id of the Address

String

update

request

The request object containing the AddressRequest parameters

AddressRequest

In addition to the parameters above, the address API can also use from the 14 endpoint query option which is listed in the Query Parameters section.

Any of the parameters can be provided in either the endpoint URI, or dynamically in a message header. The message header name must be of the format CamelBraintree.parameter. The inBody parameter overrides message header, i.e. the endpoint parameter inBody=myParameterNameHere would override a CamelBraintree.myParameterNameHere header.

API: clientToken

Only producer is supported

The clientToken API has 1 method(s) which is represented by the following method signatures (an API method may have multiple signatures due to overloading):

String generate();

String generate(com.braintreegateway.ClientTokenRequest request);

The clientToken API is defined in the syntax as follows:

braintree:clientToken/methodName?[parameters]

The 1 method(s) is listed in the table below. (API methods can have a shorthand alias name which can be used in the syntax instead of the name)

Method Alias Description

generate

The clientToken API method(s) has the following set of parameters listed in the table below:

Method Parameter Description Type

generate

request

ClientTokenRequest

In addition to the parameters above, the clientToken API can also use from the 14 endpoint query option which is listed in the Query Parameters section.

Any of the parameters can be provided in either the endpoint URI, or dynamically in a message header. The message header name must be of the format CamelBraintree.parameter. The inBody parameter overrides message header, i.e. the endpoint parameter inBody=myParameterNameHere would override a CamelBraintree.myParameterNameHere header.

API: creditCardVerification

Only producer is supported

The creditCardVerification API has 3 method(s) which is represented by the following method signatures (an API method may have multiple signatures due to overloading):

com.braintreegateway.Result<com.braintreegateway.CreditCardVerification> create(com.braintreegateway.CreditCardVerificationRequest request);

com.braintreegateway.CreditCardVerification find(String id);

com.braintreegateway.ResourceCollection<com.braintreegateway.CreditCardVerification> search(com.braintreegateway.CreditCardVerificationSearchRequest query);

The creditCardVerification API is defined in the syntax as follows:

braintree:creditCardVerification/methodName?[parameters]

The 3 method(s) is listed in the table below. (API methods can have a shorthand alias name which can be used in the syntax instead of the name)

Method Alias Description

create

find

search

The creditCardVerification API method(s) has the following set of parameters listed in the table below:

Method Parameter Description Type

create

request

CreditCardVerificationRequest

find

id

String

search

query

CreditCardVerificationSearchRequest

In addition to the parameters above, the creditCardVerification API can also use from the 14 endpoint query option which is listed in the Query Parameters section.

Any of the parameters can be provided in either the endpoint URI, or dynamically in a message header. The message header name must be of the format CamelBraintree.parameter. The inBody parameter overrides message header, i.e. the endpoint parameter inBody=myParameterNameHere would override a CamelBraintree.myParameterNameHere header.

API: customer

Only producer is supported

The customer API has 5 method(s) which is represented by the following method signatures (an API method may have multiple signatures due to overloading):

com.braintreegateway.Result<com.braintreegateway.Customer> create(com.braintreegateway.CustomerRequest request);

com.braintreegateway.Result<com.braintreegateway.Customer> delete(String id);

com.braintreegateway.Customer find(String id);

com.braintreegateway.Customer find(String id, String associationFilterId);

com.braintreegateway.ResourceCollection<com.braintreegateway.Customer> search(com.braintreegateway.CustomerSearchRequest query);

com.braintreegateway.Result<com.braintreegateway.Customer> update(String id, com.braintreegateway.CustomerRequest request);

The customer API is defined in the syntax as follows:

braintree:customer/methodName?[parameters]

The 5 method(s) is listed in the table below. (API methods can have a shorthand alias name which can be used in the syntax instead of the name)

Method Alias Description

create

Creates a Customer

delete

Deletes a Customer by id

find

Finds a Customer by id

search

Finds all Transactions that match the query and returns a ResourceCollection

update

Updates a Customer

The customer API method(s) has the following set of parameters listed in the table below:

Method Parameter Description Type

create

request

The request

CustomerRequest

delete

id

The id of the Customer

String

find

associationFilterId

The id of the association filter to use

String

find

id

The id of the Customer

String

search

query

The request query to use for search

CustomerSearchRequest

update

id

The id of the Customer

String

update

request

The request

CustomerRequest

In addition to the parameters above, the customer API can also use from the 14 endpoint query option which is listed in the Query Parameters section.

Any of the parameters can be provided in either the endpoint URI, or dynamically in a message header. The message header name must be of the format CamelBraintree.parameter. The inBody parameter overrides message header, i.e. the endpoint parameter inBody=myParameterNameHere would override a CamelBraintree.myParameterNameHere header.

API: dispute

Only producer is supported

The dispute API has 7 method(s) which is represented by the following method signatures (an API method may have multiple signatures due to overloading):

com.braintreegateway.Result<com.braintreegateway.Dispute> accept(String id);

com.braintreegateway.Result<com.braintreegateway.DisputeEvidence> addFileEvidence(String disputeId, String documentId);

com.braintreegateway.Result<com.braintreegateway.DisputeEvidence> addFileEvidence(String disputeId, com.braintreegateway.FileEvidenceRequest fileEvidenceRequest);

com.braintreegateway.Result<com.braintreegateway.DisputeEvidence> addTextEvidence(String id, String content);

com.braintreegateway.Result<com.braintreegateway.DisputeEvidence> addTextEvidence(String id, com.braintreegateway.TextEvidenceRequest textEvidenceRequest);

com.braintreegateway.Result<com.braintreegateway.Dispute> finalize(String id);

com.braintreegateway.Dispute find(String id);

com.braintreegateway.Result<com.braintreegateway.Dispute> removeEvidence(String disputeId, String evidenceId);

com.braintreegateway.PaginatedCollection<com.braintreegateway.Dispute> search(com.braintreegateway.DisputeSearchRequest query);

The dispute API is defined in the syntax as follows:

braintree:dispute/methodName?[parameters]

The 7 method(s) is listed in the table below. (API methods can have a shorthand alias name which can be used in the syntax instead of the name)

Method Alias Description

accept

Accept a Dispute, given a dispute ID

addFileEvidence

Add File Evidence to a Dispute, given an ID and a FileEvidenceRequest File evidence request

addTextEvidence

Add Text Evidence to a Dispute, given an ID and content

finalize

Finalize a Dispute, given an ID

find

Returns a Dispute, given an ID

removeEvidence

Remove Evidence from a Dispute, given an ID and a DisputeEvidence ID

search

Finds all Disputes that match the query

The dispute API method(s) has the following set of parameters listed in the table below:

Method Parameter Description Type

accept

id

The dispute id to accept

String

addFileEvidence

disputeId

The dispute id to add text evidence to

String

addFileEvidence

documentId

The document id of a previously uploaded document

String

addFileEvidence

fileEvidenceRequest

The file evidence request for the dispute

FileEvidenceRequest

addTextEvidence

content

The content of the text evidence for the dispute

String

addTextEvidence

id

The dispute id to add text evidence to

String

addTextEvidence

textEvidenceRequest

The text evidence request for the dispute

TextEvidenceRequest

finalize

id

The dispute id to finalize

String

find

id

The dispute id to find

String

removeEvidence

disputeId

The dispute id to remove evidence from

String

removeEvidence

evidenceId

The evidence id to remove

String

search

query

The query for what disputes to find

DisputeSearchRequest

In addition to the parameters above, the dispute API can also use from the 14 endpoint query option which is listed in the Query Parameters section.

Any of the parameters can be provided in either the endpoint URI, or dynamically in a message header. The message header name must be of the format CamelBraintree.parameter. The inBody parameter overrides message header, i.e. the endpoint parameter inBody=myParameterNameHere would override a CamelBraintree.myParameterNameHere header.

API: documentUpload

Only producer is supported

The documentUpload API has 1 method(s) which is represented by the following method signatures (an API method may have multiple signatures due to overloading):

com.braintreegateway.Result<com.braintreegateway.DocumentUpload> create(com.braintreegateway.DocumentUploadRequest request);

The documentUpload API is defined in the syntax as follows:

braintree:documentUpload/methodName?[parameters]

The 1 method(s) is listed in the table below. (API methods can have a shorthand alias name which can be used in the syntax instead of the name)

Method Alias Description

create

The documentUpload API method(s) has the following set of parameters listed in the table below:

Method Parameter Description Type

create

request

DocumentUploadRequest

In addition to the parameters above, the documentUpload API can also use from the 14 endpoint query option which is listed in the Query Parameters section.

Any of the parameters can be provided in either the endpoint URI, or dynamically in a message header. The message header name must be of the format CamelBraintree.parameter. The inBody parameter overrides message header, i.e. the endpoint parameter inBody=myParameterNameHere would override a CamelBraintree.myParameterNameHere header.

API: merchantAccount

Only producer is supported

The merchantAccount API has 5 method(s) which is represented by the following method signatures (an API method may have multiple signatures due to overloading):

com.braintreegateway.Result<com.braintreegateway.MerchantAccount> create(com.braintreegateway.MerchantAccountRequest request);

com.braintreegateway.Result<com.braintreegateway.MerchantAccount> createForCurrency(com.braintreegateway.MerchantAccountCreateForCurrencyRequest request);

com.braintreegateway.PaginatedResult<com.braintreegateway.MerchantAccount> fetchMerchantAccounts(int page);

com.braintreegateway.MerchantAccount find(String id);

com.braintreegateway.Result<com.braintreegateway.MerchantAccount> update(String id, com.braintreegateway.MerchantAccountRequest request);

The merchantAccount API is defined in the syntax as follows:

braintree:merchantAccount/methodName?[parameters]

The 5 method(s) is listed in the table below. (API methods can have a shorthand alias name which can be used in the syntax instead of the name)

Method Alias Description

create

createForCurrency

fetchMerchantAccounts

find

update

The merchantAccount API method(s) has the following set of parameters listed in the table below:

Method Parameter Description Type

create

request

MerchantAccountRequest

createForCurrency

currencyRequest

MerchantAccountCreateForCurrencyRequest

fetchMerchantAccounts

page

Integer

find

id

String

update

id

String

update

request

MerchantAccountRequest

In addition to the parameters above, the merchantAccount API can also use from the 14 endpoint query option which is listed in the Query Parameters section.

Any of the parameters can be provided in either the endpoint URI, or dynamically in a message header. The message header name must be of the format CamelBraintree.parameter. The inBody parameter overrides message header, i.e. the endpoint parameter inBody=myParameterNameHere would override a CamelBraintree.myParameterNameHere header.

API: paymentMethod

Only producer is supported

The paymentMethod API has 6 method(s) which is represented by the following method signatures (an API method may have multiple signatures due to overloading):

com.braintreegateway.Result<com.braintreegateway.? extends PaymentMethod> create(com.braintreegateway.PaymentMethodRequest request);

com.braintreegateway.Result<com.braintreegateway.? extends PaymentMethod> delete(String token);

com.braintreegateway.Result<com.braintreegateway.? extends PaymentMethod> delete(String token, com.braintreegateway.PaymentMethodDeleteRequest request);

com.braintreegateway.PaymentMethod find(String token);

com.braintreegateway.Result<com.braintreegateway.PaymentMethodNonce> grant(String token);

com.braintreegateway.Result<com.braintreegateway.PaymentMethodNonce> grant(String token, com.braintreegateway.PaymentMethodGrantRequest grantRequest);

com.braintreegateway.Result<com.braintreegateway.? extends PaymentMethod> revoke(String token);

com.braintreegateway.Result<com.braintreegateway.? extends PaymentMethod> update(String token, com.braintreegateway.PaymentMethodRequest request);

The paymentMethod API is defined in the syntax as follows:

braintree:paymentMethod/methodName?[parameters]

The 6 method(s) is listed in the table below. (API methods can have a shorthand alias name which can be used in the syntax instead of the name)

Method Alias Description

create

delete

find

grant

revoke

update

The paymentMethod API method(s) has the following set of parameters listed in the table below:

Method Parameter Description Type

create

request

PaymentMethodRequest

delete

deleteRequest

PaymentMethodDeleteRequest

delete

token

String

find

token

String

grant

grantRequest

PaymentMethodGrantRequest

grant

token

String

revoke

token

String

update

request

PaymentMethodRequest

update

token

String

In addition to the parameters above, the paymentMethod API can also use from the 14 endpoint query option which is listed in the Query Parameters section.

Any of the parameters can be provided in either the endpoint URI, or dynamically in a message header. The message header name must be of the format CamelBraintree.parameter. The inBody parameter overrides message header, i.e. the endpoint parameter inBody=myParameterNameHere would override a CamelBraintree.myParameterNameHere header.

API: paymentMethodNonce

Only producer is supported

The paymentMethodNonce API has 2 method(s) which is represented by the following method signatures (an API method may have multiple signatures due to overloading):

com.braintreegateway.Result<com.braintreegateway.PaymentMethodNonce> create(String paymentMethodToken);

com.braintreegateway.Result<com.braintreegateway.PaymentMethodNonce> create(com.braintreegateway.PaymentMethodNonceRequest request);

com.braintreegateway.PaymentMethodNonce find(String paymentMethodNonce);

The paymentMethodNonce API is defined in the syntax as follows:

braintree:paymentMethodNonce/methodName?[parameters]

The 2 method(s) is listed in the table below. (API methods can have a shorthand alias name which can be used in the syntax instead of the name)

Method Alias Description

create

find

The paymentMethodNonce API method(s) has the following set of parameters listed in the table below:

Method Parameter Description Type

create

paymentMethodToken

String

create

request

PaymentMethodNonceRequest

find

paymentMethodNonce

String

In addition to the parameters above, the paymentMethodNonce API can also use from the 14 endpoint query option which is listed in the Query Parameters section.

Any of the parameters can be provided in either the endpoint URI, or dynamically in a message header. The message header name must be of the format CamelBraintree.parameter. The inBody parameter overrides message header, i.e. the endpoint parameter inBody=myParameterNameHere would override a CamelBraintree.myParameterNameHere header.

API: report

Only producer is supported

The report API has 1 method(s) which is represented by the following method signatures (an API method may have multiple signatures due to overloading):

com.braintreegateway.Result<com.braintreegateway.TransactionLevelFeeReport> transactionLevelFees(com.braintreegateway.TransactionLevelFeeReportRequest request);

The report API is defined in the syntax as follows:

braintree:report/methodName?[parameters]

The 1 method(s) is listed in the table below. (API methods can have a shorthand alias name which can be used in the syntax instead of the name)

Method Alias Description

transactionLevelFees

Retrieves a Transaction-Level Fee Report

The report API method(s) has the following set of parameters listed in the table below:

Method Parameter Description Type

transactionLevelFees

request

The request

TransactionLevelFeeReportRequest

In addition to the parameters above, the report API can also use from the 14 endpoint query option which is listed in the Query Parameters section.

Any of the parameters can be provided in either the endpoint URI, or dynamically in a message header. The message header name must be of the format CamelBraintree.parameter. The inBody parameter overrides message header, i.e. the endpoint parameter inBody=myParameterNameHere would override a CamelBraintree.myParameterNameHere header.

API: settlementBatchSummary

Only producer is supported

The settlementBatchSummary API has 1 method(s) which is represented by the following method signatures (an API method may have multiple signatures due to overloading):

com.braintreegateway.Result<com.braintreegateway.SettlementBatchSummary> generate(java.util.Calendar settlementDate);

com.braintreegateway.Result<com.braintreegateway.SettlementBatchSummary> generate(java.util.Calendar settlementDate, String groupByCustomField);

The settlementBatchSummary API is defined in the syntax as follows:

braintree:settlementBatchSummary/methodName?[parameters]

The 1 method(s) is listed in the table below. (API methods can have a shorthand alias name which can be used in the syntax instead of the name)

Method Alias Description

generate

The settlementBatchSummary API method(s) has the following set of parameters listed in the table below:

Method Parameter Description Type

generate

groupByCustomField

String

generate

settlementDate

Calendar

In addition to the parameters above, the settlementBatchSummary API can also use from the 14 endpoint query option which is listed in the Query Parameters section.

Any of the parameters can be provided in either the endpoint URI, or dynamically in a message header. The message header name must be of the format CamelBraintree.parameter. The inBody parameter overrides message header, i.e. the endpoint parameter inBody=myParameterNameHere would override a CamelBraintree.myParameterNameHere header.

API: subscription

Only producer is supported

The subscription API has 7 method(s) which is represented by the following method signatures (an API method may have multiple signatures due to overloading):

com.braintreegateway.Result<com.braintreegateway.Subscription> cancel(String id);

com.braintreegateway.Result<com.braintreegateway.Subscription> create(com.braintreegateway.SubscriptionRequest request);

com.braintreegateway.Result<com.braintreegateway.Subscription> delete(String customerId, String id);

com.braintreegateway.Subscription find(String id);

com.braintreegateway.Result<com.braintreegateway.Transaction> retryCharge(String subscriptionId);

com.braintreegateway.Result<com.braintreegateway.Transaction> retryCharge(String subscriptionId, Boolean submitForSettlement);

com.braintreegateway.Result<com.braintreegateway.Transaction> retryCharge(String subscriptionId, java.math.BigDecimal amount);

com.braintreegateway.Result<com.braintreegateway.Transaction> retryCharge(String subscriptionId, java.math.BigDecimal amount, Boolean submitForSettlement);

com.braintreegateway.ResourceCollection<com.braintreegateway.Subscription> search(com.braintreegateway.SubscriptionSearchRequest searchRequest);

com.braintreegateway.Result<com.braintreegateway.Subscription> update(String id, com.braintreegateway.SubscriptionRequest request);

The subscription API is defined in the syntax as follows:

braintree:subscription/methodName?[parameters]

The 7 method(s) is listed in the table below. (API methods can have a shorthand alias name which can be used in the syntax instead of the name)

Method Alias Description

cancel

Cancels the Subscription with the given id

create

Creates a Subscription

delete

find

Finds a Subscription by id

retryCharge

search

Search for a Subscription

update

Updates a Subscription

The subscription API method(s) has the following set of parameters listed in the table below:

Method Parameter Description Type

cancel

id

Of the Subscription to cancel

String

create

request

The request

SubscriptionRequest

delete

customerId

String

delete

id

String

find

id

The id of the Subscription

String

retryCharge

amount

BigDecimal

retryCharge

submitForSettlement

Boolean

retryCharge

subscriptionId

String

search

searchRequest

The SubscriptionSearchRequest

SubscriptionSearchRequest

update

id

The id of the Subscription

String

update

request

The request

SubscriptionRequest

In addition to the parameters above, the subscription API can also use from the 14 endpoint query option which is listed in the Query Parameters section.

Any of the parameters can be provided in either the endpoint URI, or dynamically in a message header. The message header name must be of the format CamelBraintree.parameter. The inBody parameter overrides message header, i.e. the endpoint parameter inBody=myParameterNameHere would override a CamelBraintree.myParameterNameHere header.

API: transaction

Only producer is supported

The transaction API has 13 method(s) which is represented by the following method signatures (an API method may have multiple signatures due to overloading):

com.braintreegateway.Result<com.braintreegateway.Transaction> cancelRelease(String id);

com.braintreegateway.Result<com.braintreegateway.Transaction> cloneTransaction(String id, com.braintreegateway.TransactionCloneRequest request);

com.braintreegateway.Result<com.braintreegateway.Transaction> credit(com.braintreegateway.TransactionRequest request);

com.braintreegateway.Transaction find(String id);

com.braintreegateway.Result<com.braintreegateway.Transaction> holdInEscrow(String id);

com.braintreegateway.Result<com.braintreegateway.Transaction> refund(String id);

com.braintreegateway.Result<com.braintreegateway.Transaction> refund(String id, com.braintreegateway.TransactionRefundRequest request);

com.braintreegateway.Result<com.braintreegateway.Transaction> refund(String id, java.math.BigDecimal amount);

com.braintreegateway.Result<com.braintreegateway.Transaction> releaseFromEscrow(String id);

com.braintreegateway.Result<com.braintreegateway.Transaction> sale(com.braintreegateway.TransactionRequest request);

com.braintreegateway.ResourceCollection<com.braintreegateway.Transaction> search(com.braintreegateway.TransactionSearchRequest query);

com.braintreegateway.Result<com.braintreegateway.Transaction> submitForPartialSettlement(String id, com.braintreegateway.TransactionRequest request);

com.braintreegateway.Result<com.braintreegateway.Transaction> submitForPartialSettlement(String id, java.math.BigDecimal amount);

com.braintreegateway.Result<com.braintreegateway.Transaction> submitForSettlement(String id);

com.braintreegateway.Result<com.braintreegateway.Transaction> submitForSettlement(String id, com.braintreegateway.TransactionRequest request);

com.braintreegateway.Result<com.braintreegateway.Transaction> submitForSettlement(String id, java.math.BigDecimal amount);

com.braintreegateway.Result<com.braintreegateway.Transaction> updateDetails(String id, com.braintreegateway.TransactionRequest request);

com.braintreegateway.Result<com.braintreegateway.Transaction> voidTransaction(String id);

The transaction API is defined in the syntax as follows:

braintree:transaction/methodName?[parameters]

The 13 method(s) is listed in the table below. (API methods can have a shorthand alias name which can be used in the syntax instead of the name)

Method Alias Description

cancelRelease

Cancels a pending release of a transaction with the given id from escrow

cloneTransaction

credit

Creates a credit Transaction

find

Finds a Transaction by id

holdInEscrow

Holds the transaction with the given id for escrow

refund

Refunds all or part of a previous sale Transaction

releaseFromEscrow

Submits the transaction with the given id for release

sale

Creates a sale Transaction

search

Finds all Transactions that match the query and returns a ResourceCollection

submitForPartialSettlement

Submits a partial settlement transaction for the given id

submitForSettlement

Submits the transaction with the given id to be settled along with a TransactionRequest object

updateDetails

Updates details for a transaction that has been submitted for settlement

voidTransaction

Voids the transaction with the given id

The transaction API method(s) has the following set of parameters listed in the table below:

Method Parameter Description Type

cancelRelease

id

Of the transaction to cancel release from escrow of

String

cloneTransaction

cloneRequest

TransactionCloneRequest

cloneTransaction

id

String

credit

request

The request

TransactionRequest

find

id

The id of the Transaction

String

holdInEscrow

id

Of the transaction to hold for escrow

String

refund

amount

BigDecimal

refund

id

String

refund

refundRequest

TransactionRefundRequest

releaseFromEscrow

id

Of the transaction to submit for release

String

sale

request

The request

TransactionRequest

search

query

The search query

TransactionSearchRequest

submitForPartialSettlement

amount

Of the partial settlement

BigDecimal

submitForPartialSettlement

id

Of the transaction to add the partial settlement transaction for

String

submitForPartialSettlement

request

The request

TransactionRequest

submitForSettlement

amount

To settle. must be less than or equal to the authorization amount.

BigDecimal

submitForSettlement

id

Of the transaction to submit for settlement

String

submitForSettlement

request

The request

TransactionRequest

updateDetails

id

Of the transaction to update the details for

String

updateDetails

request

The request

TransactionRequest

voidTransaction

id

Of the transaction to void

String

In addition to the parameters above, the transaction API can also use from the 14 endpoint query option which is listed in the Query Parameters section.

Any of the parameters can be provided in either the endpoint URI, or dynamically in a message header. The message header name must be of the format CamelBraintree.parameter. The inBody parameter overrides message header, i.e. the endpoint parameter inBody=myParameterNameHere would override a CamelBraintree.myParameterNameHere header.

API: webhookNotification

Only producer is supported

The webhookNotification API has 2 method(s) which is represented by the following method signatures (an API method may have multiple signatures due to overloading):

com.braintreegateway.WebhookNotification parse(String signature, String payload);

String verify(String challenge);

The webhookNotification API is defined in the syntax as follows:

braintree:webhookNotification/methodName?[parameters]

The 2 method(s) is listed in the table below. (API methods can have a shorthand alias name which can be used in the syntax instead of the name)

Method Alias Description

parse

verify

The webhookNotification API method(s) has the following set of parameters listed in the table below:

Method Parameter Description Type

parse

payload

String

parse

signature

String

verify

challenge

String

In addition to the parameters above, the webhookNotification API can also use from the 14 endpoint query option which is listed in the Query Parameters section.

Any of the parameters can be provided in either the endpoint URI, or dynamically in a message header. The message header name must be of the format CamelBraintree.parameter. The inBody parameter overrides message header, i.e. the endpoint parameter inBody=myParameterNameHere would override a CamelBraintree.myParameterNameHere header.

Examples

Blueprint

<?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>

More Information

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

Spring Boot Auto-Configuration

When using braintree with Spring Boot make sure to use the following Maven dependency to have support for auto configuration:

<dependency>
  <groupId>org.apache.camel.springboot</groupId>
  <artifactId>camel-braintree-starter</artifactId>
  <version>x.x.x</version>
  <!-- use the same version as your Camel core version -->
</dependency>

The component supports 4 options, which are listed below.

Name Description Default Type

camel.component.braintree.autowired-enabled

Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.

true

Boolean

camel.component.braintree.configuration

Component configuration. The option is a org.apache.camel.component.braintree.BraintreeConfiguration type.

BraintreeConfiguration

camel.component.braintree.enabled

Whether to enable auto configuration of the braintree component. This is enabled by default.

Boolean

camel.component.braintree.lazy-start-producer

Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel’s routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.

false

Boolean