コード例 #1
0
ファイル: transaction.py プロジェクト: dz/braintree_python
    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()
コード例 #2
0
ファイル: transaction.py プロジェクト: dz/braintree_python
    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)
コード例 #3
0
 def sale(ideal_payment_id, transactionRequest):
     request = transactionRequest.copy()
     request["payment_method_nonce"] = ideal_payment_id
     if not "options" in request:
         request["options"] = {}
     request["options"]["submit_for_settlement"] = True
     return Configuration.gateway().transaction.sale(request)
コード例 #4
0
    def confirm(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.TransparentRedirect.confirm("foo=bar&id=12345")
        """
        return Configuration.gateway().transparent_redirect.confirm(query_string)
コード例 #5
0
ファイル: transaction.py プロジェクト: dz/braintree_python
    def submit_for_settlement(transaction_id, amount=None):
        """
        Submits an authorized transaction for settlement. ::

            result = braintree.Transaction.submit_for_settlement("my_transaction_id")
        """

        return Configuration.gateway().transaction.submit_for_settlement(transaction_id, amount)
コード例 #6
0
ファイル: transaction.py プロジェクト: dz/braintree_python
    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)
コード例 #7
0
    def delete(credit_card_token):
        """
        Delete a credit card, given a credit_card_id::

            result = braintree.CreditCard.delete("my_credit_card_id")
        """

        return Configuration.gateway().credit_card.delete(credit_card_token)
コード例 #8
0
ファイル: address.py プロジェクト: omixen/braintree_python
    def delete(customer_id, address_id):
        """
        Delete an address, given a customer_id and address_id::

            result = braintree.Address.delete("my_customer_id", "my_address_id")
        """

        return Configuration.gateway().address.delete(customer_id, address_id)
コード例 #9
0
    def cancel(subscription_id):
        """
        Cancel a subscription by subscription_id:::

            result = braintree.Subscription.cancel("my_subscription_id")
        """

        return Configuration.gateway().subscription.cancel(subscription_id)
コード例 #10
0
ファイル: transaction.py プロジェクト: dz/braintree_python
    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)
コード例 #11
0
ファイル: customer.py プロジェクト: omixen/braintree_python
    def delete(customer_id):
        """
        Delete a customer, given a customer_id::

            result = braintree.Customer.delete("my_customer_id")
        """

        return Configuration.gateway().customer.delete(customer_id)
コード例 #12
0
    def from_nonce(nonce):
        """
        Convert a payment method nonce into a CreditCard. 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. ::

            credit_card = braintree.CreditCard.from_nonce("my_payment_method_nonce")
        """
        return Configuration.gateway().credit_card.from_nonce(nonce)
コード例 #13
0
    def find_all(transaction_id):
        """
        Find all line items on a transaction, given a transaction_id. This returns an array of TransactionLineItems.
        This will raise a :class:`NotFoundError <braintree.exceptions.not_found_error.NotFoundError>` if the provided
        transaction_id is not found. ::

            transaction_line_items = braintree.TransactionLineItem.find_all("my_transaction_id")
        """
        return Configuration.gateway().transaction_line_item.find_all(transaction_id)
コード例 #14
0
ファイル: transaction.py プロジェクト: dmehrab94/Biponi-1
    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)
コード例 #15
0
ファイル: credit_card.py プロジェクト: DongHuaLu/mdcom
    def find(credit_card_token):
        """
        Find a credit card, given a credit_card_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. ::

            credit_card = braintree.CreditCard.find("my_credit_card_token")
        """
        return Configuration.gateway().credit_card.find(credit_card_token)
コード例 #16
0
ファイル: address.py プロジェクト: braintree/braintree_python
    def find(customer_id, address_id):
        """
        Find an address, given a customer_id and address_id. This does not return
        a result object. This will raise a :class:`NotFoundError <braintree.exceptions.not_found_error.NotFoundError>` if the provided
        customer_id/address_id are not found. ::

            address = braintree.Address.find("my_customer_id", "my_address_id")
        """
        return Configuration.gateway().address.find(customer_id, address_id)
コード例 #17
0
ファイル: transaction.py プロジェクト: dz/braintree_python
    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)
コード例 #18
0
ファイル: customer.py プロジェクト: omixen/braintree_python
    def update(customer_id, params={}):
        """
        Update an existing Customer by customer_id.  The params are similar to create::

            result = braintree.Customer.update("my_customer_id", {
                "last_name": "Smith"
            })
        """

        return Configuration.gateway().customer.update(customer_id, params)
コード例 #19
0
ファイル: dispute.py プロジェクト: braintree/braintree_python
    def remove_evidence(id, evidence_id):
        """
        Remove evidence on a dispute.
        This will raise a :class:`NotFoundError <braintree.exceptions.not_found_error.NotFoundError>` if the provided dispute_id or evidence_id
        is not found. ::

            result = braintree.Dispute.remove_evidence("my_dispute_id", "my_evidence_id")
        """

        return Configuration.gateway().dispute.remove_evidence(id, evidence_id)
コード例 #20
0
ファイル: dispute.py プロジェクト: braintree/braintree_python
    def accept(id):
        """
        Accept a dispute, given a dispute_id.
        This will raise a :class:`NotFoundError <braintree.exceptions.not_found_error.NotFoundError>` if the provided dispute_id
        is not found. ::

            result = braintree.Dispute.accept("my_dispute_id")
        """

        return Configuration.gateway().dispute.accept(id)
コード例 #21
0
ファイル: address.py プロジェクト: omixen/braintree_python
    def update(customer_id, address_id, params={}):
        """
        Update an existing Address. A customer_id and address_id are required::

            result = braintree.Address.update("my_customer_id", "my_address_id", {
                "first_name": "John"
            })
        """

        return Configuration.gateway().address.update(customer_id, address_id, params)
コード例 #22
0
    def update(credit_card_token, params={}):
        """
        Update an existing CreditCard by credit_card_id.  The params are similar to create::

            result = braintree.CreditCard.update("my_credit_card_id", {
                "cardholder_name": "John Doe"
            })
        """

        return Configuration.gateway().credit_card.update(credit_card_token, params)
コード例 #23
0
    def find(subscription_id):
        """
        Find a subscription given a subscription_id.  This does not return a result
        object.  This will raise a :class:`NotFoundError <braintree.exceptions.not_found_error.NotFoundError>`
        if the provided subscription_id is not found. ::

            subscription = braintree.Subscription.find("my_subscription_id")
        """

        return Configuration.gateway().subscription.find(subscription_id)
コード例 #24
0
ファイル: dispute.py プロジェクト: braintree/braintree_python
    def find(id):
        """
        Find an dispute, given a dispute_id.  This does not return a result
        object.  This will raise a :class:`NotFoundError <braintree.exceptions.not_found_error.NotFoundError>` if the provided dispute_id
        is not found. ::

            dispute = braintree.Dispute.find("my_dispute_id")
        """

        return Configuration.gateway().dispute.find(id)
コード例 #25
0
ファイル: transaction.py プロジェクト: dz/braintree_python
    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)
コード例 #26
0
ファイル: customer.py プロジェクト: DongHuaLu/mdcom
    def find(customer_id):
        """
        Find an customer, given a customer_id.  This does not return a result
        object.  This will raise a :class:`NotFoundError <braintree.exceptions.not_found_error.NotFoundError>` if the provided customer_id
        is not found. ::

            customer = braintree.Customer.find("my_customer_id")
        """

        return Configuration.gateway().customer.find(customer_id)
コード例 #27
0
ファイル: transaction.py プロジェクト: dmehrab94/Biponi-1
    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)
コード例 #28
0
    def generate(params=None, gateway=None):

        if gateway is None:
            gateway = Configuration.gateway().client_token

        if params and "options" in params and not "customer_id" in params:
            for option in ["verify_card", "make_default", "fail_on_duplicate_payment_method"]:
                if option in params["options"]:
                    raise exceptions.InvalidSignatureError("cannot specify %s without a customer_id" % option)

        return gateway.generate(params)
コード例 #29
0
ファイル: transaction.py プロジェクト: dmehrab94/Biponi-1
    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)
コード例 #30
0
ファイル: transaction.py プロジェクト: OVRLab/AWSLambda
    def submit_for_partial_settlement(transaction_id, amount, params={}):
        """
        Creates a partial settlement transaction for an authorized transaction

        Requires the transaction id of the authorized transaction and an amount::

            result = braintree.Transaction.submit_for_partial_settlement("my_transaction_id", "20.00")

        """

        return Configuration.gateway().transaction.submit_for_partial_settlement(transaction_id, amount, params)
コード例 #31
0
 def tr_data_for_credit(tr_data, redirect_url):
     """
     Builds tr_data for a Transaction of type Credit
     """
     return Configuration.gateway().transaction.tr_data_for_credit(tr_data, redirect_url)
コード例 #32
0
 def create(params={}):
     return Configuration.gateway().payment_method.create(params)
コード例 #33
0
 def verify(challenge):
     return Configuration.gateway().webhook_notification.verify(challenge)
コード例 #34
0
 def all():
     return Configuration.gateway().discount.all()
コード例 #35
0
 def search(*query):
     return Configuration.gateway().verification.search(*query)
コード例 #36
0
 def delete(payment_method_token, options=None):
     if options is None:
         options = {}
     return Configuration.gateway().payment_method.delete(payment_method_token, options)
コード例 #37
0
 def retry_charge(subscription_id,
                  amount=None,
                  submit_for_settlement=False):
     return Configuration.gateway().subscription.retry_charge(
         subscription_id, amount, submit_for_settlement)
コード例 #38
0
ファイル: credit_card.py プロジェクト: mussha/dev
 def transparent_redirect_update_url():
     """
     Returns the url to be used for updating CreditCards through transparent redirect.
     """
     warnings.warn("Please use TransparentRedirect.url instead", DeprecationWarning)
     return Configuration.gateway().credit_card.transparent_redirect_update_url()
コード例 #39
0
 def update(payment_method_token, params):
     return Configuration.gateway().payment_method.update(payment_method_token, params)
コード例 #40
0
ファイル: credit_card.py プロジェクト: mussha/dev
    def tr_data_for_update(tr_data, redirect_url):
        """
        Builds tr_data for CreditCard updating.
        """

        return Configuration.gateway().credit_card.tr_data_for_update(tr_data, redirect_url)
コード例 #41
0
ファイル: credit_card.py プロジェクト: mussha/dev
 def expiring_between(start_date, end_date):
     """ Return a collection of credit cards expiring between the given dates. """
     return Configuration.gateway().credit_card.expiring_between(start_date, end_date)
コード例 #42
0
ファイル: credit_card.py プロジェクト: mussha/dev
 def expired():
     """ Return a collection of expired credit cards. """
     return Configuration.gateway().credit_card.expired()
コード例 #43
0
 def create(params=None):
     if params is None:
         params = {}
     return Configuration.gateway().payment_method.create(params)
コード例 #44
0
 def url():
     """
     Returns the url for POSTing Transparent Redirect HTML forms
     """
     return Configuration.gateway().transparent_redirect.url()
コード例 #45
0
 def retry_charge(subscription_id, amount=None):
     return Configuration.gateway().subscription.retry_charge(
         subscription_id, amount)
コード例 #46
0
 def sale(token, transactionRequest):
     transactionRequest["payment_method_token"] = token
     if not "options" in transactionRequest:
         transactionRequest["options"] = {}
     transactionRequest["options"]["submit_for_settlement"] = True
     return Configuration.gateway().transaction.sale(transactionRequest)
コード例 #47
0
 def search(*query):
     return Configuration.gateway().customer.search(*query)
コード例 #48
0
 def tr_data(data, redirect_url):
     return Configuration.gateway().transparent_redirect.tr_data(
         data, redirect_url)
コード例 #49
0
 def find(payment_method_token):
     return Configuration.gateway().payment_method.find(payment_method_token)
コード例 #50
0
    def tr_data_for_update(tr_data, redirect_url):
        """ Builds tr_data for updating a Customer. """

        return Configuration.gateway().customer.tr_data_for_update(tr_data, redirect_url)
コード例 #51
0
    def transparent_redirect_update_url():
        """ Returns the url to use for updating Customers through transparent redirect. """

        warnings.warn("Please use TransparentRedirect.url instead", DeprecationWarning)
        return Configuration.gateway().customer.transparent_redirect_update_url()
コード例 #52
0
 def all():
     """ Return a collection of all customers. """
     return Configuration.gateway().customer.all()
コード例 #53
0
 def line_items(transaction_id):
     """
     Find a transaction's line items, 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 transaction_id is not found. ::
     """
     return Configuration.gateway().transaction_line_item.find_all(transaction_id)
コード例 #54
0
 def sample_notification(kind, id):
     return Configuration.gateway().webhook_testing.sample_notification(
         kind, id)
コード例 #55
0
 def create(params):
     Resource.verify_keys(params, CreditCardVerification.create_signature())
     return Configuration.gateway().verification.create(params)
コード例 #56
0
 def clone_transaction(transaction_id, params):
     return Configuration.gateway().transaction.clone_transaction(transaction_id, params)
コード例 #57
0
 def find(verification_id):
     return Configuration.gateway().verification.find(verification_id)
コード例 #58
0
 def search(*query):
     return Configuration.gateway().transaction.search(*query)
コード例 #59
0
 def find(token):
     return Configuration.gateway().us_bank_account.find(token)
コード例 #60
0
 def parse(signature, payload):
     return Configuration.gateway().webhook_notification.parse(
         signature, payload)