com.braintreegateway
Class TransactionGateway

java.lang.Object
  extended by com.braintreegateway.TransactionGateway

public class TransactionGateway
extends Object

Provides methods to interact with Transactions. E.g. sales, credits, refunds, searches, etc. This class does not need to be instantiated directly. Instead, use BraintreeGateway.transaction() to get an instance of this class:

 BraintreeGateway gateway = new BraintreeGateway(...);
 gateway.transaction().create(...)
 
For more detailed information on Transactions, see http://www.braintreepaymentsolutions.com/gateway/transaction-api


Field Summary
private  Configuration configuration
           
private  Http http
           
 
Constructor Summary
TransactionGateway(Http http, Configuration configuration)
           
 
Method Summary
 Result<Transaction> cancelRelease(String id)
          Cancels a pending release of a transaction with the given id from escrow.
 Result<Transaction> cloneTransaction(String id, TransactionCloneRequest request)
           
 Result<Transaction> confirmTransparentRedirect(String queryString)
          Deprecated. 
 Result<Transaction> credit(TransactionRequest request)
          Creates a credit Transaction.
 String creditTrData(TransactionRequest trData, String redirectURL)
          Creates transparent redirect data for a credit.
(package private)  List<Transaction> fetchTransactions(TransactionSearchRequest query, List<String> ids)
           
 Transaction find(String id)
          Finds a Transaction by id.
 Result<Transaction> holdInEscrow(String id)
          Holds the transaction with the given id for escrow.
 Result<Transaction> refund(String id)
          Refunds all or part of a previous sale Transaction.
 Result<Transaction> refund(String id, BigDecimal amount)
           
 Result<Transaction> releaseFromEscrow(String id)
          Submits the transaction with the given id for release.
 Result<Transaction> sale(TransactionRequest request)
          Creates a sale Transaction.
 String saleTrData(TransactionRequest trData, String redirectURL)
          Creates transparent redirect data for a sale.
 ResourceCollection<Transaction> search(TransactionSearchRequest query)
          Finds all Transactions that match the query and returns a ResourceCollection.
 Result<Transaction> submitForSettlement(String id)
          Submits the transaction with the given id for settlement.
 Result<Transaction> submitForSettlement(String id, BigDecimal amount)
          Submits the transaction with the given id to be settled for the given amount which must be less than or equal to the authorization amount.
 String transparentRedirectURLForCreate()
          Deprecated. 
 Result<Transaction> voidTransaction(String id)
          Voids the transaction with the given id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

http

private Http http

configuration

private Configuration configuration
Constructor Detail

TransactionGateway

public TransactionGateway(Http http,
                          Configuration configuration)
Method Detail

cloneTransaction

public Result<Transaction> cloneTransaction(String id,
                                            TransactionCloneRequest request)

confirmTransparentRedirect

@Deprecated
public Result<Transaction> confirmTransparentRedirect(String queryString)
Deprecated. 

Please use gateway.transparentRedirect().confirmTransaction() instead


credit

public Result<Transaction> credit(TransactionRequest request)
Creates a credit Transaction.

Parameters:
request - the request.
Returns:
a Result

creditTrData

public String creditTrData(TransactionRequest trData,
                           String redirectURL)
Creates transparent redirect data for a credit.

Parameters:
trData - the request.
redirectURL - the redirect URL.
Returns:
a String representing the trData.

find

public Transaction find(String id)
Finds a Transaction by id.

Parameters:
id - the id of the Transaction.
Returns:
the Transaction or raises a NotFoundException.

refund

public Result<Transaction> refund(String id)
Refunds all or part of a previous sale Transaction.

Parameters:
id - the id of the (sale) Transaction to refund.
Returns:
a Result.

refund

public Result<Transaction> refund(String id,
                                  BigDecimal amount)

sale

public Result<Transaction> sale(TransactionRequest request)
Creates a sale Transaction.

Parameters:
request - the request.
Returns:
a Result.

saleTrData

public String saleTrData(TransactionRequest trData,
                         String redirectURL)
Creates transparent redirect data for a sale.

Parameters:
trData - the request.
redirectURL - the redirect URL.
Returns:
a String representing the trData.

search

public ResourceCollection<Transaction> search(TransactionSearchRequest query)
Finds all Transactions that match the query and returns a ResourceCollection. See: http://www.braintreepaymentsolutions.com/gateway/transaction-api#searching

Returns:
a ResourceCollection.

fetchTransactions

List<Transaction> fetchTransactions(TransactionSearchRequest query,
                                    List<String> ids)

cancelRelease

public Result<Transaction> cancelRelease(String id)
Cancels a pending release of a transaction with the given id from escrow.

Parameters:
id - of the transaction to cancel release from escrow of.
Returns:
a Result.

holdInEscrow

public Result<Transaction> holdInEscrow(String id)
Holds the transaction with the given id for escrow.

Parameters:
id - of the transaction to hold for escrow.
Returns:
a Result.

releaseFromEscrow

public Result<Transaction> releaseFromEscrow(String id)
Submits the transaction with the given id for release.

Parameters:
id - of the transaction to submit for release.
Returns:
a Result.

submitForSettlement

public Result<Transaction> submitForSettlement(String id)
Submits the transaction with the given id for settlement.

Parameters:
id - of the transaction to submit for settlement.
Returns:
a Result.

submitForSettlement

public Result<Transaction> submitForSettlement(String id,
                                               BigDecimal amount)
Submits the transaction with the given id to be settled for the given amount which must be less than or equal to the authorization amount.

Parameters:
id - of the transaction to submit for settlement.
amount - to settle. must be less than or equal to the authorization amount.
Returns:
Result.

transparentRedirectURLForCreate

@Deprecated
public String transparentRedirectURLForCreate()
Deprecated. 

Please use gateway.transparentRedirect().url() instead


voidTransaction

public Result<Transaction> voidTransaction(String id)
Voids the transaction with the given id.

Parameters:
id - of the transaction to void.
Returns:
Result.


Copyright © 2013. All Rights Reserved.