ClipShare Community Forums  

Go Back   ClipShare Community Forums > ClipShare - Standard & PRO - Version 2 and Previous > Integrations
Register FAQ Bug Tracker Members List Calendar Mark Forums Read

Integrations Find / Share / Request the integration of ClipShare with other Scripts.


Reply
 
Thread Tools Display Modes
Old 04-21-2009, 09:57 AM   #21
jareau
Member
|Forum Newbie|
 
Join Date: Apr 2009
Posts: 1
jareau is on a distinguished road
Default fixed paypal subscription issue on CS 4.1.5

Quote:
Originally Posted by nmb1 View Post
im running 4.1.5 and i cant get it work either, sign up works, payment taken, subscriber table is populated, but it says account expired when you try to log in

In your PAYMENT.PHP file, do this:

Find this:
Code:
 $return = $config['BASE_URL']. '/pmt_success.php?pack=' .$pack_id. '&is_success=1&period=' .$s_period.';
Replace it with this:
Code:
 $return = $config['BASE_URL']. '/pmt_success.php?pack=' .$pack_id. '&is_success=1&period=' .$s_period. '&a='.$UID.'';
NOTICE the last variable a='.$UID.' ... this is going to place your new users ID in the URL


--Then--

Go to your PMT_SUCCESS.PHP file and add this directly under the 2 "require" statements:
Code:
$pack_id = ( isset($_GET['pack']) ) ? intval($_GET['pack']) : NULL;
$userid = ( isset($_GET['a']) ) ? intval($_GET['a']) : NULL;
The above pieces of code will get your PACK id and UserID from the URL, and make them available for the SQL statement


Next

Find this code:

Code:
$is_success = 'false';
if ( isset($_GET['is_success']) && $_GET['is_success'] ) {
	$success = 'true';
	STemplate::assign('exp_date', date('Y-m-d', strtotime("+$_GET[period]")));
And replace it with this code


Code:
$is_success = 'false';
if ( isset($_GET['is_success']) && $_GET['is_success'] ) {
	$success = 'true';
	STemplate::assign('exp_date', date('Y-m-d', strtotime("+$_GET[period]")));

	$expired_time = date("Y-m-d H:i:s", strtotime("+$_GET[period]"));

	$sql = "update subscriber set
			pack_id=$pack_id,
			subscribe_time='".date("Y-m-d H:i:s")."',
			expired_time='$expired_time'
			where UID = $userid";
	$conn->execute($sql);
	
	$sql = "update signup set
			account_status = 'Active'
			where UID=$userid";
	$conn->execute($sql);
}
jareau is offline   Reply With Quote
Old 03-18-2010, 04:34 AM   #22
ushanbb
Member
|Forum Newbie|
 
Join Date: Dec 2009
Posts: 15
ushanbb is on a distinguished road
Thumbs up Legend should be stickied - Thanks

I found this worked for me - and I have to tell you it is a monkey off my back.

I highly recommend the fix to anyone who wants paypal and subscriptions working together on their site.

Thank you!!

Quote:
Originally Posted by jareau View Post
In your PAYMENT.PHP file, do this:

Find this:
Code:
 $return = $config['BASE_URL']. '/pmt_success.php?pack=' .$pack_id. '&is_success=1&period=' .$s_period.';
Replace it with this:
Code:
 $return = $config['BASE_URL']. '/pmt_success.php?pack=' .$pack_id. '&is_success=1&period=' .$s_period. '&a='.$UID.'';
NOTICE the last variable a='.$UID.' ... this is going to place your new users ID in the URL


--Then--

Go to your PMT_SUCCESS.PHP file and add this directly under the 2 "require" statements:
Code:
$pack_id = ( isset($_GET['pack']) ) ? intval($_GET['pack']) : NULL;
$userid = ( isset($_GET['a']) ) ? intval($_GET['a']) : NULL;
The above pieces of code will get your PACK id and UserID from the URL, and make them available for the SQL statement


Next

Find this code:

Code:
$is_success = 'false';
if ( isset($_GET['is_success']) && $_GET['is_success'] ) {
	$success = 'true';
	STemplate::assign('exp_date', date('Y-m-d', strtotime("+$_GET[period]")));
And replace it with this code


Code:
$is_success = 'false';
if ( isset($_GET['is_success']) && $_GET['is_success'] ) {
	$success = 'true';
	STemplate::assign('exp_date', date('Y-m-d', strtotime("+$_GET[period]")));

	$expired_time = date("Y-m-d H:i:s", strtotime("+$_GET[period]"));

	$sql = "update subscriber set
			pack_id=$pack_id,
			subscribe_time='".date("Y-m-d H:i:s")."',
			expired_time='$expired_time'
			where UID = $userid";
	$conn->execute($sql);
	
	$sql = "update signup set
			account_status = 'Active'
			where UID=$userid";
	$conn->execute($sql);
}
ushanbb is offline   Reply With Quote
Old 05-31-2010, 11:21 PM   #23
stav
Member
|Forum Newbie|
 
Join Date: May 2010
Posts: 1
stav is on a distinguished road
Default

You must block direct access to the pmt_success.php
The referrer must be paypal

Becouse if user go manualy to submit this url

http://www.yourdomain.com/pmt_succes...=1Month& a=26

where pack=2 is the id of the pack
period=1Month or 1Year is for how long wil update the subscription
a=26 is the user id that will be updated

The subscription will be updated in the database without paypal payment
stav is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
paypal integration glennh Integrations 9 09-12-2007 03:41 AM
IPN Paypal replacement mentaldave Freelance Services 0 04-27-2007 06:32 PM
used paypal where is it sfcommunity Pre-Sales Questions 2 01-10-2007 10:38 PM



All times are GMT +1. The time now is 05:08 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright © 2006-2008 Envient. All Rights Reserved.

An Envient product.