This example demonstrates how to create a payment button that submits multiple itemized products within a single transaction.

Basic Order Form Button with Itemization

This example demonstrates how to create a Plug’n Pay hosted payment button that submits multiple itemized products within a single transaction.

When the customer is redirected to the hosted payment page, the individual line items and totals can be displayed to the customer.


Example Code

<form method="POST" action="https://pay1.plugnpay.com/pay/">
  <input type="hidden" name="pt_gateway_account" value="USERNAME">
  <input type="hidden" name="pd_display_items" value="yes">

  <input type="hidden" name="pt_item_identifier_1" value="001">
  <input type="hidden" name="pt_item_cost_1" value="1.00">
  <input type="hidden" name="pt_item_quantity_1" value="1">
  <input type="hidden" name="pt_item_description_1" value="First Product">

  <input type="hidden" name="pt_item_identifier_2" value="002">
  <input type="hidden" name="pt_item_cost_2" value="2.00">
  <input type="hidden" name="pt_item_quantity_2" value="2">
  <input type="hidden" name="pt_item_description_2" value="Second Product">

  <input type="submit" value="Pay Now">
</form>

How It Works

Field Description
pt_gateway_account Your Plug’n Pay gateway account username.
pd_display_items Enables itemized product display on the hosted payment page.
pt_item_identifier_# Unique identifier or SKU for the item.
pt_item_cost_# Price of the individual item.
pt_item_quantity_# Quantity of the item being purchased.
pt_item_description_# Description or name of the item.
type="submit" Creates the payment button displayed to the customer.

The # portion of each item field represents the item number.

Example:

pt_item_identifier_1
pt_item_identifier_2
pt_item_identifier_3

Itemization Structure

Each product added to the transaction must use matching numbered field groups.

Example item structure:

Field Type Example
Item Identifier pt_item_identifier_1
Item Cost pt_item_cost_1
Item Quantity pt_item_quantity_1
Item Description pt_item_description_1

To add additional products, increment the item number sequentially.


Required Changes

Before using this example in production:

  1. Replace USERNAME with your Plug’n Pay gateway account username.
  2. Replace the sample product information with your actual product data.
  3. Add or remove item groups as needed.
  4. Update button text if desired.

Customized Example

<form method="POST" action="https://pay1.plugnpay.com/pay/">
  <input type="hidden" name="pt_gateway_account" value="youraccount">
  <input type="hidden" name="pd_display_items" value="yes">

  <input type="hidden" name="pt_item_identifier_1" value="SKU-1001">
  <input type="hidden" name="pt_item_cost_1" value="19.99">
  <input type="hidden" name="pt_item_quantity_1" value="1">
  <input type="hidden" name="pt_item_description_1" value="Monthly Subscription">

  <input type="hidden" name="pt_item_identifier_2" value="SKU-2001">
  <input type="hidden" name="pt_item_cost_2" value="9.99">
  <input type="hidden" name="pt_item_quantity_2" value="2">
  <input type="hidden" name="pt_item_description_2" value="Setup Fee">

  <input type="submit" value="Checkout">
</form>

Customer Flow

  1. Customer clicks the payment button.
  2. Customer is redirected to the Plug’n Pay hosted payment page.
  3. Itemized products and totals are displayed.
  4. Customer securely enters payment information.
  5. Payment is processed through your Plug’n Pay account.

Notes

  • Itemized products help provide customers with a clearer transaction breakdown.
  • Product totals are calculated using the submitted item costs and quantities.
  • Additional customer, billing, shipping, tax, or invoice fields may also be submitted.
  • Hosted payment pages help reduce PCI exposure by securely collecting payment information on Plug’n Pay servers.

Common Use Cases

This integration method is commonly used for:

  • Shopping cart checkouts
  • Multi-product purchases
  • Subscription plus setup fee billing
  • Invoice-style transactions
  • Donation forms with selectable items

Next Steps

After confirming itemized transactions work correctly, you may want to explore:

  • Dynamic shopping cart generation
  • Tax and shipping calculations
  • Passing invoice numbers
  • Custom receipt pages
  • Recurring billing with itemization
  • Customer billing and shipping fields