shop:checkout_payment_method
The shop:checkout_payment_method action is designed for creating the Payment Method page, which allows a customer to select a payment method from a list of available methods. The Payment Method page is the fourth step of the conventional step-by-step checkout process. Please read the generic description of the step-by-step actions in the Step-by-step checkout actions article.
Supported and required form fields
The Payment Method page should contain a HTML form with the following fields. To post form data to the server using the regular POST method (non AJAX), create a submit input element with the "submit" name. To submit the form using the AJAX method, use the shop:on_checkoutSetPaymentMethod handler, described in the Supported AJAX handlers section below.
- payment_method – an identifier of selected payment method. Required. You can use either radio button set or a SELECT element for representing a list of available payment methods.
- redirect - an ULR of a page to redirect the browser after processing the form data, if the provided information has no errors. Use a hidden field for supplying this value. If you are implementing a conventional checkout process, a value of this field will be a URL of the Order Review page. Note: if your copy of LemonStand is installed in a subdirectory, you need to use the root_url() function to generate correct URLs referring to LemonStand pages.
Generated PHP variables
The action provides the following PHP variables, which you can access in the page code.
- $payment_methods – a list of applicable payment methods, array. Each element in the array is an object of the Shop_PaymentMethod class.
- $payment_method - an identifier of a payment method previously selected by the customer (during a previous checkout). You can use this variable for pre-selecting an item in the payment method list.
- $goods_tax – a value of a goods tax
- $subtotal – order subtotal sum
- $shipping_quote – a shipping quote value
- $shipping_tax – a shipping tax value
- $discount - estimated cart discount. You can display this value during the checkout process.
- $estimated_total - an estimated total value. This value is calculated on each step of the checkout process, taking into account price rules and known information about the customer.
- $estimated_tax - an estimated tax value. This value is calculated on each step of the checkout process, taking into account price rules (defined on the Shop/Discounts page) and known information about the customer. The tax value includes the goods tax and shipping tax.
Supported AJAX handlers
- shop:on_checkoutSetPaymentMethod - sends the payment method form to the server for further processing. Use this handler for creating a button, or link, for sending the form data to the server and redirecting the browser to a next checkout step. Example:
<input type="image" src="/resources/images/btn_next.gif" alt="Next" onclick="return $(this).getForm().sendRequest('shop:on_checkoutSetPaymentMethod')"/>
Next: shop:checkout_order_review
Previous: shop:checkout_shipping_method
Return to Step-by-step checkout actions

