Chapter 18: Taking payments with your forms

A form can take money: a registration fee, a membership renewal, an order for T-shirts, a donation where the giver picks the amount. You write the payment into the form in QUILL, publish it to your WordPress site, and the QUILL Accessible Forms plugin (QAF) on the site takes the payment through Stripe, PayPal or Square, or several of them.

QUILL never touches the money and never sees a card number or a secret key. Its job is to describe what the form charges, to check that the site is ready before it publishes, and to show you afterwards who paid. Everything that moves money happens on the site, between the person paying and Stripe or PayPal.

This chapter goes through the whole process in order: what you need, test mode, adding the payment field, choosing providers, publishing, what the person paying hears, receipts, refunds, reporting, going live, and what to do when something goes wrong.

What you need before you start

If you run the site yourself, do the WordPress part first. It takes about ten minutes per provider.

Test mode, twice

There are two test mode switches, and they have to agree.

In test mode no real money moves. Stripe takes only its test card numbers and PayPal only its sandbox accounts. Keep both switches on test until you have tried every path, including a declined card and a refund.

If the two disagree, nothing is charged by mistake: QUILL will not publish a test form to a live site or a live form to a test site, and the site itself refuses to take payment for a form in the other mode.

Adding a payment field

Open the form and choose Tools > Forms > Insert Payment Field…. A form has one payment field at most; if it already has one, QUILL says so and you edit that field’s source instead.

The dialog has four boxes:

Press Insert. The field goes at the end of the last page, and the form gets payment settings with Stripe in test mode, in US dollars, if it had none. You can change those next, in Form Payments Setup. The whole change is one step, so Undo takes it back. Cancel changes nothing.

A fixed amount

Type the amount as a plain number in the main unit of the currency: 25 for 25 dollars, 19.99 for 19 dollars 99. No currency sign, no thousands separator.

On the page, the field says “Amount due: 25.00 USD.” There is nothing for the person paying to type.

A donation, with a smallest and largest gift

Type donation in Amount. If you want limits, put them in Donation minimum and Donation maximum, again as plain numbers: 5 and 500. Leave either one empty for no limit on that side.

On the page, the field becomes a box labelled with your label and the currency (“Your gift, in USD”), and the limits are read with it: “Give from 5.00 USD to 500.00 USD.” The site checks the amount again when the form is sent, so a gift below the minimum is refused with “The smallest gift this form takes is 5.00 USD.”

Inserting a donation also sets the form’s payment mode to Donation.

An amount from a total field

For an order form, the amount is usually the order total. Type # and the total field’s id, such as #order_total. To save you remembering ids, the Amount box’s help lists every field in the form that can be used: totals, prices, calculations, number fields and currency fields, as “#order_total (Order total)”. Press F1 on the Amount box to hear the list.

Whatever the page shows while someone fills in the form, the site works the total out again from the form itself when the form is sent: the product they chose and its price, how many (from a quantity field linked to the product), any coupon code, and the total field’s own shipping and tax settings; or the total’s calculation, if it has one. A price or total typed into the page by someone trying their luck is ignored. If the amount names a number or currency field, the person paying types the amount there themselves, and the site reads it exactly, like a donation.

Here is a small order form, as it looks in the document:

product #shirt "T-shirt"
  + "s" | "Small" @price 15
  + "l" | "Large" @price 17.5

quantity #how_many "How many?"
  @min 1
  @max 10
  @linked_product "shirt"

total #order_total "Order total"

payment #pay "Payment"
  @amount "#order_total"

Amounts the site will refuse

QUILL checks these before it publishes, and Check This Form lists them too:

Choosing providers and the other settings

Choose Tools > Forms > Form Payments Setup…. These settings belong to this form; another form can use different ones.

Press Save in Form. Like everything else in a form, this changes only the document until you publish.

More than one account

One site often takes money into different accounts: event fees into one Stripe account, donations into another, a chapter’s own Square location. The site keeps each as a named connection, set up in wp-admin under QAF Forms > Payments, each with its own keys, test or live mode and currency. Each has a short name you use in the form: stripe:events, stripe:donations, square:downtown. Plain stripe, paypal or square means that provider’s main connection.

