In Vendr, a Payment Form is the form that is displayed immediately prior to redirecting to the Payment Gateway for payment processing. This is usually displayed on some kind of review page, allowing a final review of the Order before commencing payment.
The role of the Payment Form is to perform two tasks:
Prepare the Order for the Payment Gateway - This includes initializing the Orders transaction info, and assigning the Order with an Order Number. It's also at this time that the Order is assigned to a Member if there is currently a logged in session. This task may also involve passing information to the Payment Gateway to create a session, which the customer will complete in the next step, but this is dependant on the Payment Provider implementation.
Redirect to the Payment Gateway - The configured Payment Provider will return a Form that contains all the relevant information the Payment Gateway needs, along with the Forms
action
attribute being set to post to a page on the Payment Gateways server, starting the payment capture process.
Example Payment Form
An example of displaying a Payment Form would look something like this:
@using(Html.BeginPaymentForm(currentOrder)) {
<button type="submit">Continue to Payment</button>
}
Similar in concept to Umbraco's own Html.BeginUmbracoForm()
method, the Payment Form is rendered using a using
statement to wrap any additional form elements you wish to add to add, such as a submit button.