All websites

06 / Case study

Fundacja Leroy Merlin / 2026

Leroy Merlin Foundation — online donations with confirmed payments

A donation system for the Leroy Merlin Foundation: a form in Webflow, payment at Tpay, and a server on Cloudflare that keeps the keys, records every donation and confirms the payment.

Role
Donation system build
Year
2026
Scope
  • Cloudflare Workers
  • Tpay Open API
  • D1 database
  • Turnstile
  • Webflow form
  • Tests
Disciplines
  • Cloudflare Workers
  • Tpay
  • TypeScript
  • Webflow
Visit site
The Leroy Merlin Foundation home page: “We are where local communities need us”

The brief

The Leroy Merlin Foundation collects donations online on its Webflow site, with payments handled by Tpay. The task: move all of the payment handling to a server. The site was to look after the form’s design only, while the Tpay keys, creating transactions and confirming payments stay where the browser can’t see them.

How it works

Diagram: the Webflow form sends the amount and a token to a Cloudflare Worker, the Worker creates a Tpay transaction and returns the payment address, and Tpay sends a signed confirmation after the payment
The Tpay keys live only on the server. The browser sends the amount and gets the payment address back.

A donor picks an amount and accepts the terms. The browser sends the Worker on Cloudflare only the amount and a verification token. The Worker checks the amount, records the donation, creates a Tpay transaction and sends the page back the payment address. The donor pays at Tpay: by BLIK, card, bank transfer or a wallet.

After the payment, Tpay sends a digitally signed confirmation. The Worker checks the signature against Tpay’s certificate, and that the transaction number and amount match its own records. Only then is the donation marked as paid.

The form

The form stays in Webflow, so the foundation’s team still changes its design itself. A script on the page handles choosing the amount, the messages and the way to the payment.

The “Make a donation” form: amounts of 50, 70 and 100 zł, a field for your own amount, the terms checkbox and a “Go to payment” button
The form in Webflow.

The amount is checked right away and again on the server: from 5 to 10,000 zł, in whole złoty. Messages are in Polish and screen readers announce them.

The form with 3 zł entered and the message “The minimum donation is 5 zł”
An amount too low gets a message, not an error later on.

The button turns on only once an amount is chosen and the terms are accepted. When clicked, it shows “Redirecting to payment…” at once, and coming back from Tpay with the Back button doesn’t lock the form.

An amount of 70 zł chosen, the terms accepted and the “Go to payment” button active
Ready to pay.

Protection against abuse

Cloudflare Turnstile checks that a person is sending the form. The check starts in the background as soon as the donor begins filling in the form, and usually needs no click at all. The server accepts requests from the foundation’s site only, and at most 10 attempts a minute from one address.

A record of donations

Every donation goes into a Cloudflare D1 database with its status: created, pending, paid, refunded or failed. The database holds no personal data: the payer’s details stay with Tpay. Every verified confirmation is logged, and one sent again doesn’t change a donation already booked.

Tests

The system has two environments: a test one on Tpay Sandbox and production, with separate databases and keys. The code is TypeScript with 87 automated tests, including attempts to forge Tpay’s signature.

The result

The foundation knows which donations were actually paid, and the payment credentials never leave the server. The site and the form stay in Webflow, in the hands of the foundation’s team.

Questions

  • Can the foundation still change the form in Webflow?

    Yes. The form’s and the page’s design stays in Webflow. The payment logic lives on the server, so design changes don’t touch it.

  • Which payment methods are available?

    Every one Tpay offers: BLIK, card, bank transfer and digital wallets. The donor picks the method on the payment page.

Tell me what you need.

Reply within 24 h

What is it about?

Please enter your name.

Please enter a valid email address.

Please write a message (min. 10 characters).

Add details: company, timeline, budget
Budget optional

Form data is used only to reply to your message. Privacy policy

SR / Terminal

Tab completes · ↑↓ history · Esc closes