Type the connections in Pay with, in order. The person paying hears the choices only when there is more than one, as a plain list such as “Pay with: Card (Stripe), PayPal, Card (Square)”.

Choosing the account by rule

Instead of letting the person paying choose, the form can choose for them from their answers. Type one rule a line in Choose by rule: the condition, a colon, then the connection. Rules are checked in order and the first that fits takes the payment:

amount over 500: stripe:large-gifts
#fund is building: square:building
from 2026-12-01 until 2026-12-31: stripe:campaign
otherwise: stripe:events

Check This Form finds a rule that can never take a payment, and says why: a choice the question does not have, a question that is not in the form, an amount the form never charges, a window that ends before it starts, or a rule an earlier one always catches first. It also finds rules with no otherwise. A form uses either Pay with or rules, never both.

Checking the site: Verify Payment Setup

Choose Tools > Forms > Verify Payment Setup…, pick the site if QUILL asks, and confirm with Read Setup. QUILL asks the site, over your ordinary WordPress connection, what it is ready for. It shows a short report:

Test mode
stripe: configured, webhook ready
paypal: not configured, webhook not ready

On a site with named connections the report lists each one too, such as “Connection Stripe: Events (stripe:events, test): works”, and ends with where this form sends the money: “When amount over 500, stripe:large-gifts takes the payment. Otherwise, stripe:events takes it.” In the WordPress Workbench, the site’s Properties (Alt+Shift+Enter) has a Payments page with the same list.

Before publishing, every connection the form can send money to must exist on the site, be finished, and be in the same test or live mode as the form. A form never mixes test and live connections.

Nothing is charged and nothing is changed by this check.

Publishing, and what each refusal means

Choose Tools > Forms > Publish Form… as for any form. For a paid form the confirmation says what kind of payments it will take: “Payment mode: test payments only, USD, stripe” or “LIVE payments: real money”. Before it sends anything, QUILL reads the site’s payment setup again and refuses if the site is not ready. Publishing a form as Live means people can see it; it has nothing to do with test or live payments.

When QUILL refuses, it says why. Here is what each message means and what to do:

Trying it on the site: Test on Site

Put the form on a page with Insert Form Into Page…, publish the page, then choose Tools > Forms > Test on Site with the form in front of you. For a paid form QUILL asks first, then reads the form as published. If the published form is not in test mode, it refuses with “The published form is not in payment test mode”, and opens nothing: your own document saying test mode is not good enough, because the site’s copy is what takes money.

When it opens the page, QUILL tells you what to pay with: “To pay in test mode, use Stripe’s test card 4242 4242 4242 4242 with any future date and any three-digit code, or a PayPal sandbox buyer account. Never a real card.” For Square it is the sandbox card 4111 1111 1111 1111 with any future date, the code 111 and any postal code.

A few more Stripe test cards are worth trying: 4000 0000 0000 0002 is declined, and 4000 0025 0000 3155 asks for an extra bank check. Stripe lists the rest in its testing guide. For PayPal, sign in with a sandbox personal account from the PayPal Developer Dashboard, never your own account.

What the person paying hears and does

