Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Braintree Java library

License

NotificationsYou must be signed in to change notification settings

braintree/braintree_java

Repository files navigation

The Braintree Java library provides integration access to the Braintree Gateway.

Please Note

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.

Dependencies

  • none

Java version >= 8 is required. The Braintree Java SDK is tested against Java versions 8 and 11.

Versions

⚠️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 numberStatusReleasedDeprecatedUnsupported
3.x.xActiveJune 2020TBATBA
2.x.xInactiveApril 2010June 2022June 2023

Documentation

Updating from an Inactive, Deprecated, or Unsupported version of this SDK? Check ourMigration Guide for tips.

Quick Start Example

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());            }        }    }}

Maven

With Maven installed, this package can be built simply by running this command:

 mvn package

The resulting jar file will be produced in the directory named "target".

In repositories:

 Maven Central, which should be enabled by default. No additional repositories are required.

In dependencies

<dependency>  <groupId>com.braintreepayments.gateway</groupId>  <artifactId>braintree-java</artifactId>  <version>PUT VERSION NUMBER HERE</version></dependency>

Development

See ourdevelopment notes.

Open Source Attribution

A list of open source projects that help power Braintree can be foundhere.

License

See the LICENSE file.

Packages

No packages published

Contributors57

Languages


[8]ページ先頭

©2009-2025 Movatter.jp