Paypal - Monthly Subsciptions 2.1.1

Paypal - Monthly Subsciptions 2.1.1

by Sarah Jane -
Number of replies: 2

Hi Guys,

I am interested in creating monthly subscriptions for my courses. I have searched the forums and see a wealth of information there but everything seems so very old. 

May I ask if someone could direct me to the current page to learn more about paypal and monthly subscriptions for moodle 2.1.1

Thanks Sarah x

Average of ratings: -
In reply to Sarah Jane

Re: Paypal - Monthly Subsciptions 2.1.1

by Duane Dunston -

I'm not sure if you got this resolved, but I just posted this to the forum:

I wanted to be able to convert a course over to Moodle for a small business and they have a subscription AND trial period for their product.

Here's what I did to get most of it to work. In the file:

moodle/enrol/paypal/enrol.html

I added these tags:

Replaced:

<input type="hidden" name="cmd" value="_xclick" />

with:

<input type="hidden" name="cmd" value="_xclick-subscriptions" />

Added the lines below based on the PayPal document: https://cms.paypal.com/cms_content/US/en_US/files/developer/PP_WebsitePaymentsStandard_IntegrationGuide.pdf

The $0.00 trial period doesn't work because if you set a course to $0.00, it doesn't redirect to PayPal (since there is no charge for it). Another chicken and egg problem is that the subscription code, below, worked (redirected me to PayPal) because I set the course to cost $9.99 via the PayPal module in Moodle. However, if I set the trial-period cost to $0.00, the PayPal subscription completes, but the redirect back to Moodle still shows $0.00 was paid so the student doesn't get enrolled into the course. We had to change the model to require a $9.99 payment up front, which they can cancel after 7 days, if they wanted. After the subscription is processed, the PayPal message errors, BUT when they click the button "Return to Course page" from the PayPal window, they get enrolled into the course.

<!-- Trial period -->

<!-- Pay $9.99 (a1) during a 30 (p1) Day (t1) trial period -->

<input type="hidden" name="a1" value="9.99">

<input type="hidden" name="p1" value="30">
<input type="hidden" name="t1" value="D">

<!-- This is a hack because the customer can ask for a refund at the end of the 7 days (we have to advertise that though). -->

<!-- Regular Time period charge $9.99 (a3) each (p3) month (t3) -->

<input type="hidden" name="a3" value="9.99">

<input type="hidden" name="p3" value="1">

<input type="hidden" name="t3" value="M">

<!-- NOTE: This must be set to a3, p3, t3, etc. -->

<!-- PayPal has an a2, p2, t2, etc. option to allow secondary trial periods (see document link above)

We don't use that so we skip over those settings. -->

<!-- Charge until customer cancels (via their PayPal account) or the PayPal account holder for our business cancels the subscription -->

<input type="hidden" name="src" value="1">

All together without all the extra text:

<!-- Enable subscription -->
<input type="hidden" name="cmd" value="_xclick-subscriptions" />

<!-- Trial period -->

<input type="hidden" name="a1" value="9.99">
<input type="hidden" name="p1" value="30">
<input type="hidden" name="t1" value="D">

<!-- Regular Time period charge -->

<input type="hidden" name="a3" value="9.99">
<input type="hidden" name="p3" value="1">
<input type="hidden" name="t3" value="M">

<!-- Charge until it is canceled -->
<input type="hidden" name="src" value="1">

Maybe the PayPal module developers could include options for this in the future. Just thought I'd share what worked for me.

NOTE: It doesn't appear the enrol.html file changes on a regular basis, but for each upgrade of Moodle, I have a backup copy of my manual changes so I can add back after the upgrade.

In reply to Sarah Jane

Re: Paypal - Monthly Subsciptions 2.1.1

by Tom Wootton -

I would like to offer a couple of subscriptions courses, but also have many courses where the standard paypal enrollment handles it. Is there a way to make a second version of Paypal enrollment or get the existing on to do both single and subscription enrollments?