public class BraintreeGateway extends Object
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());
}
}
| Constructor and 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) |
public BraintreeGateway(Environment environment, String merchantId, String publicKey, String privateKey)
environment - Either Environment.SANDBOX or
Environment.PRODUCTION.merchantId - the merchant id provided by Braintree.publicKey - the public key provided by Braintree.privateKey - the private key provided by Braintree.public BraintreeGateway(String environment, String merchantId, String publicKey, String privateKey)
public BraintreeGateway(String accessToken)
public static BraintreeGateway forPartner(Environment environment, String partnerId, String publicKey, String privateKey)
environment - Either Environment.SANDBOX or
Environment.PRODUCTION.partnerId - the partner id provided by Braintree.publicKey - the public key provided by Braintree.privateKey - the private key provided by Braintree.public AddOnGateway addOn()
AddOnGateway for interacting with AddOn
objects.AddOnGateway.public AddressGateway address()
AddressGateway for interacting with Address
objects.AddressGateway.public ClientTokenGateway clientToken()
public CreditCardGateway creditCard()
CreditCardGateway for interacting with
CreditCard objects.CreditCardGateway.public CreditCardVerificationGateway creditCardVerification()
public UsBankAccountVerificationGateway usBankAccountVerification()
public CustomerGateway customer()
CustomerGateway for interacting with Customer
objects.CustomerGateway.public DiscountGateway discount()
DiscountGateway for interacting with Discount
objects.DiscountGateway.public DisputeGateway dispute()
DisputeGateway for interacting with Dispute
objects.DisputeGateway.public Configuration getConfiguration()
public PaymentMethodGateway paymentMethod()
public PaymentMethodNonceGateway paymentMethodNonce()
public PayPalAccountGateway paypalAccount()
public UsBankAccountGateway usBankAccount()
public IdealPaymentGateway idealPayment()
public PlanGateway plan()
PlanGateway for interacting with Plan objects.PlanGateway.public SettlementBatchSummaryGateway settlementBatchSummary()
public SubscriptionGateway subscription()
SubscriptionGateway for interacting with
Subscription objects.SubscriptionGateway.public TransactionGateway transaction()
TransactionGateway for interacting with
Transaction objects.TransactionGateway.public TransactionLineItemGateway transactionLineItem()
TransactionLineItemGateway for interacting with
TransactionLineItem objects.TransactionLineItemGateway.public TransparentRedirectGateway transparentRedirect()
public String trData(Request trData, String redirectURL)
Request
and redirect URLtrData - the transparent redirect data as a Request object.redirectURL - the redirect URL for the user after the transparent redirect
POST.public WebhookNotificationGateway webhookNotification()
public WebhookTestingGateway webhookTesting()
public MerchantAccountGateway merchantAccount()
MerchantAccountGateway for interacting with
MerchantAccount objects.MerchantAccountGateway.public MerchantGateway merchant()
public OAuthGateway oauth()
public TestingGateway testing()
public DocumentUploadGateway documentUpload()
public ReportGateway report()
Copyright © 2013–2018. All rights reserved.