Paypal Coffee

This project is not covered by Drupal’s security advisory policy.

PayPal Coffee is a "buy me a coffee" tip jar for Drupal 11 and 12. Place a block anywhere and supporters choose how many coffees to buy, then pay with PayPal Checkout without leaving the page.

Add a PayPal client secret to switch on verified mode: your server creates and captures every order, donations are recorded in Drupal, and tip jars can show a goal progress bar and a wall of recent supporters.

Features

  • Coffee quantity picker: quick choices such as ×1, ×3, ×5, or any number, with a live total.
  • Block-based: works in Block layout, Layout Builder and Canvas. Place as many tip jars as you like.
  • Display modes: the full PayPal button, or a compact coffee icon (optionally with the PayPal logo) that reveals the checkout. Compact mode only loads the PayPal script on first click, so pages stay fast.
  • Verified mode (optional):
    • Orders are created and captured by your server with the PayPal Orders v2 REST API. Prices are signed, so they cannot be changed in the browser, and only orders created by your site are captured.
    • Donations are stored as entities, with an admin list, moderation and Views integration.
    • Goal progress bar, for example "12 of 50 coffees this month", per month or all time.
    • Supporter wall with optional, opt-in names and messages.
    • Named tip jars: blocks that share a jar name share one goal and wall.
  • 24 PayPal currencies, including whole-number currencies (JPY, HUF, TWD). Optional card payments.
  • Small, medium and large sizes, a Twig template and CSS custom properties for theming.
  • Accessible: keyboard operable, screen-reader labels, reduced-motion and high-contrast support.
  • No external PHP library, and the PayPal secret is never stored in configuration.

Post-installation

  1. Enter your PayPal client ID at Configuration » Web services » PayPal Coffee. Use test to try the sandbox.
  2. Optionally add $settings['paypal_coffee.client_secret'] to settings.php to enable verified mode.
  3. Place the PayPal Coffee Button block and set the price of one coffee, the coffee choices and, in verified mode, a goal and supporter wall.

Requirements

  • Drupal 11.1 or later. Drupal 12 compatible.
  • A PayPal business account with a REST API app.

Similar projects

  • PayPal Donation provides a single /donate page using PayPal's older checkout and Merchant SDK, and supports recurring donations. It is available for Drupal 8 only. PayPal Coffee instead offers placeable tip jar blocks with PayPal's current Checkout and Orders v2 API, server-verified and recorded donations, a coffee quantity picker, goals and a supporter wall, for Drupal 11 and 12. It does not offer recurring donations.
  • For shops, orders and invoices, use Drupal Commerce with Commerce PayPal.

Additional notes

  • The PayPal SDK is loaded from www.paypal.com and the logo from www.paypalobjects.com. Allow these hosts in your Content-Security-Policy, and mention PayPal in your privacy policy where required.
  • Verified mode stores only the amount, PayPal order and capture IDs, and whatever name or message the supporter chooses to give.

Supporting this module

Report bugs and request features in the issue queue.

Project information

  • caution Maintenance fixes only
    Considered feature-complete by its maintainers.
  • Created by jamestarleton on , updated
  • shield alertThis project is not covered by the security advisory policy.
    Use at your own risk! It may have publicly disclosed vulnerabilities.

Releases