PayPal支付落地页
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
zhoulianbo fa915263cd ` 12 months ago
.github 第一次提交 1 year ago
api 1 1 year ago
css 第一次提交 1 year ago
img 第一次提交 1 year ago
js 第一次提交 1 year ago
pages 第一次提交 1 year ago
templates 1 1 year ago
tests 第一次提交 1 year ago
.gitignore 第一次提交 1 year ago
LICENSE.md 第一次提交 1 year ago
README.md 第一次提交 1 year ago
index.php ` 12 months ago

README.md

PayPal Checkout Server-side PHP Demo - Using Orders v2 REST API with PayPal JavaScript SDK

Prerequisites

  1. Update api/Config/Config.php with your REST API credentials

  2. Verify that all the files are in place by running and passing the Unit tests (process shown below).

     wget https://phar.phpunit.de/phpunit-5.7.phar 
     (Download a version of PHPunit consisent with your php version)
    
     mv phpunit-5.7.phar /usr/local/bin/phpunit
    
     chmod a+x  /usr/local/bin/phpunit
    
     phpunit --version 
    
     phpunit Tests/unit_test.php
    

Quick Start Demo Deployment Using XAMPP

  1. Download PHP server. Use a server such as XAMPP to be able to host the demo code sample.

  2. Browse to the htdocs directory of XAMPP. Unzip the downloaded demo code folder and place it in this htdocs directory.

  3. Start the Apache server in XAMPP from the XAMPP control panel.

  4. Open the website in the browser and access it as: http://<your_domain>/<php_code_folder_name>/index.php Here, your_domain will be localhost if hosting on your local machine. The php_code_folder_name is the name of the folder under which the downloaded code resides.

  5. Read further instructions when index.php in opened in a browser.

  6. If you have a newer version of XAMPP, launch the XAMPP control panel. In the General tab, click on Start to start the XAMPP stack.

  7. In the Services tab, start the Apache service.

  8. In the Volumes tab, click on Mount to mount the /opt/lampp volume. Then click on Explore which will launch the file explorer. Go to htdocs directory there and unzip the downloaded code sample there.

  9. In the Network tab, enable port forwarding for localhost:8080 -> 80 (over SSH).

  10. Next, open your browser and go to the localhost:8080/<Code sample folder name here>/ to launch the web application.

How the code works

  • The starting point is index.php.
  • Click on 'PayPal Checkout button and see the experience. Additionally, you can click on "Proceed to Checkout" and see the guest checkout experience.
  • In the guest checkout experience, the buyer country can be switched. When switched to one of Germany,Poland, Austria, Belgium, Netherlands, Italy and Spain, you will be able to choose the alternative payment methods offered in those countries. The shipping address will be pre-filled on the Shipping Information page for these countries. For all other countries, the address has to be manually entered.

License

Code released under LICENSE.