提交烧瓶表格之前如何处理付款

时间:2020-02-18 22:07:51

标签: python forms flask flask-wtforms payment-processing

我希望在我的网站上向FlaskForm添加付款功能。该表单获取职位信息,并在提交时将数据存储在后端。但是,在提交之前,我要求用户输入付款明细并为提交功能付费。

在以下两种情况下,我都会满意:

  1. 用户输入数据。完全完成付款,然后提交网络表单。
  2. 用户输入数据,部分填写付款明细,并一次提交一次提交表单数据和付款明细。

我的问题是我如何实现无需提交表单即可完成的支付处理器,还有其他应注意的问题吗?

代码:

{% block app_content%}
			<div class="row">
				<div class="col-md-10 col-md-offset-1">
					<h1>Position information</h1> 
					<form method="post" role="form" enctype="multipart/form-data">
						{{ form.hidden_tag() }}
						<div class="form-row"> {{ wtf.form_field(form.job_title) }} </div>
						<div class="row">
							<div class="col-md-6"> {{ wtf.form_field(form.category) }} </div> <div class="col-md-6"> {{ wtf.form_field(form.job_type) }} </div>
						</div>
						<div class="row">
							<div class="col-md-6"> {{ wtf.form_field(form.post_length) }} </div> <div class="col-md-6"> {{ wtf.form_field(form.location) }} </div>							
						</div>
						<div class="form-row"> {{ wtf.form_field(form.listing_email) }} </div>
						<div class="form-row"> {{ wtf.form_field(form.application_link) }} </div>
						<div class="form-row"> {{ wtf.form_field(form.job_description) }} </div>
						<h1>Company Information</h1>
						<p> First time posting here? Enter all the information below. If it isn't just enter your company name and we will use your last job post's Company info. <p>
						<div class="form-row"> {{ wtf.form_field(form.company_name) }} </div>
						<div class="row">
							<div class="col-md-6"> {{ wtf.form_field(form.company_location) }} </div> <div class="col-md-6"> {{ wtf.form_field(form.company_logo) }} </div>							
						</div>
						<div class="form-row"> {{ wtf.form_field(form.company_website) }} </div>
						<div class="form-row"> {{ wtf.form_field(form.company_description) }} </div>
						
						<div class="form-row"> {{ wtf.form_field(form.accept_tos) }} </div>
						<div class="form-row"> {{ wtf.form_field(form.submit) }} </div>
					</form>
				</div>
			</div>
		<br>
{% endblock %}

0 个答案:

没有答案