/[drupal]/contributions/modules/paypal_framework/README.txt
ViewVC logotype

Contents of /contributions/modules/paypal_framework/README.txt

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.6 - (show annotations) (download)
Tue May 30 18:01:52 2006 UTC (3 years, 5 months ago) by eaton
Branch: MAIN
CVS Tags: DRUPAL-4-7--1-0, DRUPAL-5--1-0, HEAD
Branch point for: DRUPAL-5, DRUPAL-4-7
Changes since 1.5: +1 -9 lines
File MIME type: text/plain
Minor updates for 4.7
1 PayPal Framework module for Drupal
2 ------------------------------------
3
4 To install:
5 untar the archive with a similar command
6 tar xzf paypal_framework-cvs.tar.gz
7 cd paypal_framework
8 Copy the paypal_framework.module to your drupal modules directory
9 cp paypal_framework.module /var/www/htdocs/modules/
10 Log into Paypal.com and point your IPN URL to
11 http://yoursite/paypal/ipn
12 (I should highly suggest setting up SSL)
13
14 Objectives:
15 To provide the drupal community with a module that would
16 reduce the amount of code and effort required to make
17 paypal oriented modules.
18
19 Features:
20
21 IPN Verification Methods
22 Currently implimented are libCurl, fsock, and
23 curl binary. libCurl requires Curl to be
24 compiled into php. fsock needs --enable-sockets
25 (or something like that). Curl Binary needs
26 exec() and a curl binary somewhere accessable
27 to drupal. Keep in mind you can't execute
28 /usr/bin/curl is php is in safe_mode, but you
29 can execute misc/curl if you upload it there.
30
31 Reciever ID filtering
32 If the email address isn't in this list, then
33 the transaction is discarded.
34
35 Mysql Delayed Inserts
36 I didn't know if this was ANSI sql, so I enabled
37 it for MySQL only. If enabled, all INSERTs are
38 actually INSERT DELAYED. Which removes alot of load
39 on your harddisks. The INSERT is put into a buffer
40 in memory and committed when it has a chance.
41
42 Verification Queueing
43 The idea came to my head that alot of 'automated
44 anti-DoS' systems are probably in place. Not to
45 mention some server admins might see alot of
46 transatctions as malicious activity. So, to counter
47 this, I decided to impliment queuing. The way
48 it works is if enable, *all* posts that pass the
49 reviever ID filter, get stored as raw data in the
50 paypal_queue table. When cron runs, the _cron
51 runs, a number of (or all) of these stored transactions
52 are analyzed and processed as if queuing wasn't enabled.
53
54 Real-time Transaction Hook
55 Drupal modules that use this framework may react
56 to PayPal transactions in real-time. When a transaction
57 is recorded to the database--after verification queueing
58 --the framework invokes the _paypal_transaction() hook.
59 This reduces the site's reaction time so payments can
60 have immediate results instead of waiting hours before
61 the next cron update. This is an event-driven rather
62 than a polling architecture.
63
64 View Raw PayPal Transaction Information
65 This framework also provides a way to view individual
66 transaction's details and can sort by payer ID, item
67 number, date, and other methods.
68
69
70 Examples:
71
72 Dynamic Email Filter:
73 // This makes it very easy to add users to the filter
74 $new_mail=array("mike@death.com","grimm@jordan.edu");
75 $email=variable_get("paypal_emails","");
76 foreach( $new_mail as $m )
77 $email="\n$m";
78 variable_set("paypal_emails",$email);
79
80 // To remove an email
81
82 $h8="grimm@jorban.edu";
83 $email=variable_get("paypal_emails","");
84 $email=explode("\n",$email); // Its an array now
85 $new_mail=array();
86 foreach( $email as $m ){
87 if(strtolower($m)!=strtolower($h8))
88 $new_mail[]=$m;
89 }
90 $new_mail=implode("\n",$new_mail);
91 variable_set("paypal_emails",$new_mail);
92
93 Donations Block
94
95 $funds=db_fetch_object(db_query("SELECT sum(mc_gross) as gross, sum(mc_fee) as fee from {paypal_log} where item_number='GL0001'"));
96
97 $block= t("<i>Total Donations: $</i>".number_format(($funds->gross - $funds->fee),2));
98 $form =" ";
99 $form.="<input type=\"hidden\" name=\"cmd\" value=\"_xclick\">
100 <input type=\"hidden\" name=\"business\" value=\"cracker@gamerslan.us\">
101 <input type=\"hidden\" name=\"item_name\" value=\"Gamerslan.us Project Fund\">
102 <input type=\"hidden\" name=\"item_number\" value=\"GL0001\">
103 <input type=\"hidden\" name=\"cn\" value=\"Friendly Comments\">
104 <input type=\"hidden\" name=\"currency_code\" value=\"USD\">
105 <input type=\"hidden\" name=\"tax\" value=\"0\">
106 ";
107 $form.="<input type=\"image\" src=\"https://www.paypal.com/en_US/i/btn/x-click-but04.gif\" border=\"0\" name=\"submit\" alt=\"Make payments with PayPal - it's fast, free and secure!\">";
108
109 $block.=form($form,"POST","https://www.paypal.com/cgi-bin/webscr");
110
111 return $block;
112
113 Authors:
114
115 Kevin Landreth (crackerjackmack@evilsquid.net)
116 Nic Ivy (nji@njivy.org)
117 Jeff Eaton (jeff@viapositiva.net) -- 4.7 update

  ViewVC Help
Powered by ViewVC 1.1.2