Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1] 2   Go Down

Author Topic: Very Basic Paypal Subscription Mod/Hack  (Read 39845 times)

0 Members and 1 Guest are viewing this topic.

artistsinhawaii

  • VIP
  • Coppermine addict
  • ***
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 856
    • evj art and photography
Very Basic Paypal Subscription Mod/Hack
« on: October 15, 2005, 02:43:04 am »

I've seen a lot of posts for this so I'm adding this to the mod section.  This is a very basic paypal subscription mod.  Not much to it.

Place this javascript in your theme's template.html <head> section.


Quote
<script type="text/javascript">
<!--//hide from xhtml verifiers
function Dollar (val) {     // take str or num, return str
var str,pos,rnd=0;
  if (val < .995) rnd = 1;  // for old Netscape browsers
  str = escape (val*1.0 + 0.005001 + rnd);  // float, round, escape
  pos = str.indexOf (".");                  // should be one
  if (pos > 0) str = str.substring (rnd, pos + 3);
  return str;  // return valid PayPal dollar string
}

function ReadForm (obj1, tst) { // process un-named selects
var pos,val,txt,des,ary;
  if (tst && (obj1.a3.value == "")) {
    alert ("Make a subscription selection!");
    return;
  }
  des = obj1.basedes.value;           // base description
  pos = obj1.sub.selectedIndex;       // subscription selected
  txt = obj1.sub.options[pos].text;   // select text data
  val = obj1.sub.options[pos].value;  // select value data
  ary = val.split (",");              // isolate items in array
  obj1.t3.value  = ary[0].toUpperCase ();
  obj1.p3.value  = ary[1];
  obj1.a3.value  = Dollar (ary[2] * ary[1]);
  obj1.src.value = ary[3];
  obj1.sra.value = ary[4];
  obj1.item_name.value = des;
  obj1.item_number.value = val.toUpperCase ();
}
//-->
</script>
 

Next place this in either your template.html or your anycontent.php file.

Quote
<h3>Basic recurring subscription - Sorry, no free trials.</h3>

<form action="https://www.paypal.com/cgi-bin/webscr" method="post"
onsubmit="this.target='paypal';
          return ReadForm (this, true);">
<p>
<input type="hidden" name="cmd" value="_xclick-subscriptions" />
<input type="hidden" name="business" value="test@paypal.com" />
<input type="hidden" name="item_name" value="" />
<input type="hidden" name="item_number" value="" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="lc" value="US" />
<input type="hidden" name="no_note" value="1" />
<input type="hidden" name="no_shipping" value="1" />
<input type="hidden" name="basedes" value="Test Item" />

Description of item - Subscribe now!
<br /><br />

<select name="sub" onchange="ReadForm (this.form, false);">
  <option>Subscription type</option>
  <option value="d,1,2.00,1,1">Daily ($2.00/day)</option>
  <option value="w,1,10.00,1,1">Weekly ($10/week)</option>
  <option value="m,1,40.00,1,1">Monthly ($40/month)</option>
  <option value="m,3,35.00,1,1">Quarterly ($35/month)</option>

  <option value="m,6,30.00,1,1">Biannually ($30/month)</option>
  <option value="y,1,300.00,1,1">Yearly ($25/month)</option>
  <option value="y,3,240.00,0,1">3 Years ($20/month)</option>
</select>
<br /><br />

<input type="image" src="http://www.paypal.com/images/x-click-but20.gif" name="submit" alt="Make payments with PayPal - it's fast, free and secure!" />
<input type="hidden" name="a3" value="" />
<input type="hidden" name="p3" value="" />
<input type="hidden" name="t3" value="" />
<input type="hidden" name="src" value="" />

<input type="hidden" name="sra" value="" />
</p>
</form>

<hr />   

Change the values as needed.  Change the email address as well. 
Please don't ask me design questions.  How you might design your layout is very different from me or anyone else.

Dennis
« Last Edit: October 15, 2005, 10:07:57 am by GauGau »
Logged
Learn and live ... In January of 2011, after a botched stent attempt, the doctors told me I needed a multiple bypass surgery or I could die.  I told them I needed new doctors.

trackman

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 50
Re: Very Basic Paypal Subscription Mod/Hack
« Reply #1 on: December 05, 2005, 11:19:22 pm »

