Checkout with PayPal Demo

DIGITAL SLR CAMERA

Buyer Credentials:

Email-id:   
Password:

Item Specifications:

Item Name:
Item ID:
Description:
Quantity:
Price:
Tax:
Shipping Amount:
Handling Amount:
Shipping Discount:
Insurance Amount:
Total Amount:
Currency Code:
Payment Type:


-- OR --

README:

BEFORE YOU GET STARTED:
This code sample shows the new checkout flow called In-Context checkout experience. You need to meet the eligibility criteria to determine whether your integration will be a good candidate for In-Context checkout experience option. Please refer to the eligibility criteria .
If you are eligible for In-Context checkout based on the eligibility requirements, please refer to the 'In-Context Checkout integration steps' below. But, if you are not eligible, please refer to the 'Express Checkout integration steps' below.
PRE-READ:

1) Click on ‘Checkout with PayPal’ button and see the experience.
2) If you get any Firewall warning, add rule to the Firewall to allow incoming connections for your application.
3) Checkout with PayPal using a buyer sandbox account provided on this page. And you're done!
4) The sample code uses default sandbox credentials which are set in paypal_config.php. You can create your own credentials by creating PayPal Seller and Buyer accounts on Sandbox here.
5) Make following changes in paypal_config.php:
- If using your own Sandbox seller account, update PP_USER_SANDBOX, PP_PASSWORD_SANDBOX and PP_SIGNATURE_SANDBOX values with your sandbox credentials
- SANDBOX_FLAG: Kept true for working with Sandbox, it will be false for live.

In-Context Checkout integration steps:

1) Copy the files and folders under 'Checkout' package to the same location where you have your shopping cart page.
2) Copy the below <form> .. </form> to your shopping cart page.

<form id="myContainer" action="paypal_ec_redirect.php" method="POST">
      <input type="hidden" name="PAYMENTREQUEST_0_AMT" value="10.00"></input>
      <input type="hidden" name="currencyCodeType" value="USD"></input>
      <input type="hidden" name="paymentType" value="Sale"></input>
      <!--Pass additional input parameters based on your shopping cart. For complete list of all the parameters click here -->
</form>

3) Include the following script on your shopping cart page:

<script type="text/javascript">
 window.paypalCheckoutReady = function () {
     paypal.checkout.setup('Your merchant email id', {
         container: 'myContainer', //{String|HTMLElement|Array} where you want the PayPal button to reside
         environment: 'sandbox' //or 'production' depending on your environment
     });
 };
 </script>
 <script src="//www.paypalobjects.com/api/checkout.js" async></script>

4) Open your browser and navigate to your Shopping cart page. Click on 'Checkout with PayPal' button and complete the flow.
5) Read more details on Express Checkout API here

Express Checkout integration steps:

1) Copy the files and folders under 'Checkout' package to the same location where you have your shopping cart page.
2) Copy the below <form> .. </form> to your shopping cart page.

<form action="paypal_ec_redirect.php" method="POST">
  <input type="hidden" name="PAYMENTREQUEST_0_AMT" value="10.00"></input>
  <input type="hidden" name="currencyCodeType" value="USD"></input>
  <input type="hidden" name="paymentType" value="Sale"></input>
  <!--Pass additional input parameters based on your shopping cart. For complete list of all the parameters click here -->
  <input type="image" src="https://www.paypalobjects.com/webstatic/en_US/i/buttons/checkout-logo-large.png" alt="Check out with PayPal"></input>
</form>
3) In paypal_config.php, uncomment the 'Express Checkout URLs for Sandbox' and comment out the 'In-Context in Express Checkout URLs for Sandbox'. Do the same for the 'Live' URLs.
4) Open your browser and navigate to your Shopping cart page. Click on 'Checkout with PayPal' button and complete the flow.
5) Read more details on Express Checkout API here