Git Product home page Git Product logo

woocommerce-paypal-payments's Introduction

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.1
  • WordPress >=5.3
  • WooCommerce >=4.5

Development

Install dependencies & build

  • $ composer install
  • $ yarn run build:dev

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 Docker setup:

$ yarn run docker:build-package

Setup

You can install WooCommerce PayPal Payments locally using the dev environment of your preference, or you can use the Docker environment which includes WP, WC and all developments tools.

To set up the Docker environment, follow these steps:

  1. Install Docker and Docker Compose.
  2. $ cp .env.example .env and edit the configuration in the .env file if needed.
  3. $ yarn run docker:build (or copy the commands from package.json if you do not have yarn).
  4. $ yarn run docker:install
  5. $ yarn run docker:start
  6. Add 127.0.0.1 wc-pp.myhost to your hosts file and open http://wc-pp.myhost (the default value of WP_DOMAIN in .env).

Running tests in the Docker environment

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:

  1. $ yarn run docker:destroy (all data will be lost)
  2. $ yarn run docker:build

See package.json for other useful commands.

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.

  2. Run

ngrok http -host-header=rewrite wc-pp.myhost
  1. In your environment variables (accessible to the web server), add NGROK_HOST with the host that you got from ngrok, like abcd1234.ngrok.io.

    • For the Docker environment: set NGROK_HOST in the .env file and restart the web server. (yarn run docker:stop && yarn run docker:start)
  2. 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.

License

GPL-2.0 License

Contributing

All feedback / bug reports / pull requests are welcome.

woocommerce-paypal-payments's People

Contributors

a-danae avatar alexp11223 avatar chickenn00dle avatar dinamiko avatar dnaber-de avatar jorgeatorres avatar lcmry avatar mattallan avatar meszarosrob avatar mmaymo avatar oscargare avatar ratnakardubey avatar strangerkir avatar websupporter avatar xedinunknown avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.