Find a file
Narek Zakarian 3f3c43ed2e
fix: add numeric check before converting items to integers
Prevents "Object could not be converted to int" notice when items array contains objects.
2025-08-14 12:43:04 +04:00
.ddev Activate plugin after wc is activated 2025-03-13 11:48:15 +01:00
.github Update .github/workflows/php.yml 2025-06-24 15:51:31 +03:00
.psalm 🧹 Remove reliance on the session in favor of passing the token directly 2025-06-26 16:14:22 +02:00
api Use a class that uses the trait instead of calling it directly 2025-08-12 16:07:53 +04:00
lib Update lib packages 2025-07-04 22:05:58 +04:00
modules fix: add numeric check before converting items to integers 2025-08-14 12:43:04 +04:00
node_modules Restore .gitkeep 2024-11-14 09:50:34 +01:00
src Fix Psalm 2025-07-04 22:19:39 +04:00
tests Fix phpunit 2025-08-06 14:03:37 +02:00
wordpress_org_assets Updated readme and add screenshots 2025-03-24 11:37:15 +01:00
.distignore Do not exclude block.json in .distignore 2024-09-06 09:01:19 +03:00
.editorconfig Set naming style in .editorconfig 2025-06-19 09:24:46 +03:00
.env.integration.example Rename e2e to integration 2025-03-12 18:14:01 +01:00
.eslintrc 🔧 Add missing config to eslintrc 2024-07-24 18:55:22 +02:00
.gitattributes Add tests using real WC 2022-06-17 09:40:00 +03:00
.gitignore Update changelog 2025-03-26 12:47:11 +01:00
assets-compiler.json Add assets compiler 2023-08-25 15:33:42 +03:00
babel.config.json Add babel and jest config 2024-06-22 15:37:01 +02:00
bootstrap.php Fix the plugin main file path 2025-07-04 20:18:23 +04:00
changelog.txt Update changelog 2025-07-31 13:19:09 -03:00
composer.json Update lib packages 2025-07-04 22:05:58 +04:00
composer.lock Update the lock file 2025-07-07 18:47:58 +04:00
LICENSE Initial commit 2020-03-19 16:47:08 +01:00
modules.php Always enable the new settings module 2025-07-11 16:42:48 +04:00
package.json 📦 Prepare 3.0.9-rc1 release 2025-07-31 16:17:40 +02:00
patchwork.json Move saved card payment logic into vaulting (WIP) 2022-08-11 14:22:12 +02:00
phpcs.xml.dist Exclude phpcs rule 2025-07-21 09:49:06 +02:00
phpunit.xml.dist Fix phpunit 2025-03-26 11:31:38 +01:00
psalm-baseline.xml Fix lint 2023-09-25 11:26:37 +01:00
psalm.xml.dist 🔧 Fix psalm errors when node_modules is missing 2025-02-10 17:41:09 +01:00
README.md Remove some badges 2025-06-03 15:05:08 +02:00
readme.txt Update changelog 2025-07-31 13:19:09 -03:00
scoper.inc.php Exclude the Stringable as a file since it is an interface, not a class 2025-03-18 18:08:25 +04:00
uninstall.php Reset bn code on unistall and add migration code for whitelabel mode 2025-06-20 12:31:55 +02:00
woocommerce-paypal-payments.php 📦 Prepare 3.0.9-rc1 release 2025-07-31 16:17:40 +02:00
wp-cli.yml Set checkout page before block/classic tests 2023-05-02 12:30:08 +03:00
yarn.lock ⬆️ Update WordPress deps (lock file) 2024-11-18 16:22:01 +01:00

WooCommerce logo

PayPal logo

License GitHub Release GitHub Release Date WordPress.org downloads Build Status Ask DeepWiki

WooCommerce PayPal Payments

PayPal's latest complete payments processing solution. Accept PayPal, Pay Later, credit/debit cards, alternative digital wallets local payment types and bank accounts. Turn on only PayPal options or process a full suite of payment methods. Enable global transaction with extensive currency and country coverage.

