Payment form protection
Arcjet can help you protect your payment form from fraudulent credit card transactions. The goal is to block high risk transactions before they are submitted to your credit card processor to save you money on chargeback fees.
Credit card processors are able to use other signals to detect fraud once they have the full transaction details, so we recommend using this as a first defense to block the most obvious fraud attempts.
Pre-checkout protection
A common approach for handling payments is to generate a unique payment or checkout link e.g. Stripe Checkout. This avoids having to collect credit card details on your own servers.
In this example, Arcjet will analyze the user request before checkout. If the request is high risk, the user will be blocked. If the request is considered safe, you can then proceed to generate the payment link and redirect the user to the payment processor.
Rules
These are the Arcjet rules we recommend using to protect the checkout link. It is configured to block all bots and automated clients, to validate the email address (including blocking free and disposable emails), and to limit the number of requests from the same IP address.
If you expect customers to use emails from free providers like Gmail, Hotmail,
etc then you may wish to remove FREE
from the block
list.
Additional checks
If the base rules pass then you can use IP geolocation and VPN & proxy detection checks to further validate the transaction.
This example only allows users from the US and UK, and blocks users from hosting providers, VPNs, and proxies.
Next.js example
This example shows a form component which implements the above rules. It uses the Next.js app router and shadcn/ui.
This will install the following components:
The payment form component is shown below. If the form passes the Arcjet checks, it will redirect the user to the link for the payment processor.
The form submission is processed by the following API route: