- Notifications
You must be signed in to change notification settings - Fork103
braintree/braintree_java
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
The Braintree Java library provides integration access to the Braintree Gateway.
The Payment Card Industry (PCI) Council hasmandated that early versions of TLS be retired from service. All organizations that handle credit card information are required to comply with this standard. As part of this obligation, Braintree is updating its services to require TLS 1.2 for all HTTPS connections. Braintree will also require HTTP/1.1 for all connections. Please see ourtechnical documentation for more information.
- none
Java version >= 8 is required. The Braintree Java SDK is tested against Java versions 8 and 11.
⚠️ The SSL certificates for Java SDK versions older than 2.75.0 are set to expire by March 30, 2026. If you do not update your SDK to the latest version with the updated certificates by March 30, 2026, 100% of your impacted traffic will fail
Braintree employs a deprecation policy for our SDKs. For more information on the statuses of an SDK check ourdeveloper docs.
| Major version number | Status | Released | Deprecated | Unsupported |
|---|---|---|---|---|
| 3.x.x | Active | June 2020 | TBA | TBA |
| 2.x.x | Inactive | April 2010 | June 2022 | June 2023 |
Updating from an Inactive, Deprecated, or Unsupported version of this SDK? Check ourMigration Guide for tips.
importjava.math.BigDecimal;importcom.braintreegateway.*;publicclassBraintreeExample {publicstaticvoidmain(String[]args) {BraintreeGatewaygateway =newBraintreeGateway(Environment.SANDBOX,"the_merchant_id","the_public_key","the_private_key" );TransactionRequestrequest =newTransactionRequest() .amount(newBigDecimal("1000.00")) .paymentMethodNonce(nonceFromTheClient) .options() .submitForSettlement(true) .done();Result<Transaction>result =gateway.transaction().sale(request);if (result.isSuccess()) {Transactiontransaction =result.getTarget();System.out.println("Success!: " +transaction.getId()); }elseif (result.getTransaction() !=null) {Transactiontransaction =result.getTransaction();System.out.println("Error processing transaction:");System.out.println(" Status: " +transaction.getStatus());System.out.println(" Code: " +transaction.getProcessorResponseCode());System.out.println(" Text: " +transaction.getProcessorResponseText()); }else {for (ValidationErrorerror :result.getErrors().getAllDeepValidationErrors()) {System.out.println("Attribute: " +error.getAttribute());System.out.println(" Code: " +error.getCode());System.out.println(" Message: " +error.getMessage()); } } }}
With Maven installed, this package can be built simply by running this command:
mvn packageThe resulting jar file will be produced in the directory named "target".
Maven Central, which should be enabled by default. No additional repositories are required.<dependency> <groupId>com.braintreepayments.gateway</groupId> <artifactId>braintree-java</artifactId> <version>PUT VERSION NUMBER HERE</version></dependency>See ourdevelopment notes.
A list of open source projects that help power Braintree can be foundhere.
See the LICENSE file.
About
Braintree Java library
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.