Checkout with PayPal Demo

Using Orders v2 REST API with PayPal JavaScript SDK

Server-side Integration
Viber Viber Telegram Skype WhatsApp Заказать звонок

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!
  5. 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.

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. In order to view Alternative Payment Methods as part of the guest checkout flow, you must add query parameters intent=capture, commit=true, vault=false and buyer-country= and you must provide a supported buyer country
  3. Include the following script on your shopping cart page: (For APMs, the layout must be vertical and setting up the payment in the alternative payment method supported currency is required for the alternative payment method to render.)
        env: 'sandbox', // sandbox | production
            // Set style of buttons
            style: {
                layout: 'vertical',   // horizontal | vertical <-Must be vertical for APMs
                size:   'responsive',   // medium | large | responsive
                shape:  'pill',         // pill | rect
                color:  'gold',         // gold | blue | silver | black,
                fundingicons: false,    // true | false,
                tagline: false          // true | false,
        // 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.