PayPal Setup in Magento 2

Last updated on May 31 2022
Raghvendra Wanchoo

Table of Contents

PayPal Setup in Magento 2

In this blog, we will discuss how to use Magento 2 to use PayPal as a payment processor for both credit card and PayPal payments. PayPal is a safest way of online payment for customers. With PayPal and Magento 2, you can accept the payment through debit cards, credit cards, and also from PayPal account holders. PayPal is a trusted payment gateway and widely used for its fast checkout.

The following steps are given to set up the PayPal payment methods in Magento 2:

Step 1: Login to the Magento 2 Admin Panel.

Step 2: On the left sidebar of Magento 2, Navigate to SYSTEM >> Configuration.

image1 27

Step 3: Here, you will get the list of options on the left side of the page. Scroll down and go to the Sales tab and click on the Payment Methods option.

image2 25

Step 4: Under the Merchant Location section, choose the merchant country from the dropdown list where your business is located or your business is registered from which country.

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

image3 25

Please note that if there are several websites, stores, or store views in your Magento, then you can choose the Store View from the upper-left corner to apply payment configuration.

Step 5: Magento 2 provides the following payment methods, which add PayPal as an additional payment method to the checkout page. Click on the Configure button corresponding to the PayPal Express Checkout to make PayPal settings.

image4 25

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

image5 25

  • Email Associated with PayPal Merchant Account – Enter the e-mail, which is associated with the PayPal merchant account for accepting the payments.
  • API Authentication Method – Choose API Signature or API Certificate.
    • API Signature: Enter the API Username, API Password, and API Signature for API Signature Mode.
      The fastest way is to click on Get Credentials from PayPal button to connect with your PayPal account and get this information.
    • API Certificate: Enter the API Username, API Password, and upload the API Certificate file for API Certificate Mode.

To create a PayPal account and get the API Credential from PayPal Click here.

  • Sandbox Mode – Set the Sandbox Mode option to Yes if you use credentials from the sandbox for your testing sandbox account. But if you entered production credential, then select No.
  • API Uses Proxy – Select Yes, if your system connects with PayPal through a proxy server, otherwise No. The system will ask you to configure an IP address for Proxy host and Port number for Proxy Port if you set Yes.
  • Enable this Solution – To display the PayPal payment method to the customers during checkout on the frontend, set this field to Yes.
  • Set Yes to Enable In-Context Checkout Experience field.
  • Enable PayPal Credit – In case your store allows PayPal credit for your store, then it to Yes.

Step 7: After completing the above information, we need to set up the Basic and Advanced setting of the PayPal payment method, as given below.

Basic Settings

image6 16

Title – Enter the Title for a payment method (we can leave it default).

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

Payment Action – The Payment Action field proposes to select either Sale or Authorization or Order, which defines how the Payment will be processed in the PayPal payment system.

image7 16

If you choose Order for the Payment Action field, it will display three more fields to complete. You must enter the number of days that primary authorization/order is valid, order valid period, and the maximum number of authorization for a single order.

Note that to make a change in any field’s default data, you need to contact PayPal.

Display on Product Details Page – Set Yes to this field to display the checkout with PayPal button to the product page.

Advanced Settings

Complete the advanced settings by providing the required information in the fields.

image8 16

Display on Shopping Cart: Set Yes to this field to display the checkout with PayPal button in the shopping cart.

Payment Applicable From: Select All Allowed Countries to accept PayPal Express Checkout from the customers of all countries. Otherwise, select Specific Countries to accept the PayPal Express Check from the customers of some specific countries which you choose from the list.

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

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

Transfer Cart Line Items: Enable this field by setting Yes to display the full summary of the customer’s order by line item from the PayPal site.

Transfer Shipping Options: Set this field to Yes to include up to ten shipping options in summary.

Shortcut Buttons Flavor: The shortcut button flavor field determines the image type that is used for the PayPal acceptance button.

Choose Dynamic to display the image that can be dynamically changed from the PayPal server. Otherwise, choose Static to display a specific image that cannot be dynamically changed from the PayPal server.

Enable PayPal Guest Checkout: This field allows the customers to make purchases with this method without having a PayPal account.

Require Customer’s Billing Address: By setting Yes to this field, the customer must need to provide the billing address for all the purchases. Otherwise, choose No to exclude the requirement or choose For Virtual Quotes Only to require the billing address only for virtual quotes.

Billing Agreement Signup: Select Auto in this field to allow the customers to sign a billing agreement during the Express Checkout flow or use any other method of payment.

Set Ask Customer to allow the customer to decide whether to sign a billing agreement during the PayPal Express Checkout or set Never to disable signing a billing agreement during the Express Checkout.

Skip Order Review Setup: Set Yes to the Skip Order Review Setup field to let the customer complete the transaction from the PayPal site without returning to your Magento 2.

Step 8: Click on the Save Config button to save the changes.

image9 14

Step 9: Once we configured the PayPal Express Checkout payment method, it will show up on the frontend with the criteria we have set from the backend. Now, customers can choose the PayPal payment method and place orders successfully.

image10 13

Here, you can see that the PayPal checkout button is added to the checkout page. Now, the PayPal checkout payment method for online payment is ready to use by the customers.

Note: If the payment method is not visible on the checkout page of your Magento 2 website, you need to clear the cache and reload the website.

Create a PayPal Account and get API Credentials

To get the API Username, API Password, and API Signature first, we need to create the account on PayPal.

Step 1: Go to PayPal site www.paypal.com and Sign up. Create an account, which you want to create by providing the required information. It may be either a Personal Account or Business Account.

