|
Some checks are pending
JS Unit Tests / JavaScript Unit Tests (push) Waiting to run
CI / PHP 7.4 (push) Waiting to run
CI / PHP 8.0 (push) Waiting to run
CI / PHP 8.1 (push) Waiting to run
CI / PHP 8.2 (push) Waiting to run
CI / PHP 8.3 (push) Waiting to run
CI / PHP 8.4 (push) Waiting to run
PR Playground Demo / prepare_version (push) Waiting to run
PR Playground Demo / build_plugin (push) Blocked by required conditions
PR Playground Demo / create_archive (push) Blocked by required conditions
PR Playground Demo / Comment on PR with Playground details (push) Blocked by required conditions
Update trunk to what was released in dev/release/3.4.0 |
||
|---|---|---|
| .ddev | ||
| .github | ||
| .psalm | ||
| api | ||
| docs | ||
| lib | ||
| modules | ||
| src | ||
| tests | ||
| wordpress_org_assets | ||
| .distignore | ||
| .editorconfig | ||
| .env.integration.example | ||
| .eslintrc | ||
| .gitattributes | ||
| .gitignore | ||
| assets-compiler.json | ||
| babel.config.json | ||
| bootstrap.php | ||
| changelog.txt | ||
| composer.json | ||
| composer.lock | ||
| LICENSE | ||
| modules.php | ||
| package-lock.json | ||
| package.json | ||
| patchwork.json | ||
| phpcs.xml.dist | ||
| phpunit.xml.dist | ||
| psalm-baseline.xml | ||
| psalm.xml.dist | ||
| README.md | ||
| readme.txt | ||
| scoper.inc.php | ||
| uninstall.php | ||
| webpack.config.js | ||
| woocommerce-paypal-payments.php | ||
| wp-cli.yml | ||
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
- Go to Plugins > Add New in your WordPress admin
- Search for "WooCommerce PayPal Payments"
- Click "Install Now" and then "Activate"
- Go to WooCommerce > Settings > Payments to configure PayPal Payments
Development
Setup using DDEV (recommended)
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 WordPress, WooCommerce and all development tools.
To set up the DDEV environment, follow these steps:
- Install Docker and DDEV.
- Edit the configuration in the
.ddev/config.local.ymlfile if needed. - Run
$ ddev start && ddev orchestrateto setup and orchestrate the plugin, WooCommerce and WordPress (you can also use$ npm run ddev:setup) - Open https://woocommerce-paypal-payments.ddev.site
Use $ ddev reset 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:
$ ddev npm run test$ ddev npm run lint$ ddev npm run fix-lint$ ddev npm run lint-js$ npm run ddev:unit-tests:coverage
See package.json for other useful commands.
For debugging, see the DDEV docs.
Enable xdebug via $ ddev xdebug enable, 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.
Check this article for a detailed guide.
Setup in other environments
Install dependencies & build
$ composer install$ npm ci
Optionally, change the PAYPAL_INTEGRATION_DATE constant to gmdate( 'Y-m-d' ) to run the latest PayPal JavaScript SDK
Unit tests and code style
$ ./vendor/bin/phpunit$ ./vendor/bin/phpcs$ ./vendor/bin/psalm$ npm run lint-js$ npm run test:unit-js- Ensure node version is18or above
Unit tests with Coverage
Run npm run ddev:unit-tests:coverage
This command generates a full test coverage report, available at the URL https://woocommerce-paypal-payments.ddev.site/coverage
Building a release package
If you want to build a release package, use the Build package (New) in GitHub Actions.
Currently, there is no script for building a proper release package locally, but you may try to run GHA locally via nektos/act.
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:
-
Install ngrok.
-
If using DDEV, run our wrapper Bash script which will start
ddev shareand replace the URLs in the WordPress database:$ .ddev/bin/share -
For other environments, run
$ ngrok http -host-header=rewrite wc-pp.myhostand in your environment variables (accessible to the web server) add
NGROK_HOSTwith the host that you got fromngrok, likeabcd1234.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.
- Complete onboarding or resubscribe webhooks on the Webhooks Status page.
License
Contributing
All feedback / bug reports / pull requests are welcome.