This example demonstrates how to create a basic payment button that redirects a customer to our gateway hosted payment page with a predefined transaction amount.
Basic Order Form Button with Static Amount
This example demonstrates how to create a basic payment button that redirects a customer to a Plug’n Pay hosted payment page with a predefined transaction amount.
In this example, the payment amount is fixed at $5.00.
Example Code
<form method="POST" action="https://pay1.plugnpay.com/pay/">
<input type="hidden" name="pt_gateway_account" value="USERNAME">
<input type="hidden" name="pt_transaction_amount" value="5.00">
<input type="submit" value="Pay Now">
</form>
How It Works
| Field | Description |
|---|---|
method="POST" |
Sends the payment data securely using an HTTP POST request. |
action="https://pay1.plugnpay.com/pay/" |
The Plug’n Pay hosted payment page URL. |
pt_gateway_account |
Your Plug’n Pay gateway account username. |
pt_transaction_amount |
The fixed transaction amount submitted to the payment page. |
type="submit" |
Creates the payment button displayed to the customer. |
Required Changes
Before using this example in production:
- Replace
USERNAMEwith your actual Plug’n Pay gateway account username. - Update the transaction amount as needed.
- Customize the button text if desired.
Example:
<input type="hidden" name="pt_transaction_amount" value="19.99">
Customized Example
<form method="POST" action="https://pay1.plugnpay.com/pay/">
<input type="hidden" name="pt_gateway_account" value="youraccount">
<input type="hidden" name="pt_transaction_amount" value="19.99">
<input type="submit" value="Complete Payment">
</form>
Customer Flow
- Customer clicks the payment button.
- Customer is redirected to the Plug’n Pay hosted payment page.
- The payment amount is automatically populated.
- Customer enters payment information securely.
- Payment is processed through your Plug’n Pay account.
Notes
-
The amount submitted is static and cannot be modified by the customer through the form itself.
-
This example is useful for:
- Donations with fixed amounts
- Single product purchases
- Membership fees
- Service payments
-
Additional billing, shipping, and customization fields may also be included.
-
Hosted payment pages help reduce PCI exposure by securely collecting payment data on Plug’n Pay servers.
Next Steps
After confirming the basic static amount button works, you may want to explore:
- Passing dynamic transaction amounts
- Adding product descriptions
- Collecting customer billing information
- Using success and failure redirect URLs
- Creating shopping cart integrations