image11 12

You can get the API UsernameAPI Password, and API Signature from here after creating an account.

Step 2: Now, login to the PayPal account with your registered id and password to get API Credential using the following link GET CREDENTIAL. It will directly redirect you to the Request API Credential Page.

Step 3: You will be redirected to a new window as given below in the screenshot, where you request for the API Credentials. Choose either API Signature or API Certificate and click on the Agree and Submit button. We choose API Signature here.

image12 11

Step 4: It will move to a new screen, where you view and remove API Signature as given in the below screenshot. Click on the Show link corresponding to the API Username, API Password, and Signature.

image13 11

Step 5: API Username, API Password, and Signature are now visible on the screen to you. Copy and paste them to the PayPal Express Checkout configuration.

So, this brings us to the end of blog. This Tecklearn ‘PayPal Setup in Magento 2’ blog helps you with commonly asked questions if you are looking out for a job in Magento Programming. If you wish to learn Java and build a career Java Programming domain, then check out our interactive, Java and JEE Training, that comes with 24*7 support to guide you throughout your learning period. Please find the link for course details:

https://www.tecklearn.com/course/java-and-jee-training/

Java and JEE Training

About the Course

Java and JEE Certification Training is designed by professionals as per the industrial requirements and demands. This training encompasses comprehensive knowledge on basic and advanced concepts of core Java & J2EE along with popular frameworks like Hibernate, Spring & SOA. In this course, you will gain expertise in concepts like Java Array, Java OOPs, Java Function, Java Loops, Java Collections, Java Thread, Java Servlet, and Web Services using industry use-cases and this will help you to become a certified Java expert.

Why Should you take Java and JEE Training?

  • Java developers are in great demand in the job market. With average pay going between $90,000/- to $120,000/- depending on your experience and the employers.
  • Used by more than 10 Million developers worldwide to develop applications for 15 Billion devices.
  • Java is one of the most popular programming languages in the software world. Rated #1 in TIOBE Popular programming languages index (15th Consecutive Year)

What you will Learn in this Course?

Introduction to Java

  • Java Fundamentals
  • Introduction to Java Basics
  • Features of Java
  • Various components of Java language
  • Benefits of Java over other programming languages
  • Key Benefits of Java

Installation and IDE’s for Java Programming Language

  • Installation of Java
  • Setting up of Eclipse IDE
  • Components of Java Program
  • Editors and IDEs used for Java Programming
  • Writing a Simple Java Program

Data Handling and Functions

  • Data types, Operations, Compilation process, Class files, Loops, Conditions
  • Using Loop Constructs
  • Arrays- Single Dimensional and Multi-Dimensional
  • Functions
  • Functions with Arguments

OOPS in Java: Concept of Object Orientation

  • Object Oriented Programming in Java
  • Implement classes and objects in Java
  • Create Class Constructors
  • Overload Constructors
  • Inheritance
  • Inherit Classes and create sub-classes
  • Implement abstract classes and methods
  • Use static keyword
  • Implement Interfaces and use it

Polymorphism, Packages and String Handling

  • Concept of Static and Run time Polymorphism
  • Function Overloading
  • String Handling –String Class
  • Java Packages

Exception Handling and Multi-Threading

  • Exception handling
  • Various Types of Exception Handling
  • Introduction to multi-threading in Java
  • Extending the thread class
  • Synchronizing the thread

File Handling in Java

  • Input Output Streams
  • Java.io Package
  • File Handling in Java

Java Collections

  • Wrapper Classes and Inner Classes: Integer, Character, Boolean, Float etc
  • Applet Programs: How to write UI programs with Applet, Java.lang, Java.io, Java.util
  • Collections: ArrayList, Vector, HashSet, TreeSet, HashMap, HashTable

Java Database Connectivity (JDBC)

  • Introduction to SQL: Connect, Insert, Update, Delete, Select
  • Introduction to JDBC and Architecture of JDBC
  • Insert/Update/Delete/Select Operations using JDBC
  • Batch Processing Transaction
  • Management: Commit and Rollback

Java Enterprise Edition – Servlets

  • Introduction to J2EE
  • Client Server architecture
  • URL, Port Number, Request, Response
  • Need for servlets
  • Servlet fundamentals
  • Setting up a web project in Eclipse
  • Configuring and running the web app with servlets
  •  GET and POST request in web application with demo
  • Servlet lifecycle
  • Servlets Continued
  • Session tracking and filter
  • Forward and include Servlet request dispatchers

Java Server Pages (JSP)

  • Fundamentals of Java Server Page
  • Writing a code using JSP
  • The architecture of JSP
  • JSP Continued
  • JSP elements: Scriptlets, expressions, declaration
  • JSP standard actions
  • JSP directives
  • Introduction to JavaBeans
  • ServletConfig and ServletContext
  • Servlet Chaining
  • Cookies Management
  • Session Management

Hibernate

  • Introduction to Hibernate
  • Introduction to ORM
  • ORM features
  • Hibernate as an ORM framework
  • Hibernate features
  • Setting up a project with Hibernate framework
  • Basic APIs needed to do CRUD operations with Hibernate
  • Hibernate Architecture

POJO (Plain Old Java Object)

  • POJO (Plain Old Java Object)
  • Persistent Objects
  • Lifecycle of Persistent Object

Spring

  • Introduction to Spring
  • Spring Fundamentals
  • Advanced Spring

Got a question for us? Please mention it in the comments section and we will get back to you.

 

 

0 responses on "PayPal Setup in Magento 2"

Leave a Message

Your email address will not be published. Required fields are marked *