How do I link this mod/hack up to my pay pal account ;D
Logged

artistsinhawaii

  • VIP
  • Coppermine addict
  • ***
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 856
    • evj art and photography
Re: Very Basic Paypal Subscription Mod/Hack
« Reply #2 on: December 06, 2005, 12:26:11 am »

Change this line:

<input type="hidden" name="business" value="test@paypal.com" />


Dennis
Logged
Learn and live ... In January of 2011, after a botched stent attempt, the doctors told me I needed a multiple bypass surgery or I could die.  I told them I needed new doctors.

ian ditch

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 49
Re: Very Basic Paypal Subscription Mod/Hack
« Reply #3 on: December 18, 2005, 08:03:18 pm »

Hey, Ive been looking for a mod like this but would like to automatically place the member into a different group when that member subscribes and back out off that group when they un-subscribe.

Would this mod do this? if not what would I need to do this?
Logged

artistsinhawaii

  • VIP
  • Coppermine addict
  • ***
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 856
    • evj art and photography
Re: Very Basic Paypal Subscription Mod/Hack
« Reply #4 on: December 18, 2005, 09:18:58 pm »

Hey, Ive been looking for a mod like this but would like to automatically place the member into a different group when that member subscribes and back out off that group when they un-subscribe.

Would this mod do this? if not what would I need to do this?

I don't know of any automatic way of doing the above.  You could create a paypal return form (see paypal for instructions on this) and on that page you would have a username and password with instructions for the user to change and how to change their username and password as soon as they have logged in. Inform them that the assigned username and password is temporary and will be disabled shortly.   You should change these regularly.

You subscriber after payment will be directed to this page and see the information.

Removing users from the group, I'm afraid will have to be manual.  I can't think of any way of reading paypal's database against your coppermine's database.  It's the part of earning money that's called "work", I suppose.

Dennis




Logged
Learn and live ... In January of 2011, after a botched stent attempt, the doctors told me I needed a multiple bypass surgery or I could die.  I told them I needed new doctors.

ian ditch

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 49
Re: Very Basic Paypal Subscription Mod/Hack
« Reply #5 on: December 18, 2005, 10:35:47 pm »

Thanks for your promt Reply Dennis, I'll take a look at the paypal site and see whats involved with doing the above. Many Thanks
Logged

chican0

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 20
  • Soy Chicano!
    • SoyChicano Gente
Re: Very Basic Paypal Subscription Mod/Hack
« Reply #6 on: December 26, 2005, 12:08:39 pm »

Thanks for your promt Reply Dennis, I'll take a look at the paypal site and see whats involved with doing the above. Many Thanks

Have you come up with a solution?

fcarentz

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 24
Re: Very Basic Paypal Subscription Mod/Hack
« Reply #7 on: December 29, 2005, 09:24:07 am »

As it stands this MOD would not support moving your members from one group to another upon signup...

Can it be done, Yes it can, via PayPal IPN. You have to set this up via your PayPal account options.

Then in the form as it is psted above you would have to add this line

Code: [Select]
<input type="hidden" name="notify_url" value="http://www.YOURSITE.com/SCRIPT_TO_RUN_COMMANDS.php">
PayPal would then send an HTTP Post back to that address and your SCRIPT_TO_RUN_COMMANDS.php would have to know what to do depending on what PayPal was telling it...Did they Subscribe do this...Did the cancel do this blah blah blah....

Sorry I am currently doing this for my site, and its a HUGE pain in the rear...even more so becuase I am not a CPG standalone site, HELP!!! LMAO  ;D

Anyway hope that helps at least a little...is this somthing that is stell really needed? Or has someone finally done this?

Huser

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Very Basic Paypal Subscription Mod/Hack
« Reply #8 on: January 01, 2006, 11:18:46 am »

But would this work for say coppermine bridged with phpbb forum??
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Very Basic Paypal Subscription Mod/Hack
« Reply #9 on: January 01, 2006, 04:23:54 pm »

I couldn't see a reason why it shouldn't work. Easiest way to find out (instead of posting the question and waiting for others to find your answers) is by trying yourself and posting feedback.
Logged

