& More
   [email protected]   
Example product

Potted plant


Price: $24.99

Checkout with default email

With Checkout, you may quickly and easily add payment buttons to your website.

Customize some of the Checkout elements (such as logo image or title text) and let us handle all the backend complexities. If this is not enough for you, integrate payments via Custom Form.

This example shows Checkout with the default (pre-filled) email address.

Use these card details to test different scenarios

4242 4242 4242 4242
Insufficient funds
4024 0071 1846 8684

		<form action="/examples/checkout-with-default-email/payment" method="post">
			<script src=""
				data-description="Checkout example"
				data-checkout-button="Buy now"
				data-email="[email protected]"
				data-class="btn btn-primary btn-lg">

		public class ExamplesController {
			private static final String PRIVATE_KEY = "pr_test_tXHm9qV9qV9bjIRHcQr9PLPa";

			@RequestMapping(value = "/examples/checkout-with-default-email", method = GET)
			public String checkout(Model model) throws IOException {
				try (Shift4Gateway shift4Gateway = new Shift4Gateway(PRIVATE_KEY)) {
					CheckoutRequest checkoutRequest = new CheckoutRequest()
							.charge(2499, "USD");
					String signedCheckoutRequest = shift4Gateway.signCheckoutRequest(checkoutRequest);
					model.addAttribute("signedCheckoutRequest", signedCheckoutRequest);

				return "examples/checkout";
			@RequestMapping(value = "/examples/checkout-with-default-email/payment", method = POST)
			public String checkoutSubmit(Model model, @RequestParam String shift4ChargeId) {
				model.addAttribute("chargeId", shift4ChargeId);

				return "examples/checkout";