This is the published form with NVDA or JAWS, in browse mode, from the top. The wording is the plugin’s own.

  1. The questions. They fill in the form as usual. The payment field reads as its label followed by what it costs: “Registration fee. Amount due: 25.00 USD. You pay by card (through Stripe) or PayPal after you send the form.” In test mode it adds “Test mode: no real money is taken. Use a test card from the provider, never a real one.”
  2. A donation. The field is an edit box, “Your gift, in USD, required”, with the hint “Give from 5.00 USD to 500.00 USD.” read with it. They type the amount: 20, or 20.50.
  3. Sending. They press the Submit button. If something needs fixing, the problem is announced and focus goes to the first field at fault, with its message read as the field’s description: “The smallest gift this form takes is 5.00 USD.”
  4. The answers are saved. The site says “Your answers are saved. To finish, pay 25.00 USD below.” Nothing has been charged yet.
  5. The payment panel. Focus moves to a new heading, “Pay 25.00 USD”, so the screen reader announces it straight away. Below it: “Your answers are saved. Your payment is not taken until you finish here.”
  6. Choosing how to pay. With two providers there is a group of radio buttons, “How do you want to pay?”, with “Card, through Stripe” and “PayPal”. The first is already chosen. Arrow keys change it.
  7. Paying by card. “Loading the payment form.” and then “The payment form is ready.” are announced. Tab moves into the card group, which is Stripe’s own fields: card number, expiry date, security code, and sometimes country and postcode. Each has a label and reads its own errors. After the last field comes the button “Pay 25.00 USD”. Pressing it announces “Sending your payment. Please wait.”
  8. An extra bank check. Some cards ask the bank to confirm, the step called 3-D Secure. It opens as a dialog on the same page, or as the bank’s own page; when they come back, the panel says “Welcome back. Checking your payment.”
  9. Paying with PayPal. “The PayPal button is ready. It opens PayPal in a new window.” They press the PayPal button, sign in and approve in the PayPal window, and are brought back. The panel says “Checking your payment with the site.” Approving in PayPal is not payment on its own; the site takes the payment and then reports the result.
  10. The result. Success is “Payment complete. Thank you.”, with focus back on the panel’s heading, and a link “View your receipt” when Stripe has one. A manual-capture form says “Payment authorized. You will be charged when the site owner confirms.”
  11. When it fails. An alert says what happened, in words: “The payment did not go through. You can try again. Your card was declined.” A “Try again” button follows. It is the same entry; trying again does not send the form a second time.
  12. When PayPal is closed early. “PayPal was closed before the payment finished. You can try again.”
  13. When the result is not known yet. Some payments take a moment. The panel says “Your payment is not complete yet.” and offers a “Check payment again” button rather than a second payment.

Two more things they might hear:

Everything works from the keyboard. Nothing is shown by colour alone. The card fields and the PayPal button are Stripe’s and PayPal’s own, which both companies build for screen readers, but they are not QUILL’s, so try them with your own screen reader before you go live.

Receipts

If the form sends its own confirmation email, it goes when the answers are saved, before payment. Word it so it does not promise that payment has been received.

Seeing who paid: Responses

Choose Tools > Forms > Responses…. Each response in the list ends with its payment, in words: “Response 41, 3 November, 2:10 PM, Jane Smith, Event registration, Payment: paid, 25.00, USD, Stripe”.

The payment can be:

A response with no payment at all means the site has no payment record for it, which is not the same as paid.

The site’s own report, under QAF Forms > Payments in wp-admin, lists recent payments with totals per currency: taken, refunded, kept, and authorized but not yet captured.

Refunds

Refunds are made in the Stripe, PayPal or Square dashboard, not in QUILL and not in wp-admin, and always in the account that took the payment: the response’s payment says which connection that was. The provider tells the site, the response becomes partly refunded or refunded, and Refresh Payment Status shows it. A partial refund is never shown as a full one, and a refunded payment never goes back to paid.

Manual capture

With Capture set to Manual, a payment stops at authorized, not yet captured. Take the money in the Stripe, PayPal or Square dashboard when you are ready, and the response becomes paid. If you void it, or the authorization runs out, it becomes cancelled. How long an authorization lasts depends on the provider and the card: about a week for most cards through Stripe, and PayPal sets its own limits. Do not leave one waiting for long.

Moving from test to live

When every test has worked, including a decline and a refund:

  1. The site owner adds the live keys under QAF Forms > Payments, uses Check Connection and Create Webhook for live, and switches the site to Live, which needs its own confirming check box.
  2. In QUILL, open the form, choose Form Payments Setup, uncheck Test mode, press Save in Form and confirm Use Live Mode.
  3. Run Verify Payment Setup. It should say Live mode, and configured and webhook ready for each provider the form uses.
  4. Publish the form again. The confirmation says “LIVE payments: real money”.
  5. Test on Site now refuses this form, on purpose. To check the live form, open its page in your browser yourself, and make one small real payment you then refund.

Any of your forms still in test mode stop taking payment once the site is live. Switch them too, or take them down.

Troubleshooting

Privacy and safety