Exemplo n.º 1
0
def sync_polkadot_payout(contribution):
    if contribution.tx_id and contribution.tx_id != '0x0':
        txn_status = get_polkadot_txn_status(contribution)

        if txn_status:
            if txn_status.get('status') == 'done':
                contribution.success = True
                contribution.tx_cleared = True
                contribution.checkout_type = 'polkadot_std'
                record_contribution_activity(contribution)
                contribution.save()
            elif txn_status.get('status') == 'expired':
                contribution.tx_cleared = True
                contribution.success = False
                contribution.save()
Exemplo n.º 2
0
def sync_zcash_payout(contribution):
#     if not contribution.tx_id:
    txn = find_txn_on_zcash_explorer(contribution)
    if txn:
        contribution.tx_id = txn
        contribution.save()

#     if contribution.tx_id:
        is_sucessfull_txn = get_zcash_txn_status(contribution.tx_id)
        if is_sucessfull_txn:
            contribution.success = True
            contribution.tx_cleared = True
            contribution.checkout_type = 'zcash_std'
            record_contribution_activity(contribution)
            contribution.save()
Exemplo n.º 3
0
def sync_algorand_payout(contribution):

    if contribution.tx_id and contribution.tx_id != '0x0':
        txn_status = get_algorand_txn_status(contribution)

        if txn_status == 'success':
            contribution.success = True
            contribution.tx_cleared = True
            contribution.checkout_type = 'alogrand_std'
            record_contribution_activity(contribution)
            contribution.save()
        else:
            contribution.success = True
            contribution.tx_cleared = False
            contribution.save()
Exemplo n.º 4
0
def sync_binance_payout(contribution):
    if contribution.tx_id or contribution.tx_id == "0x0":
        txn_status = get_binance_txn_status(contribution)

        if txn_status:
            status_description = txn_status.get('status')

            if status_description == 'done':
                contribution.success = True
                contribution.tx_cleared = True
                contribution.checkout_type = 'binance_std'
                record_contribution_activity(contribution)
                contribution.save()
            elif status_description == 'expired':
                contribution.success = True
                contribution.tx_cleared = False
                contribution.save()
Exemplo n.º 5
0
def sync_zil_payout(contribution):

    if not contribution.tx_id or contribution.tx_id == '0x0':
        txn = find_txn_on_zil_explorer(contribution)
        if txn:
            contribution.tx_id = txn
            contribution.save()

    if contribution.tx_id and contribution.tx_id != '0x0':
        txn_status = get_zil_txn_status(contribution.tx_id)

        if txn_status and txn_status.get('has_mined'):
            contribution.success = True
            contribution.tx_cleared = True
            contribution.checkout_type = 'zil_std'
            record_contribution_activity(contribution)
            contribution.save()
Exemplo n.º 6
0
def sync_celo_payout(contribution):
    is_sucessfull_txn = False

    if not contribution.tx_id or contribution.tx_id == '0x0':
        txn = find_txn_on_celo_explorer(contribution)
        if txn:
            contribution.tx_id = txn
            contribution.save()

    if contribution.tx_id and contribution.tx_id != '0x0':
        is_sucessfull_txn = get_celo_txn_status(contribution.tx_id)

        if is_sucessfull_txn:
            contribution.success = True
            contribution.tx_cleared = True
            contribution.checkout_type = 'celo_std'
            record_contribution_activity(contribution)
            contribution.save()
Exemplo n.º 7
0
Arquivo: zcash.py Projeto: ankitzm/web
def sync_zcash_payout(contribution):
    is_sucessfull_txn = False

    if not contribution.tx_id or contribution.tx_id == '0x0':
        # user entered t-addr.
        txn = find_txn_on_zcash_explorer(contribution)
        if txn:
            contribution.tx_id = txn
            contribution.save()
            is_sucessfull_txn = is_zcash_txn_successful(contribution.tx_id)
    else:
        # user entered txn-id or txn-id picked up by cron.
        is_sucessfull_txn = is_valid_zcash_txn(contribution)

    if is_sucessfull_txn:
        contribution.success = True
        contribution.tx_cleared = True
        contribution.checkout_type = 'zcash_std'
        record_contribution_activity(contribution)
        contribution.save()
Exemplo n.º 8
0
def sync_rsk_payout(contribution):

    if not contribution.tx_id or contribution.tx_id == '0x0':
        txn = find_txn_on_rsk_explorer(contribution)
        if txn:
            contribution.tx_id = txn['hash']
            contribution.save()

    if contribution.tx_id and contribution.tx_id != '0x0':
        txn_status = get_rsk_txn_status(contribution)

        if txn_status == 'success':
            contribution.success = True
            contribution.tx_cleared = True
            contribution.checkout_type = 'rsk_std'
            record_contribution_activity(contribution)
            contribution.save()
        else:
            contribution.success = True
            contribution.tx_cleared = False
            contribution.save()