Find a file
2023-09-25 11:26:37 +01:00
.ddev Merge branch 'trunk' into PCP-1915-hpos-compatibility-improvements 2023-08-10 11:44:42 +02:00
.github Remove satackey/action-docker-layer-caching from e2e testing 2023-08-16 11:36:42 +02:00
.psalm Fix psalm 2023-09-20 13:03:47 +02:00
api Add tests for RefundFeesUpdater 2023-08-06 17:51:31 +01:00
lib Updated lib/README.md for new common folder. 2023-08-16 15:39:57 +01:00
modules Fix lint 2023-09-25 11:26:37 +01:00
src Add missing files to psalm 2023-03-16 21:12:34 +02:00
tests fix tests 2023-09-20 17:43:29 +04:00
wordpress_org_assets Fix merge conflicts 2021-09-30 12:52:15 +02:00
.editorconfig Add GH Action for building package 2022-07-29 17:09:40 +03:00
.env.e2e.example Add APM tests in pw 2023-06-23 10:56:21 +03:00
.gitattributes Add tests using real WC 2022-06-17 09:40:00 +03:00
.gitignore Remove .DS_Store 2023-07-28 16:34:36 +02:00
bootstrap.php Fix psalm error 2023-03-17 10:20:23 +02:00
changelog.txt Update changelog 2023-09-13 14:23:05 +02:00
composer.json Refactor WooCommerce\PayPalCommerce\Internale\Pattern to WooCommerce\PayPalCommerce\Common\Pattern 2023-08-15 08:27:59 +01:00
composer.lock Update composer 2023-09-13 14:49:34 +02:00
LICENSE Initial commit 2020-03-19 16:47:08 +01:00
modules.php Add improvements based on PR feedback 2023-09-21 11:24:50 +02:00
package.json Bump 2.3.0 version 2023-09-13 14:18:27 +02:00
patchwork.json Move saved card payment logic into vaulting (WIP) 2022-08-11 14:22:12 +02:00
phpcs.xml.dist Merge branch 'trunk' into pcp-157-blocks 2023-03-22 23:23:06 +02:00
phpunit.xml.dist delete some references to modules.locale 2020-09-01 14:53:03 +03:00
psalm-baseline.xml Fix lint 2023-09-25 11:26:37 +01:00
psalm.xml.dist Add WP-CLI command for updating settings 2023-05-02 12:40:35 +03:00
README.md Update readme 2023-03-22 11:39:19 +02:00
readme.txt Merge pull request #1694 from woocommerce/release/2.3.0 2023-09-13 15:00:01 +02:00
uninstall.php Require main plugin file. 2022-12-15 20:15:24 +04:00
woocommerce-paypal-payments.php Bump 2.3.0 version 2023-09-13 14:18:27 +02:00
wp-cli.yml Set checkout page before block/classic tests 2023-05-02 12:30:08 +03:00
yarn.lock Add ddev playwright addon 2023-07-28 15:34:34 +02:00

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.

Dependencies

  • PHP >= 7.2
  • WordPress >=5.3
  • WooCommerce >=4.5

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

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 reinstalattion (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 - PHPCBF to fix basic code style issued

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.