Submit a ticket My Tickets
Welcome
Login  Sign up
Open navigation

How to Create PayPal Buttons and Automatically Enroll Users via Zapier

Giving your users the option to purchase your courses through different payment gateways will give them flexibility and ease their access to your valuable content. You can choose between 4 popular payment gateways and you also have the capability of using more than one payment gateway at the same time. In case you are interested in subscriptions or installments, you can use Stripe since it can support both in our platform. 


If you are interested in another payment gateway, that is not a built-in integration, you can also use it, as long as it supports the creation of HTML buttons. Some payment gateways, such as PayPal and PayFast, allow you to create HTML payment buttons that you can add to your school. In this case, as soon as you confirm the incoming payment, you can manually enroll the user (or you can automate the process via Zapier or our API).

How to create PayPal Payment buttons

1. Log in to your PayPal account and locate the Paypal button creation page (From Settings   Seller Tools → PayPal Buttons).

2. Enter Payment details. Here you can choose a button type (Buy Now). Then add the course/service you are selling, set a tracking number, or change your currency.

Note: You should enter the Course ID as the Item ID in every button you create since you'll have to create a new button for every item you offer in your LearnWorlds school. This article describes How to Copy the ID of your Products.

3. You may Customize button text and appearance. You can change the appearance and text of the default PayPal button, or you can enter a URL to use your own button image.

4. Find and copy the code for the new button you have just created so you can then add it to your LearnWorlds school.

How to display the PayPal buttons on your school pages

LearnWorlds platform offers two different ways to display the PayPal payment button: with 2 payment buttons in one template or with 2 different templates.

A - With two payment buttons in a template (Add a widget with Embed Code)

Access the page you want to add the button of a second payment option (usually a course page). Select the element or button and add ( + ) an Embed Code widget.

To link the HTML button, copy the code and paste it within the embed widget. Don't forget to click Update.

Note: You will need to also edit the Layout of the Embed Code widget and insert a "20" value in the Bottom Padding.

Note: Embed widgets and sections can only be viewed in the Preview mode.

B - With two different templates (Add a section with Embed Code)

You may want to offer the two different payment methods, in different templates/sections. You can add the PayPal button code in a new embed section as described in this article. Paste your code in the embed template and click Update.


Note: You will need to also edit the Layout of the Embed Code section and insert a "20" value in the Bottom Padding. 

You can modify the background color and template’s position to accomplish continuity with your first payment template. For more information on how to make changes in a section, check this article → Sections & Layout

  • To find Paypal logos HTML codes, kindly visit this link.

  • If you wish to take your customers back to your school after the PayPal Checkout page, add to the PayPal buttons as a return URL, your school's Home Page URL (which will be accessible to logged-out users too).  Please find the respective instructions to achieve that, here (par. no 6)

Once you see that you have received a PayPal payment from a user you can manually enroll them in the relevant course.

How to automatically enroll users in a product via Zapier after creating Paypal buttons

With LearnWorlds you can also automate the manual enrollment process with Zapier if you have a Premium PayPlan plan. (Note that the Zapier automation at this stage can be applied only for individual courses and not subscriptions.)


Zapier is a tool that allows you to connect apps you use every day to automate tasks and save time. 


1. Either create a Zapier account [by following steps (a) and (b) of this articleor log in to your existing one. 

2. You can create your own workflow by connecting two apps together. 

    2a. Select PayPal as the first app for this automation

    2b. Then select LearnWorlds, as the connected app.

    2c. Select the trigger, for example when a Successful Sale is made in your PayPal account.

    2d. Now select an action for this trigger, for example, Enroll User in Product.

    2e. You can now Make a Zap by clicking on the Try it button!

Note: We suggest using the Enroll User in Product so that Zapier will automatically create a new user in your school and enroll him in the course in a single step. If the user is already registered with the same email, Zapier will bypass the user creation step!


3. As soon as you select both Trigger and Action, click on Try it, and in the sequential window Continue

4. Zapier will then prompt you to visit your PayPal IPN settings to add a URL as the IPN URL. You can do so, by (1)  clicking on the Copy to clipboard and (2) click on the PayPal IPN settings link.

5. Once you’re redirected and login into your PayPal account, kindly select the Choose IPN Settings button.

6. Paste the copied IPN URL, select the Receive IPN messages, and hit Save!

7. PayPal is now configured to trigger, let’s get back to our “Zap” to define LearnWorlds’ action, by selecting Test Trigger first (Zapier will make a sample sale), and after the successful test, click Continue.

8. Next, you’ll be prompt to enter the Action Event (Enroll User in Product) and your LearnWorlds credentials when clicking on the Continue button. 

9. The next step in Zapier will be to set enrollment details. To use variables for each required field, select the Enter text or insert data.

10. Fill in the Email, First Name, and Last Name variables.

11. In the Product Field and from the drop-down menu, you can select the course (Product) that the learner chose to enroll.

12. In the next fields, you may enter a different Price, choose to send a Welcome Email or not, and change the Transaction ID for your records (e.g. "Added via Zapier"). 

The Transaction ID record will reflect in this field, under your Sales records: 

If the user is manually enrolled in the course by the admin, the field is assigned the value Added by admin. The same value is assigned if the user was enrolled via Zapier if the Transaction ID in the Zap is blank.


13. After clicking Continue, all it is left is to test your Zap!

Tip: The "Number 1" variable entered in a previous step, returns an error on testing but there is no need to worry:) 

Feel free to skip the test and the Zap will work properly!


14. If you complete the test, you should receive the following confirmation screen:

and a test user will be created and enrolled in your course!

What about automating the enrollment procedure with our API? Here is the procedure on how to enroll a user in a product (available in the Learning Center plans or higher).

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.