Ejemplo n.º 1
0
def create_request():  #Creates a request object from a form submission
    sess = stripe_payment.payment(request.form['budget'])
    r = Request(budget=request.form['budget'],
                link=request.form['note'],
                tags=unquote(request.args.get('tags')),
                contact=request.form['contact'],
                user='',
                author=current_user.username,
                session=sess.id)
    db['advertisers'].update({'user': current_user.username},
                             {'$set': {
                                 'pending_request': r.get_json()
                             }})
    authorize = {
        'public_key': auth.auth_data['stripe_auth']['public'],
        'CHECKOUT_SESSION_ID': sess.id
    }
    return render_template("stripe_payment.html", authori=authorize)
Ejemplo n.º 2
0
def createcampaign():
    desc = request.form['desc']
    #platforms = request.form['platform']
    sess = stripe_payment.payment(request.form['budget'])
    r = Request(
        budget=request.form['budget'],
        link=request.form['link'],
        tags=desc,
        contact=request.form['contact'],
        user='',
        #platforms=platforms,
        author=current_user.username,
        session=sess.id)
    db['advertisers'].update({'user': current_user.username},
                             {'$set': {
                                 'pending_request': r.get_json()
                             }})
    authorize = {
        'public_key': auth.auth_data['stripe_auth']['public'],
        'CHECKOUT_SESSION_ID': sess.id
    }
    return render_template("stripe_payment.html", authori=authorize)