Package com.braintreegateway
Class BraintreeGateway
- java.lang.Object
-
- com.braintreegateway.BraintreeGateway
-
public class BraintreeGateway extends Object
This is the primary interface to the Braintree Gateway. It is used to interact with: Quick Start Example:import java.math.BigDecimal; import com.braintreegateway.*; public class BraintreeExample { public static void main(String[] args) { BraintreeGateway gateway = new BraintreeGateway(Environment.SANDBOX, "the_merchant_id", "the_public_key", "the_private_key"); TransactionRequest request = new TransactionRequest().amount(new BigDecimal("100.00")).creditCard().number("4111111111111111").expirationDate("05/2012").done(); Transaction transaction = gateway.transaction().sale(request).getTarget(); System.out.println("Transaction ID: " + transaction.getId()); System.out.println("Status: " + transaction.getStatus()); } }
-
-
Field Summary
Fields Modifier and Type Field Description private ConfigurationconfigurationGraphQLClientgraphQLClientprivate Httphttp
-
Constructor Summary
Constructors Constructor Description BraintreeGateway(Environment environment, String merchantId, String publicKey, String privateKey)Instantiates a BraintreeGateway.BraintreeGateway(String accessToken)BraintreeGateway(String clientId, String clientSecret)BraintreeGateway(String environment, String merchantId, String publicKey, String privateKey)
-
Method Summary
-
-
-
Field Detail
-
configuration
private Configuration configuration
-
http
private Http http
-
graphQLClient
public GraphQLClient graphQLClient
-
-
Constructor Detail
-
BraintreeGateway
public BraintreeGateway(Environment environment, String merchantId, String publicKey, String privateKey)
Instantiates a BraintreeGateway. Use the values provided by Braintree.- Parameters:
environment- EitherEnvironment.SANDBOXorEnvironment.PRODUCTION.merchantId- the merchant id provided by Braintree.publicKey- the public key provided by Braintree.privateKey- the private key provided by Braintree.
-
BraintreeGateway
public BraintreeGateway(String environment, String merchantId, String publicKey, String privateKey)
-
BraintreeGateway
public BraintreeGateway(String accessToken)
-
-
Method Detail
-
forPartner
public static BraintreeGateway forPartner(Environment environment, String partnerId, String publicKey, String privateKey)
Returns a BraintreeGateway specifically for Partner usage. Unless you are a partner, use the regular constructor instead.- Parameters:
environment- EitherEnvironment.SANDBOXorEnvironment.PRODUCTION.partnerId- the partner id provided by Braintree.publicKey- the public key provided by Braintree.privateKey- the private key provided by Braintree.- Returns:
- a BraintreeGateway specifically for Partner usage
-
addOn
public AddOnGateway addOn()
Returns anAddOnGatewayfor interacting withAddOnobjects.- Returns:
- an
AddOnGateway.
-
address
public AddressGateway address()
Returns anAddressGatewayfor interacting withAddressobjects.- Returns:
- an
AddressGateway.
-
clientToken
public ClientTokenGateway clientToken()
-
creditCard
public CreditCardGateway creditCard()
Returns anCreditCardGatewayfor interacting withCreditCardobjects.- Returns:
- an
CreditCardGateway.
-
creditCardVerification
public CreditCardVerificationGateway creditCardVerification()
-
usBankAccountVerification
public UsBankAccountVerificationGateway usBankAccountVerification()
-
customer
public CustomerGateway customer()
Returns anCustomerGatewayfor interacting withCustomerobjects.- Returns:
- an
CustomerGateway.
-
discount
public DiscountGateway discount()
Returns anDiscountGatewayfor interacting withDiscountobjects.- Returns:
- an
DiscountGateway.
-
dispute
public DisputeGateway dispute()
Returns aDisputeGatewayfor interacting withDisputeobjects.- Returns:
- an
DisputeGateway.
-
getConfiguration
public Configuration getConfiguration()
-
paymentMethod
public PaymentMethodGateway paymentMethod()
-
paymentMethodNonce
public PaymentMethodNonceGateway paymentMethodNonce()
-
paypalAccount
public PayPalAccountGateway paypalAccount()
-
sepaDirectDebitAccount
public SepaDirectDebitAccountGateway sepaDirectDebitAccount()
-
usBankAccount
public UsBankAccountGateway usBankAccount()
-
plan
public PlanGateway plan()
Returns anPlanGatewayfor interacting withPlanobjects.- Returns:
- an
PlanGateway.
-
settlementBatchSummary
public SettlementBatchSummaryGateway settlementBatchSummary()
-
subscription
public SubscriptionGateway subscription()
Returns anSubscriptionGatewayfor interacting withSubscriptionobjects.- Returns:
- an
SubscriptionGateway.
-
threeDSecure
public ThreeDSecureGateway threeDSecure()
Returns anThreeDSecureGatewayfor interacting with 3D Secure.- Returns:
- an
ThreeDSecureGateway.
-
transaction
public TransactionGateway transaction()
Returns anTransactionGatewayfor interacting withTransactionobjects.- Returns:
- an
TransactionGateway.
-
transactionLineItem
public TransactionLineItemGateway transactionLineItem()
Returns anTransactionLineItemGatewayfor interacting withTransactionLineItemobjects.- Returns:
- an
TransactionLineItemGateway.
-
webhookNotification
public WebhookNotificationGateway webhookNotification()
-
webhookTesting
public WebhookTestingGateway webhookTesting()
-
merchantAccount
public MerchantAccountGateway merchantAccount()
Returns anMerchantAccountGatewayfor interacting withMerchantAccountobjects.- Returns:
- an
MerchantAccountGateway.
-
merchant
public MerchantGateway merchant()
-
oauth
public OAuthGateway oauth()
-
testing
public TestingGateway testing()
-
documentUpload
public DocumentUploadGateway documentUpload()
-
report
public ReportGateway report()
-
exchangeRateQuote
public ExchangeRateQuoteGateway exchangeRateQuote()
-
-