Esempio n. 1
0
    def gettxout(self, txid, index, mempool=True):
        """
        Returns details about an unspent transaction output (UTXO)

        Arguments:

        - *txid* -- Transactiond id for which the info should be returned.
        - *index* -- The output index.
        - *mempool* -- Add memory pool transactions.
        """
        tx = self.proxy.gettxout(txid, index, mempool)
        if tx != None:
            return TransactionInfo(**tx)
        else:
            return TransactionInfo()
 def signrawtransaction(self, txnHex):
     """
     Submits raw transaction (serialized, hex-encoded) to local node and network. 
     """
     try:
         return TransactionInfo(**self.proxy.signrawtransaction(txnHex))
     except JSONRPCException as e:
         raise _wrap_exception(e.error)
Esempio n. 3
0
 def listsinceblock(self, block_hash):
     try:
         res = self.proxy.listsinceblock(block_hash)
         res['transactions'] = [
             TransactionInfo(**x) for x in res['transactions']
         ]
         return res
     except JSONRPCException, e:
         raise _wrap_exception(e.error)
Esempio n. 4
0
    def gettransaction(self, txid):
        """
        Get detailed information about transaction

        Arguments:

        - *txid* -- Transactiond id for which the info should be returned

        """
        return TransactionInfo(**self.proxy.gettransaction(txid))
Esempio n. 5
0
    def getrawtransaction(self, txid, verbose=True):
        """
        Get transaction raw info

        Arguments:

        - *txid* -- Transactiond id for which the info should be returned.
        - *verbose* -- If False, return only the "hex" of the transaction.

        """
        if verbose:
            return TransactionInfo(**self.proxy.getrawtransaction(txid, 1))
        return self.proxy.getrawtransaction(txid, 0)
Esempio n. 6
0
    def gettransaction(self, txid):
        """
        Get detailed information about transaction

        Arguments:

        - *txid* -- Transactiond id for which the info should be returned

        """
        try:
            return TransactionInfo(**self.proxy.gettransaction(txid))
        except JSONRPCException, e:
            raise _wrap_exception(e.error)
Esempio n. 7
0
    def listunspent(self, minconf=1, maxconf=999999):
        """
        Returns a list of unspent transaction inputs in the wallet.

        Arguments:

        - *minconf* -- Minimum number of confirmations required to be listed.

        - *maxconf* -- Maximal number of confirmations allowed to be listed.


        """
        return [TransactionInfo(**tx) for tx in
                self.proxy.listunspent(minconf, maxconf)]
    def getrawtransaction(self, txid, verbose=True):
        """
        Get transaction raw info

        Arguments:

        - *txid* -- Transactiond id for which the info should be returned.
        - *verbose* -- If False, return only the "hex" of the transaction.

        """
        try:
            if verbose:
                return TransactionInfo(**self.proxy.getrawtransaction(txid, 1))
            return self.proxy.getrawtransaction(txid, 0)
        except JSONRPCException as e:
            raise _wrap_exception(e.error)
Esempio n. 9
0
    def listtransactions(self, account=None, count=10, from_=0, address=None):
        """
        Returns a list of the last transactions for an account.

        Each transaction is represented with a :class:`~bitcoinrpc.data.TransactionInfo` object.

        Arguments:

        - *account* -- Account to list transactions from. Return transactions from
                       all accounts if None.
        - *count* -- Number of transactions to return.
        - *from_* -- Skip the first <from_> transactions.
        - *address* -- Receive address to consider
        """
        accounts = [account] if account is not None else self.listaccounts(as_dict=True).keys()
        return [TransactionInfo(**tx) for acc in accounts for
                tx in self.proxy.listtransactions(acc, count, from_) if
                address is None or tx["address"] == address]
    def listunspent(self, minconf=1, maxconf=999999):
        """
        Returns a list of unspent transaction inputs in the wallet.

        Arguments:

        - *minconf* -- Minimum number of confirmations required to be listed.

        - *maxconf* -- Maximal number of confirmations allowed to be listed.


        """
        try:
            return [
                TransactionInfo(**tx)
                for tx in self.proxy.listunspent(minconf, maxconf)
            ]
        except JSONRPCException as e:
            raise _wrap_exception(e.error)
Esempio n. 11
0
    def listtransactions(self, account, count=10, address=None):
        """
        Returns a list of the last transactions for an account.
        
        Each transaction is represented with a :class:`~bitcoinrpc.data.TransactionInfo` object.
        
        Arguments:
        
        - *minconf* -- Minimum number of confirmations before payments are included.
        - *count* -- Number of transactions to return.
        - *address* -- Receive address to consider

        """
        try:
            return [TransactionInfo(**x) for x in 
                 self.proxy.listtransactions(account, count)
                 if address is None or x["address"] == address]
        except JSONRPCException,e:
            raise _wrap_exception(e.error)
Esempio n. 12
0
 def listsinceblock(self, block_hash):
     res = self.proxy.listsinceblock(block_hash)
     res['transactions'] = [TransactionInfo(**x) for x in res['transactions']]
     return res
Esempio n. 13
0
from app.forms import CreditCardForm
from app.urls import (authorize_net_obj, google_checkout_obj, world_pay_obj,
                      pay_pal_obj, amazon_fps_obj, fps_recur_obj,
                      braintree_obj, stripe_obj, ogone_obj)
from app.utils import randomword
from django.conf import settings
from django.contrib.sites.models import RequestSite
from billing.utils.paylane import PaylanePaymentCustomer, \
    PaylanePaymentCustomerAddress

from app.conf import GATEWAY_INITIAL, INTEGRATION_INITIAL

BTC_TEST_AMOUNT = decimal.Decimal('0.01')
BTC_TEST_ADDRESS = 'n2RL9NRRGvKNqovb14qacSfbz6zQBkzDbU'
BTC_TEST_SUCCESSFUL_TXNS = [
    TransactionInfo(address=BTC_TEST_ADDRESS, amount=BTC_TEST_AMOUNT)
]


def render(request, template, template_vars={}):
    return render_to_response(template, template_vars, RequestContext(request))


def index(request, gateway=None):
    return authorize(request)


def authorize(request):
    amount = 1
    response = None
    if request.method == 'POST':