Payment Tag

{exp:store:payment}
    <!-- order details -->
{/exp:store:payment}

The payment tag allows your customers to pay for existing orders. This can be useful if, for example, your customer elected to pay by a manual payment method (e.g. cheque), but you still want to provide them with the option to pay by credit card.

This tag behaves similarly to the Orders Tag, except it will only ever display one order, which must be specified either by Order ID or Order Hash. All of the variables available in the Orders Tag are available. In addition, there are a few extra parameters and variables to facilitate payments.

Payment Tag Parameters

order_id=""

Specify an order by ID. You should only use this tag in combination with member_id="CURRENT_USER" to prevent users browsing through private order details.

order_hash=""

Specify an order by hash. Generally if you are allowing orders from non-members, you will want to use this to allow customers to view their order details online.

member_id=""

Specify the order member ID. If set to the constant CURRENT_USER, only orders belonging to the currently logged in user will be displayed. You can use this to prevent users from viewing their order details unless they are logged in.

form_id="value"

Set an id attribute on the generated HTML form.

form_name="value"

Set a name attribute on the generated HTML form.

form_class="value"

Set a class attribute on the generated HTML form.

html:attribute="value"

Specify arbitrary attributes on the generated HTML form. For example:

html:parsley-validate="true"

payment_method=""

Specify a payment method short name. If this is not specified, the payment method submitted along with the order will be used. This can also be submitted as a POST field (for example, if you want to give your users a choice between payment methods). Make sure you have enabled and configured the payment method in the settings first.

return="path"

The path the user will be redirected to after the form is submitted. The constants ORDER_ID and ORDER_HASH are available here, similar to the checkout tag.

secure="yes"

Ensures the current page is only displayed over HTTPS. If you are accepting credit card details inline, you must use this parameter. The global setting "Require SSL connection for checkout and order tags" will enforce this on all sensitive tags.

Payment Tag Variables

All variables available in the Orders Tag are available here. Specifically, you will probably use the {if is_order_paid} and {if is_order_unpaid} variables. In addition, the following variables are available:

payment_method

The payment method can be submitted the same way it is in the checkout (see Payment Methods).

error:payment_method

If the payment gateway returns an error, you can use this variable to display it inline.

payment_status

This variable is deprecated in Store 1.5. It used to temporarily display the status of the most recent payment (along with {payment_message}). However, these variables have been deprecated in favor of the more simple {error:payment_method} variable.

Credit Card Details

For information about how to submit credit card details inline, see Credit Card Details.

Store 2 and 3 Documentation  ·  Store 1.6 Documentation