Checkout with PayPal Demo

Using Orders v2 REST API with PayPal JavaScript SDK

Server-side Integration

Sample Sandbox Buyer Credentials

Buyer Email Password qwer1234 qwer1234 123456789 123456789 qwer1234 qwer1234

Pricing Details


  1. Enter REST API credentials in api/Config/Config.php. You can get your own REST app credentials by creating a REST app with the steps outlined here .
  2. Click on 'PayPal Checkout’ button and see the experience.
  3. If you get any Firewall warning, add rule to the Firewall to allow incoming connections for your application.
  4. Checkout with PayPal using a buyer sandbox account provided on this page. And you're done!

In-Context Checkout integration steps with PayPal JavaScript SDK

  1. Copy the files and folders in the package to the same location where you have your shopping cart page.
  2. Include this script tag-
    <script src=""></script>
  3. Include the following script on your shopping cart page:
        env: 'sandbox', // sandbox | production
        // payment() is called when the button is clicked
        createOrder: function() {
    return fetch('/my-server/create-paypal-transaction')
    .then(function(res) {
    	return res.json();
    }).then(function(data) {
    	return data.orderID;
        // onAuthorize() is called when the buyer approves the payment
        onApprove: function(data, actions) {
            return fetch('/my-server/capture-paypal-transaction', {
                    body: JSON.stringify({
                    orderID: data.orderID
                }).then(function(res) {
                    return res.json();
                }).then(function(details) {
                    alert('Transaction funds captured from ' + details.payer_given_name);
  4. Open your browser and navigate to your Shopping cart page. Click on 'Checkout with PayPal' button and complete the flow.
  5. You can use the sample Buyer Sandbox credentials provided on index.php/home page.
  6. Refer to PayPal Developer site for detailed guidelines.
  7. Click here for the API reference.