Esempio n. 1
0
    def put(self):
        put_data = request.get_json()

        response, status_code = add_full_transaction_details(
            put_data,
            method='PUT',
            force_transaction_creation=put_data.get(
                'force_transaction_creation'))

        if status_code == 201:
            db.session.commit()

        return response, status_code
Esempio n. 2
0
    def post(self):

        post_data = request.get_json()

        if post_data.get('is_bitcoin'):
            response, status_code = add_full_transaction_details(
                post_data,
                method='POST',
                force_transaction_creation=post_data.get(
                    'force_transaction_creation'))
        else:
            response, status_code = claim_nonce(post_data)

        if status_code == 201:
            db.session.commit()

        return response, status_code