fcarentz

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 24
Re: Very Basic Paypal Subscription Mod/Hack
« Reply #10 on: January 02, 2006, 07:57:36 pm »

I couldn't see a reason why it shouldn't work. Easiest way to find out (instead of posting the question and waiting for others to find your answers) is by trying yourself and posting feedback.

Yep, thats the best way. Hack at it until it works LOL.

When I have more time on my hands, if someone hasnt already given it a go and gotten it to work, maybe I will give this one a go.

AWJunkies

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 130
Re: Very Basic Paypal Subscription Mod/Hack
« Reply #11 on: January 16, 2006, 12:30:53 am »

I am really interested in this MOD to be full stand alone and not have to go into paypal and check status and change user status accordingly.  Just messin. I also want it to work with credit cards but that is a whole different storry.
Logged

fcarentz

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 24
Re: Very Basic Paypal Subscription Mod/Hack
« Reply #12 on: January 17, 2006, 08:42:43 pm »

I am really interested in this MOD to be full stand alone and not have to go into paypal and check status and change user status accordingly.  Just messin. I also want it to work with credit cards but that is a whole different storry.

Thats exactly what it would do...your site would receive a transmission from paypal behind the scenes and take care of everything for you. Paypal = Credit Cards processing so I have no idea what you are on about?

AWJunkies

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 130
Re: Very Basic Paypal Subscription Mod/Hack
« Reply #13 on: January 17, 2006, 11:11:39 pm »

Sorry the just messin part should not be there. I was making a joke and decided to delete it but forgot to delete that part. I have the paypal setup on coppermine as well as CC and have to do all the changes to accounts manuely. I gets to be a pain in but when you have over 3k members and about to implement it on a site with 80k people. I will not be able to keep up manuely with requests. So has someone programed the file to auto change everything? Any status on it or has anyone started it? If nobody has I will take a crack at it once I am done with a few other things on site.
Logged

fcarentz

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 24
Re: Very Basic Paypal Subscription Mod/Hack
« Reply #14 on: January 20, 2006, 03:09:55 pm »

Sorry the just messin part should not be there. I was making a joke and decided to delete it but forgot to delete that part. I have the paypal setup on coppermine as well as CC and have to do all the changes to accounts manuely. I gets to be a pain in but when you have over 3k members and about to implement it on a site with 80k people. I will not be able to keep up manuely with requests. So has someone programed the file to auto change everything? Any status on it or has anyone started it? If nobody has I will take a crack at it once I am done with a few other things on site.

No one has yet that I am aware of.

AWJunkies

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 130
Re: Very Basic Paypal Subscription Mod/Hack
« Reply #15 on: January 20, 2006, 09:01:04 pm »

I will work on the code right after I finish the bridge for nuke
Logged

justal

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 46
Re: Very Basic Paypal Subscription Mod/Hack
« Reply #16 on: July 13, 2006, 09:28:36 am »

Has anyone got any further with this yet??

I'm looking for a mod that will change a members CPG Group upon payment of a Paypal Subscription (and change it back once that subscription expires).

Has any progress been made with such a mod.

Thanks,
Al.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Very Basic Paypal Subscription Mod/Hack
« Reply #17 on: July 13, 2006, 09:35:18 am »

Don't request different mods on this thread. In fact, don't do this on any mod thread. It only clutters the thread. Start a new thread on the support board that deals with your version, or post on the paid help section if you're ready to actually pay/sponsor a mod.
Logged

justal

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 46
Re: Very Basic Paypal Subscription Mod/Hack
« Reply #18 on: July 14, 2006, 08:45:06 am »

Sorry.... But I was only asking if any progress had been made with this modification as discussed earlier in this thread. I thought it was better to keep the information all in one place rather than start another thread about the same thing.... But if those are the rules I shall start another thread about this elsewhere.

Cheers.
Al.
Logged

julii

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Very Basic Paypal Subscription Mod/Hack
« Reply #19 on: January 25, 2007, 11:21:01 pm »

you can incorporate the paypal IPN feature using PHPcoin (www.phpcoin.com) It's totally cost free and there is no advertising, takes a little setting up though :)
Logged
Pages: [1] 2   Go Up
 

Page created in 0.031 seconds with 20 queries.