[ 
https://issues.apache.org/jira/browse/CAMEL-12649?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16550564#comment-16550564
 ] 

ASF GitHub Bot commented on CAMEL-12649:
----------------------------------------

lburgazzoli closed pull request #2433: CAMEL-12649: camel-braintree - Upgraded 
Braintree Java SDK to 2.83.1 and exposed transaction level fees API
URL: https://github.com/apache/camel/pull/2433
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/components/camel-braintree/pom.xml 
b/components/camel-braintree/pom.xml
index 7ba0c32e674..737a743baf7 100644
--- a/components/camel-braintree/pom.xml
+++ b/components/camel-braintree/pom.xml
@@ -225,6 +225,11 @@
                   <proxyClass>com.braintreegateway.PlanGateway</proxyClass>
                   <fromJavadoc/>
                 </api>
+                <api>
+                  <apiName>report</apiName>
+                  <proxyClass>com.braintreegateway.ReportGateway</proxyClass>
+                  <fromJavadoc/>
+                </api>
                 <api>
                   <apiName>settlementBatchSummary</apiName>
                   
<proxyClass>com.braintreegateway.SettlementBatchSummaryGateway</proxyClass>
diff --git a/components/camel-braintree/src/main/docs/braintree-component.adoc 
b/components/camel-braintree/src/main/docs/braintree-component.adoc
index 202274a7552..686053991bc 100644
--- a/components/camel-braintree/src/main/docs/braintree-component.adoc
+++ b/components/camel-braintree/src/main/docs/braintree-component.adoc
@@ -121,6 +121,7 @@ Endpoint prefix can be one of:
 * paymentmethod
 * paymentmethodNonce
 * plan
+* report
 * settlementBatchSummary
 * subscription
 * transaction
@@ -568,7 +569,32 @@ braintree://plan/endpoint
 |all |  |  |List<com.braintreegateway.Plan>
 |====================================================
 
- 
+
+#### Endpoint prefix _report_
+
+The following endpoints can be invoked with the prefix *report* as
+follows:
+
+[source,java]
+---------------------------------
+braintree://plan/report?[options]
+---------------------------------
+
+[cols="<,<,<,<",options="header",]
+|==============================================================================================================
+|Endpoint |Shorthand Alias |Options |Result Body Type
+|transactionLevelFees |  | request 
|com.braintreegateway.Result<com.braintreegateway.TransactionLevelFeeReport>
+|==============================================================================================================
+
+[[Braintree-URIOptionsfortreport]]
+URI Options for _report_
+
+[cols="<,<",options="header",]
+|==============================================================
+|Name |Type
+|request |com.braintreegateway.TransactionLevelFeeReportRequest
+|==============================================================
+
 
 #### Endpoint prefix _settlementBatchSummary_
 
diff --git 
a/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/ReportGatewayIntegrationTest.java
 
b/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/ReportGatewayIntegrationTest.java
new file mode 100644
index 00000000000..ace38b42678
--- /dev/null
+++ 
b/components/camel-braintree/src/test/java/org/apache/camel/component/braintree/ReportGatewayIntegrationTest.java
@@ -0,0 +1,79 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.braintree;
+
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.List;
+
+import com.braintreegateway.TransactionLevelFeeReport;
+import com.braintreegateway.TransactionLevelFeeReportRequest;
+import com.braintreegateway.TransactionLevelFeeReportRow;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.braintree.internal.BraintreeApiCollection;
+import org.apache.camel.component.braintree.internal.ReportGatewayApiMethod;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Test class for {@link com.braintreegateway.ReportGateway} APIs.
+ */
+public class ReportGatewayIntegrationTest extends AbstractBraintreeTestSupport 
{
+
+    private static final Logger LOG = 
LoggerFactory.getLogger(ReportGatewayIntegrationTest.class);
+    private static final String PATH_PREFIX = 
BraintreeApiCollection.getCollection().getApiName(ReportGatewayApiMethod.class).getName();
+
+    @Test
+    public void testTransactionLevelFees() throws Exception {
+        String merchantAccountId = 
System.getenv("CAMEL_BRAINTREE_MERCHANT_ACCOUNT_ID");
+        String reportDateString = System.getenv("CAMEL_BRAINTREE_REPORT_DATE");
+
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        Calendar reportDate = Calendar.getInstance();
+        reportDate.setTime(sdf.parse(reportDateString));
+
+        TransactionLevelFeeReportRequest request = new 
TransactionLevelFeeReportRequest()
+                .date(reportDate)
+                .merchantAccountId(merchantAccountId);
+
+        final com.braintreegateway.Result<TransactionLevelFeeReport> result = 
requestBody(
+                "direct://TRANSACTIONLEVELFEES",
+                request
+        );
+
+        assertNotNull("transactionLevelFees result", result);
+        assertTrue("transactionLevelFees success", result.isSuccess());
+        List<TransactionLevelFeeReportRow> rows = result.getTarget().getRows();
+        assertTrue("transactionLevelFeeRows found", rows.size() > 0);
+
+        LOG.debug("transactionLevelFees: " + result);
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            public void configure() {
+                // test route for transactionLevelFees
+                from("direct://TRANSACTIONLEVELFEES")
+                    .to("braintree://" + PATH_PREFIX + 
"/transactionLevelFees?inBody=request");
+
+            }
+        };
+    }
+}
diff --git a/parent/pom.xml b/parent/pom.xml
index 9561c118d29..f0fa4e8a4ae 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -98,7 +98,7 @@
     <bouncycastle-version>1.57</bouncycastle-version>
     <boxjavalibv2.version>3.2.1</boxjavalibv2.version>
     <box-java-sdk-version>2.10.0</box-java-sdk-version>
-    <braintree-gateway-version>2.81.0</braintree-gateway-version>
+    <braintree-gateway-version>2.83.1</braintree-gateway-version>
     <brave-zipkin-version>5.1.2</brave-zipkin-version>
     <build-helper-maven-plugin-version>1.10</build-helper-maven-plugin-version>
     <c3p0-version>0.9.5.2</c3p0-version>


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Upgrade Braintree SDK to 2.83.1 and Expose Transaction Fees API
> ---------------------------------------------------------------
>
>                 Key: CAMEL-12649
>                 URL: https://issues.apache.org/jira/browse/CAMEL-12649
>             Project: Camel
>          Issue Type: New Feature
>          Components: camel-braintree
>            Reporter: Russ Johnson
>            Priority: Major
>             Fix For: 2.22.0
>
>
> With the release of version 2.83.1 of the Braintree Java SDK 
> ([https://github.com/braintree/braintree_java/releases/tag/2.83.1|https://github.com/braintree/braintree_java/releases/tag/2.83.0])
>  the transaction fees, the Transaction Level Fee Report has become available.
> The intention of this ticket is to upgrade the Braintree Java SDK version and 
> expose the Braintree Transaction Level Fee Report in the Component.
> Transaction Level Fees Reports are describe here: 
> [https://articles.braintreepayments.com/control-panel/reporting/transaction-level-fee-report]
>  but the API is not yet documented



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to