This example demonstrates the most basic way to redirect a customer to our gateway hosted payment page using a simple HTML form button.
Basic Order Form Button
This example demonstrates the most basic way to redirect a customer to a Plug’n Pay hosted payment page using a simple HTML form button.
When the customer clicks the button, they will be sent to the Plug’n Pay payment page associated with your gateway account.
Example Code
<form method="POST" action="https://pay1.plugnpay.com/pay/">
<input type="hidden" name="pt_gateway_account" value="USERNAME">
<input type="submit" value="Pay Now">
</form>
How It Works
| Field | Description |
|---|---|
method="POST" |
Sends the form 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. |
type="submit" |
Creates the payment button the customer clicks. |
Required Changes
Before using this example in production:
- Replace
USERNAMEwith your actual Plug’n Pay gateway account username. - Customize the submit button text if desired.
- Embed the form into your website or checkout page.
Example:
<input type="hidden" name="pt_gateway_account" value="youraccount">
Customized Button Example
<form method="POST" action="https://pay1.plugnpay.com/pay/">
<input type="hidden" name="pt_gateway_account" value="youraccount">
<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.
- Customer enters payment information securely.
- Payment is processed through your Plug’n Pay account.
Notes
- This is the simplest possible integration example.
- Additional billing, shipping, transaction, and customization fields may also be submitted.
- For production environments, always test your integration before accepting live payments.
- Hosted payment pages help reduce PCI exposure by securely collecting payment data on Plug’n Pay servers.
Next Steps
After confirming the basic button works, you may want to explore:
- Passing transaction amounts dynamically
- Collecting customer billing information
- Customizing the hosted payment page
- Adding success and failure redirect URLs
- Implementing recurring billing or initialize payment data for later tokenization