Features

  • Multiple Payment Options: PayPal, credit/debit cards, Pay Later, digital wallets (Apple Pay, Google Pay), and localized payment methods
  • Subscription Support: Supports WooCommerce Subscriptions with PayPal Vaulting and PayPal Subscriptions
  • Customizable Experience: Flexible button placement and styling options
  • Enhanced Security: PCI compliance, 3D Secure, and fraud protection tools
  • Global Compliance: Meets international standards (PSD2, SCA)

Documentation

Visit our official documentation for detailed guides and setup instructions.

Dependencies

  • PHP >= 7.4
  • WordPress >= 6.5
  • WooCommerce >= 9.6

Quick Installation

  1. Go to Plugins > Add New in your WordPress admin
  2. Search for "WooCommerce PayPal Payments"
  3. Click "Install Now" and then "Activate"
  4. Go to WooCommerce > Settings > Payments to configure PayPal Payments

Development

Install dependencies & build

  • $ composer install
  • $ yarn install

Optionally, change the PAYPAL_INTEGRATION_DATE constant to gmdate( 'Y-m-d' ) to run the latest PayPal JavaScript SDK

Unit tests and code style

  1. $ composer install
  2. $ ./vendor/bin/phpunit
  3. $ ./vendor/bin/phpcs
  4. $ ./vendor/bin/psalm
  5. $ wp-scripts lint-js
  6. $ yarn run test:unit-js - Ensure node version is 18 or above

Building a release package

If you want to build a release package (that can be used for deploying a new version on wordpress.org or manual installation on a WP website via ZIP uploading), follow these steps:

  1. Clone the repository and cd into it.
  2. Make sure you have the version in the plugin root file updated.
  3. Update the PayPal JavaScript SDK integration date by using the current date for the PAYPAL_INTEGRATION_DATE constant.
  4. The following command should get you a ZIP file ready to be used on a WordPress site:
$ yarn run build

or if using the DDEV setup:

$ yarn run ddev:build-package

Setup

You can install WooCommerce PayPal Payments locally using the dev environment of your preference, or you can use the DDEV setup provided in this repository which includes WP, WC and all developments tools.

To set up the DDEV environment, follow these steps:

  1. Install Docker and DDEV.
  2. Edit the configuration in the .ddev/config.yml file if needed.
  3. $ ddev start
  4. $ ddev orchestrate to install WP/WC.
  5. Open https://wc-pp.ddev.site

Use $ ddev orchestrate -f for reinstallation (will destroy all site data). You may also need $ ddev restart to apply the config changes.

Running tests and other tasks in the DDEV environment

Tests and code style:

  • $ yarn ddev:test
  • $ yarn ddev:lint
  • $ yarn ddev:fix-lint
  • $ yarn ddev:lint-js

See package.json for other useful commands.

For debugging, see the DDEV docs. Enable xdebug via $ ddev xdebug, and press Start Listening for PHP Debug Connections in PHPStorm. After creating the server in the PHPStorm dialog, you need to set the local project path for the server plugin path. It should look like this.

See tests/playwright for e2e (browser-based) tests.

Test account setup

You will need a PayPal sandbox merchant and customer accounts to configure the plugin and make test purchases with it.

For setting up test accounts follow these instructions.

Webhooks

For testing webhooks locally, follow these steps to set up ngrok:

  1. Install ngrok.

  • If using DDEV, run our wrapper Bash script which will start ddev share and replace the URLs in the WP database:

    $ .ddev/bin/share
    
  • For other environments, run

    $ ngrok http -host-header=rewrite wc-pp.myhost
    

    and in your environment variables (accessible to the web server) add NGROK_HOST with the host that you got from ngrok, like abcd1234.ngrok.io. ngrok will be used only for the webhook listening URL. The URLs displayed on the WordPress pages, used in redirects, etc. will still remain local.

  1. Complete onboarding or resubscribe webhooks on the Webhooks Status page.

License

GPL-2.0 License

Contributing

All feedback / bug reports / pull requests are welcome.