PayPal Setup in Magento 2

PayPal Setup in Magento 2

In this page, we will explore how to use Magento 2 for both credit cards and PayPal payments using PayPal as a payment processor. PayPal is the easiest way to make customers pay online. You can accept the payment with PayPal and Magento 2 via debit cards, credit cards, and also from PayPal account holders. PayPal is a trusted gateway to make payments and widely used for its quick checkout.

To set up the PayPal payment methods in Magento 2, the following steps are given:

Step 1: Log in to the Admin Tab on Magento 2.

Step 2: Navigate to System > Configuration on the left sidebar of Magento 2.

PayPal Setup in Magento

Step 3: You can find the list of choices on the left-hand side of the page here. Go to the Sales tab, scroll down, and click the Payment Methods option.

PayPal Setup in Magento

Step 4: Choose the merchant country from the drop-down list where your business is located, or from the country where your business is registered, under the Merchant Location section.

If you do not pick the country here, then the General Config country will be used by default.

PayPal Setup in Magento

Step 5: Magento 2 provides the following methods of payment, which attach PayPal to the checkout page as an additional method of payment. To make PayPal settings, click the Configure button, which corresponds to the PayPal Express Checkout.

PayPal Setup in Magento

Step 6: Provide the required details to complete the PayPal setting:

PayPal Setup in Magento


The fastest way to get this information is by clicking on the Get PayPal credentials button to connect to your PayPal account.

  • API Certificate: Fill the API password, username, and API certificate file in API mode with API certificate
  • Sandbox Mode - Set the Sandbox Mode option to Yes if you are using sandbox credentials to check your sandbox account. But if you have entered credentials for the output, then pick No.
  • API Uses Proxy - If your System connects to PayPal through a proxy server, select Yes, otherwise No. If you set Yes, the program will ask you to configure an IP address for Proxy host and Proxy Port number.
  • Enable this Solution - Set this field to Yes to show customers the PayPal payment method during frontend checkout.
  • Set Yes to Enable the field In-Context Checkout experience.
  • Enable PayPal Credit - If your store requires your shop to be credited to PayPal, then set it to Yes.

Step 7: After completing the above details, we need to set the PayPal payment method's Basic and Advanced setting, as given below.

Basic Settings

PayPal Setup in Magento

Title - Enter a payment method in the Title.

Sort Order - Set the order corresponding to other payment methods for the PayPal Payment form on the checkout tab. For example-if you set 1 to this field, then on the checkout page, this form of payment will appear in second place.

 Payment Action - The Payment Action area recommends either choosing Purchase or Authorization or Order, which determines how the Transaction will be handled within the PayPal payment system.

PayPal Setup in Magento

When you want to take a payment action order. And that's going to reveal three more fields to complete. You have to enter the number of times the primary authorization order is valid, the period is the correct order, and the authorization for any one order.

Display on Product Details Page - To view the checkout on the product page, set Yes to this field with the PayPal button.

Advanced Settings

Fill in the advanced settings by providing in the fields the necessary information.

PayPal Setup in Magento

Display on Shopping Cart: To view the checkout in the shopping cart with the PayPal button set Yes to this area.

Debug Mode: Set debug mode to Yes to write payment system communications into the log file.

Enable SSL Verification: Set the field to Yes to enable verification of host authenticity.

Select Dynamic to view the dynamically-changeable image from the PayPal server. Otherwise, select Static to view a single picture that the PayPal server cannot dynamically modify.

Enable PayPal Guest Checkout: This area helps the customers to make payments without using this form to obtain a PayPal account.

Require Customer's Billing Address: By setting Yes to this field, the consumer must provide all transactions with the billing address. Otherwise, select No to exclude the provision, or choose For Virtual Quotes only for including the billing address.

Step 8: To save the changes, press the Save Config button.

PayPal Setup in Magento

Step 9: When we have configured the payment method for PayPal Express Checkout, the requirements we have set from the backend will show up on the frontend. Customers can now pick the PayPal payment method and successfully position orders.

PayPal Setup in Magento

You can see here the checkout button for PayPal is added to the checkout list. Now the online payment method for PayPal checkout is available for the customers to use.

Create a PayPal Account and get API Credentials

We need to build the account on PayPal to get the API Username, API Password, and API signature first.

Step 1: Go to www.paypal.com and sign up for PayPal. Create an account by providing the required information that you want to create. This could be a Personal or Company Account.

PayPal Setup in Magento

Step 2: Now sign in with your registered Id and password to the PayPal account to get API Credential using the connection below. This will forward you directly to the Credential Page of the Request API.

PayPal Setup in Magento

Step 3: In the screenshot, where you request the API credentials, you will be redirected to a new window, as provided below. Choose either the Signature API or the Certificate API and press the Accept and Submit button. Here, we pick API Signature.

PayPal Setup in Magento

Step 4: It switches to a new tab, where you see and delete API Signature, as shown in the screenshot below. Tap the corresponding Show link for Username, Password API, and Signature APIs.

PayPal Setup in Magento

Step 5: You can now see API Username, API Password, and Signature on the page. Copy and add these to the setup of PayPal Express Checkout.

PayPal Setup in Magento