def create(params): """ Creates a transaction. Amount and type are required. Also, a credit card, customer_id or payment_method_token is required. :: result = braintree.Transaction.sale({ "type": braintree.Transaction.Type.Sale, "amount": "100.00", "payment_method_token": "my_token" }) result = braintree.Transaction.sale({ "type": braintree.Transaction.Type.Sale, "amount": "100.00", "credit_card": { "number": "4111111111111111", "expiration_date": "12/2012" } }) result = braintree.Transaction.sale({ "type": braintree.Transaction.Type.Sale, "amount": "100.00", "customer_id": "my_customer_id" }) """ return Configuration.gateway().transaction.create(params)
def transparent_redirect_create_url(): """ Returns the url to be used for creating Transactions through transparent redirect. """ warnings.warn("Please use TransparentRedirect.url instead", DeprecationWarning) return Configuration.gateway().transaction.transparent_redirect_create_url()
def hold_in_escrow(transaction_id): """ Holds an existing submerchant transaction for escrow. It expects a transaction_id.:: result = braintree.Transaction.hold_in_escrow("my_transaction_id") """ return Configuration.gateway().transaction.hold_in_escrow(transaction_id)
def find(transaction_id): """ Find a transaction, given a transaction_id. This does not return a result object. This will raise a :class:`NotFoundError <braintree.exceptions.not_found_error.NotFoundError>` if the provided credit_card_id is not found. :: transaction = braintree.Transaction.find("my_transaction_id") """ return Configuration.gateway().transaction.find(transaction_id)
def transparent_redirect_create_url(): """ Returns the url to be used for creating Transactions through transparent redirect. """ warnings.warn("Please use TransparentRedirect.url instead", DeprecationWarning) return Configuration.gateway( ).transaction.transparent_redirect_create_url()
def confirm_transparent_redirect(query_string): """ Confirms a transparent redirect request. It expects the query string from the redirect request. The query string should _not_ include the leading "?" character. :: result = braintree.Transaction.confirm_transparent_redirect_request("foo=bar&id=12345") """ warnings.warn("Please use TransparentRedirect.confirm instead", DeprecationWarning) return Configuration.gateway().transaction.confirm_transparent_redirect(query_string)
def hold_in_escrow(transaction_id): """ Holds an existing submerchant transaction for escrow. It expects a transaction_id.:: result = braintree.Transaction.hold_in_escrow("my_transaction_id") """ return Configuration.gateway().transaction.hold_in_escrow( transaction_id)
def cancel_release(transaction_id): """ Cancels a pending release from escrow for a transaction. Requires the transaction id:: result = braintree.Transaction.cancel_release("my_transaction_id") """ return Configuration.gateway().transaction.cancel_release(transaction_id)
def void(transaction_id): """ Voids an existing transaction. It expects a transaction_id.:: result = braintree.Transaction.void("my_transaction_id") """ return Configuration.gateway().transaction.void(transaction_id)
def release_from_escrow(transaction_id): """ Submits an escrowed transaction for release. Requires the transaction id:: result = braintree.Transaction.release_from_escrow("my_transaction_id") """ return Configuration.gateway().transaction.release_from_escrow(transaction_id)
def submit_for_settlement(transaction_id, amount=None): """ Submits an authorized transaction for settlement. Requires the transaction id:: result = braintree.Transaction.submit_for_settlement("my_transaction_id") """ return Configuration.gateway().transaction.submit_for_settlement(transaction_id, amount)
def refund(transaction_id, amount=None): """ Refunds an existing transaction. It expects a transaction_id.:: result = braintree.Transaction.refund("my_transaction_id") """ return Configuration.gateway().transaction.refund(transaction_id, amount)
def submit_for_settlement(transaction_id, amount=None): """ Submits an authorized transaction for settlement. Requires the transaction id:: result = braintree.Transaction.submit_for_settlement("my_transaction_id") """ return Configuration.gateway().transaction.submit_for_settlement( transaction_id, amount)
def release_from_escrow(transaction_id): """ Submits an escrowed transaction for release. Requires the transaction id:: result = braintree.Transaction.release_from_escrow("my_transaction_id") """ return Configuration.gateway().transaction.release_from_escrow( transaction_id)
def refund(transaction_id, amount=None): """ Refunds an existing transaction. It expects a transaction_id.:: result = braintree.Transaction.refund("my_transaction_id") """ return Configuration.gateway().transaction.refund( transaction_id, amount)
def cancel_release(transaction_id): """ Cancels a pending release from escrow for a transaction. Requires the transaction id:: result = braintree.Transaction.cancel_release("my_transaction_id") """ return Configuration.gateway().transaction.cancel_release( transaction_id)
def confirm_transparent_redirect(query_string): """ Confirms a transparent redirect request. It expects the query string from the redirect request. The query string should _not_ include the leading "?" character. :: result = braintree.Transaction.confirm_transparent_redirect_request("foo=bar&id=12345") """ warnings.warn("Please use TransparentRedirect.confirm instead", DeprecationWarning) return Configuration.gateway( ).transaction.confirm_transparent_redirect(query_string)
def tr_data_for_sale(tr_data, redirect_url): """ Builds tr_data for a Transaction of type Sale """ return Configuration.gateway().transaction.tr_data_for_sale(tr_data, redirect_url)
def tr_data_for_sale(tr_data, redirect_url): """ Builds tr_data for a Transaction of type Sale """ return Configuration.gateway().transaction.tr_data_for_sale( tr_data, redirect_url)
def search(*query): return Configuration.gateway().transaction.search(*query)
def clone_transaction(transaction_id, params): return Configuration.gateway().transaction.clone_transaction(transaction_id, params)
def clone_transaction(transaction_id, params): return Configuration.gateway().transaction.clone_transaction( transaction_id, params)