|
|
||
|---|---|---|
| .github | ||
| .psalm | ||
| docker | ||
| modules | ||
| src | ||
| tests | ||
| wordpress_org_assets | ||
| .editorconfig | ||
| .env.example | ||
| .gitattributes | ||
| .gitignore | ||
| bootstrap.php | ||
| changelog.txt | ||
| composer.json | ||
| composer.lock | ||
| docker-compose.yml | ||
| LICENSE | ||
| modules.php | ||
| package.json | ||
| patchwork.json | ||
| phpcs.xml.dist | ||
| phpunit.xml.dist | ||
| psalm-baseline.xml | ||
| psalm.xml.dist | ||
| README.md | ||
| readme.txt | ||
| woocommerce-paypal-payments.php | ||
| yarn.lock | ||
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.
Requirements
- PHP >= 7.1
- WordPress >=5.3
- WooCommerce >=4.5
Development
- Clone repository
$ cd woocommerce-paypal-payments$ composer install$ yarn run build:dev- Change the
PAYPAL_INTEGRATION_DATEconstant togmdate( 'Y-m-d' )to run the latest PayPal JavaScript SDK
Unit tests and code style
$ composer install$ ./vendor/bin/phpunit$ ./vendor/bin/phpcs$ ./vendor/bin/psalm
Docker
You can also use the Docker environment which includes WP, WC and all developments tools.
- Install Docker and Docker Compose.
$ cp .env.example .envand edit the configuration in the.envfile if needed.$ yarn run docker:build(or copy the commands from package.json if you do not haveyarn).$ yarn run docker:install$ yarn run docker:start- Add
127.0.0.1 wc-pp.myhostto yourhostsfile and open http://wc-pp.myhost (the default value ofWP_DOMAINin.env).
Tests and code style:
$ yarn run docker:test$ yarn run docker:lint
After some changes in .env (such as PHP, WP versions) you may need to rebuild the Docker image:
$ yarn run docker:destroy(all data will be lost)$ yarn run docker:build
See package.json for other useful commands.
Webhooks
For testing webhooks locally, follow these steps to set up ngrok:
-
Install ngrok.
-
Run
ngrok http -host-header=rewrite wc-pp.myhost
-
In your environment variables (accessible to the web server), add
NGROK_HOSTwith the host that you got fromngrok, likeabcd1234.ngrok.io.- For the Docker environment: set
NGROK_HOSTin the.envfile and restart the web server. (yarn run docker:stop && yarn run docker:start)
- For the Docker environment: set
-
Complete onboarding or resubscribe webhooks on the Webhooks Status page.
Currently, ngrok is used only for the webhook listening URL. The URLs displayed on the WordPress pages, used in redirects, etc. will still remain local.
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:
- Clone the repository and
cdinto it. - Make sure you have the version in the plugin root file updated.
- Update the PayPal JavaScript SDK integration date by using the current date for the
PAYPAL_INTEGRATION_DATEconstant. - The following command should get you a ZIP file ready to be used on a WordPress site:
$ yarn run build
License
Contributing
All feedback / bug reports / pull requests are welcome.