How to Take Payfast Payments with Ninja Forms (No WooCommerce)

TjingTjingHow to Guides

How to take Payfast payments with Ninja Forms

Finally, South Africans can take Payfast payments straight from a Ninja Forms form, with no WooCommerce, no shopping cart and no code. This guide shows you how, using the free TjingTjing plugin, in about 15 minutes.

Most advice says to install a webshop. But a donation, an event ticket or a deposit isn't a shop. You want one form, one amount and a Pay button. When your visitor presses Send, they finish paying on Payfast, and the payment shows up next to their form entry in WordPress.

What you need

  • A WordPress site running WordPress 6.2 or later
  • Ninja Forms, the free version is fine
  • A Payfast merchant account, for real payments
  • A free Payfast sandbox account at sandbox.payfast.co.za, for testing without real money
  • The free TjingTjing plugin from WordPress.org

Set it up, step by step

  1. Install TjingTjing. In WordPress, go to Plugins › Add New, search for "TjingTjing", then install and activate it.
  2. Add your Payfast details. Go to TjingTjing › Settings. Tick Sandbox while you test, and paste in your sandbox Merchant ID and Merchant Key. If you set a passphrase in Payfast, add it here too. It must match exactly. Watch for a stray space when you type it into your Payfast dashboard: Payfast keeps it, and every payment will fail the signature check.
  3. Open your form. In Ninja Forms, edit the form you want to take payments with. Make sure it asks for the buyer's first name, last name and email.
  4. Add the payment action. Go to Emails & Actions, click +, and choose TjingTjing (Payfast).
    Adding the TjingTjing (Payfast) action in Ninja Forms

    Adding the TjingTjing (Payfast) action in Ninja Forms

  5. Set the amount. Type a fixed amount, like 150, or use the merge-tag picker to choose a field, like {field:amount}.
  6. Say what they're paying for. For example, "Workshop ticket" or "One jar of jam". This shows on the Payfast checkout and the buyer's receipt.
  7. Map the buyer. Use the picker to choose your first name, last name and email fields.
    Choosing the form's first-name field from the merge-tag picker

    Choosing the form's first-name field from the merge-tag picker

  8. Set where people land. Add a thank-you page for after payment, and a page to return to if they cancel.
  9. Publish the form.

You don't need to change anything in your Payfast account. After each payment, Payfast's server quietly tells your site the payment went through. TjingTjing sets that up for you, so there's nothing to configure.

Selling more than one? Use a calculated total

If the price depends on what people choose, let Ninja Forms work out the total and send that to Payfast.

  1. Add a choice field. For example, a dropdown called "How many jars of jam?" with the options One, Two and Three. Give each option a calc value: a plain number with no "R", so 1, 2 and 3.
    Setting calc values on a Ninja Forms dropdown

    Setting calc values on a Ninja Forms dropdown

  2. Create the calculation. Go to the form's Advanced › Calculations and add one. Name it jam_jars, with no spaces. For the equation, type the price per jar and a star, then use the picker to insert your dropdown: 25 * {field:how_many_jars_of_jam_…}.

    the jam_jars calculation and its equation

    the jam_jars calculation and its equation

  3. Use it as the amount. In the TjingTjing action, click the picker next to Amount, open Calculations, and choose jam_jars. The amount becomes {calc:jam_jars}.

    picking the calculation

    picking the calculation


    the amount filled in

    the amount filled in

Now three jars at R25 reach Payfast as R75, exactly what the buyer chose. You can try a live version on our Thingamabobs demo.

Test it, then go live

  1. Fill in your form and press Send. You should land on Payfast's sandbox checkout with the right amount.
  2. Complete the test payment. No real money moves.
  3. In WordPress, open TjingTjing › Payments. The payment should show as Paid. That means Payfast told your site about it, and the payment passed four checks: signature, source, Payfast's confirmation and amount.
    A verified payment showing as Paid in TjingTjing

    A verified payment showing as Paid in TjingTjing

When it works, go live: in TjingTjing › Settings, untick Sandbox and paste in your live Merchant ID, Key and passphrase. Then run one small real payment, and refund it in Payfast if you like.

Common problems

Payfast says I can't pay myself. Payfast refuses a payment when the buyer's email matches the merchant account's email. Test with a different email address.

I can't find TjingTjing in the list of actions. Check that both Ninja Forms and TjingTjing are active, and that you're on the latest version of TjingTjing.

The payment stays Pending. If the buyer never finished paying, it stays Pending, which is correct. If they did pay, switch on the debug log in TjingTjing › Settings and check your PHP error log. Sites behind Cloudflare or another proxy need "Site behind a proxy" set.

How do I refund someone? Refund the money in your Payfast dashboard, then click Record refund on that payment in TjingTjing › Payments. Payfast doesn't tell your site about refunds, so this keeps your records straight. Partial refunds work too.

Press Send. Hear the tjing.

That's it: one form, one action, and your visitors pay with card, Instant EFT, SnapScan and more on Payfast. No shop to build, no code to write.

Get TjingTjing free on WordPress.org, or try the test form first and hear the tjing for yourself.

TjingTjing is an independent plugin, not affiliated with Payfast or Ninja Forms.