| 1 |
This is a Drupal 4.7 set of modules to provide donations, paid role or group
|
| 2 |
subscriptions and paid node posting via PayPal.
|
| 3 |
|
| 4 |
These modules are provided with NO warranty or liability stated or implied.
|
| 5 |
Use it entirely at your own risk!
|
| 6 |
|
| 7 |
lm_paypal now consists of four modules:
|
| 8 |
|
| 9 |
* lm_paypal which handles talking with PayPal, receiving, validating
|
| 10 |
and processing PayPal IPN messages. To use the other modules this module
|
| 11 |
is required.
|
| 12 |
|
| 13 |
* lm_paypal_donations which works with lm_paypal to provide donation
|
| 14 |
buttons
|
| 15 |
|
| 16 |
* lm_paypal_subscriptions which works with lm_paypal to provided paid
|
| 17 |
role or Organic Group memberships under Drupal
|
| 18 |
|
| 19 |
* lm_paypal_paid_adverts which works with lm_paypal and
|
| 20 |
lm_paypal_subscriptions to allow any node type to be flagged as requiring
|
| 21 |
payment to be published. Articles created with these flagged node types
|
| 22 |
are only publically viewable once paid for using an admin configured
|
| 23 |
paypal subscription
|
| 24 |
|
| 25 |
Version 1.20 and above can now also co-exist with other Drupal PayPal IPN
|
| 26 |
modules, such as ecommerce. (Note that subscriptions created by version
|
| 27 |
1.19 and below still require the notify_url to be set to lm_paypal
|
| 28 |
on paypal.com.)
|
| 29 |
|
| 30 |
Note: Thanks to an idea from Klaus Brune and nekstrom this version of
|
| 31 |
lm_paypal should be able to co-exist with other Drupal PayPal modules.
|
| 32 |
|
| 33 |
Special note: when using these modules all uid's must be in the range 1-65535
|
| 34 |
and, if using lm_paypal_paid_adverts, the same range applies to node ids.
|
| 35 |
|
| 36 |
Incompatibilities:
|
| 37 |
It has been reported that the module Bad Behaviour can block incoming
|
| 38 |
IPN responses. I've not had the time to investigate how to correct this.
|
| 39 |
For now please disable this module.
|
| 40 |
|
| 41 |
(see http://drupal.org/node/137182 and http://drupal.org/node/30501)
|
| 42 |
|
| 43 |
lm_paypal
|
| 44 |
---------
|
| 45 |
|
| 46 |
This provides all the basic processing needed to successfully use PayPal IPN.
|
| 47 |
|
| 48 |
As you can only have one IPN handler registered on your business account
|
| 49 |
at PayPal you cannot use this module at the same time as any other IPN
|
| 50 |
based handler!
|
| 51 |
|
| 52 |
|
| 53 |
lm_paypal_subscriptions
|
| 54 |
-----------------------
|
| 55 |
|
| 56 |
Note:
|
| 57 |
This is NOT an access control module. To control what the subscribers
|
| 58 |
role allows them to do use a module like Taxonomy Access Control.
|
| 59 |
|
| 60 |
This module allows admin's to define paid subscriptions to a role or
|
| 61 |
Organic Group and users to pay to join those subscriptions via PayPal.
|
| 62 |
The subscribers gain/loose the extra role or group according to the
|
| 63 |
subscription details.
|
| 64 |
|
| 65 |
The subscription definitions are used to generate subscription buttons
|
| 66 |
that are processed by PayPal. PayPal then sends a variety of messages
|
| 67 |
back and these are used to control the subscription. Messages such as
|
| 68 |
signedup, payment, and cancel or end-of-term.
|
| 69 |
|
| 70 |
All defined subscriptions are visible to users via a new menu item. They
|
| 71 |
can also see the status of any subscriptions they currently have via
|
| 72 |
the standard 'my account > view'.
|
| 73 |
|
| 74 |
Each subscription is also available as a block that can be enabled via the
|
| 75 |
standard block admin page. Note that these block's do not appear if the user
|
| 76 |
cannot subscribe (not logged in) or already have that subscription.
|
| 77 |
|
| 78 |
If you would like more control over the where subscription buttons appear
|
| 79 |
you can easily do so with a bit of PHP.
|
| 80 |
|
| 81 |
The following PHP snippet shows how to make a subscribe button appear for
|
| 82 |
the subscription with a subid of 1. Admin's can find the subid via the
|
| 83 |
'admin > LM PayPal Subscriptions' interface.
|
| 84 |
|
| 85 |
Note that nothing will appear if they are either not able to subscribe
|
| 86 |
(not logged in) or if they have already subscribed:
|
| 87 |
|
| 88 |
<?php
|
| 89 |
if (function_exists('lm_paypal_can_subscribe')) {
|
| 90 |
$subid = 1;
|
| 91 |
if (lm_paypal_can_subscribe ($subid)) {
|
| 92 |
print 'Why not subscribe now? ' . lm_paypal_subscribe($subid,8);
|
| 93 |
}
|
| 94 |
}
|
| 95 |
?>
|
| 96 |
|
| 97 |
lm_paypal_donations
|
| 98 |
-----------------------
|
| 99 |
|
| 100 |
Unlike subscriptions there are no donation definitions.
|
| 101 |
|
| 102 |
All donations are generated with PHP snippet like the following:
|
| 103 |
|
| 104 |
<?php
|
| 105 |
if (function_exists('lm_paypal_donate')) {
|
| 106 |
// 10 = amount, 'USD' is the currency followed by a description
|
| 107 |
print 'We would really like a $10 donation ' .
|
| 108 |
lm_paypal_donate(10, 'USD', 'donation to example.com') .'<br>';
|
| 109 |
// The amount is a one element array so an text input with the one value as
|
| 110 |
// default
|
| 111 |
print 'Write your own amount to give, we suggest $5' .
|
| 112 |
lm_paypal_donate(array(5), 'USD', 'donation to example.com') . '<br>';
|
| 113 |
// The amount is a multi element array so a select will be used. Note if one
|
| 114 |
// of the elements is itself an array that will be the default selection
|
| 115 |
// The final two parameters are an alternative button (here we use the default)
|
| 116 |
// and a replacement label before the amount
|
| 117 |
print 'We would really like a $10, or more, donation ' .
|
| 118 |
lm_paypal_donate(array(5,array(10),15), 'USD', 'donation to example.com', '', 'Donation') .'<br>';
|
| 119 |
}
|
| 120 |
?>
|
| 121 |
|
| 122 |
If the button is clicked by a logged in user then when the payment
|
| 123 |
arrives the amount will be associated with them.
|
| 124 |
|
| 125 |
Users can see any donations they have made via the standard 'my account > view'.
|
| 126 |
|
| 127 |
lm_paypal_paid_adverts
|
| 128 |
-----------------------
|
| 129 |
|
| 130 |
This module allow users to create Paid Advert pages, which are private
|
| 131 |
by default. They can then make them publically viewable using a PayPal
|
| 132 |
based subscription.
|
| 133 |
|
| 134 |
* This module requires the lm_paypal and lm_paypal_subscription modules
|
| 135 |
to be installed, enabled and configured.
|
| 136 |
|
| 137 |
Initial Configuration
|
| 138 |
|
| 139 |
If you are new to this module you need to:
|
| 140 |
|
| 141 |
* Update the site specific PayPal settings via lm_paypal admin. Normally
|
| 142 |
you only need to provide your PayPal Business Email.
|
| 143 |
|
| 144 |
* Create one or more Node Subscriptions using lm_paypal new subscriptions.
|
| 145 |
|
| 146 |
* Associate these roles with node types via admin / paid adverts.
|
| 147 |
|
| 148 |
From now on when users create nodes of types associated with Node
|
| 149 |
Subscriptions the contents will be private to the author until paid for.
|
| 150 |
|
| 151 |
Once a user creates a new node a tab will appear allowing them to pay
|
| 152 |
for the node with one of the available Node Subscriptions.
|
| 153 |
|
| 154 |
Users can view the status of all nodes they have created requiring a
|
| 155 |
subscription under "my account".
|
| 156 |
|
| 157 |
|
| 158 |
Ecommerce?
|
| 159 |
----------
|
| 160 |
If you are looking for a comprehensive ecommerce solution, this isn't it!
|
| 161 |
|
| 162 |
If you are looking for a full ecommerce system then I suggest:
|
| 163 |
http://drupal.org/project/ecommerce
|