Jump to content

Cant get paypal to work with page


stjimmy

Recommended Posts

Hi!

 

Im trying to build a page where you can place ads for a small amount. First you have to pay and then you get to create your ad. But after creating the ad I always get the message that "the site has not received your payment" and users is unable to create ad.

 

This is the area in the code that produces the error message:

 

		// Get the row from the users table
	if ( $ad_cost > 0 )
	{
		$sql = "SELECT * 
				FROM ". ADS_USERS_TABLE ." 
				WHERE users_user_id = ".$userdata['user_id'];

		$result = $db->sql_query($sql);
		$row = $db->sql_fetchrow($result);

		if ( !$row )
		{
			message_die(GENERAL_ERROR, $lang['no_credit']);
		}

		// Check for sufficient credit
		if ( $ad_cost > $row['users_balance'] )
		{
			message_die(GENERAL_ERROR, $lang['insuffient_credit']);
		}
	}

	// Create the ad
	$user_ip = $userdata['session_ip'];
	$time = time();
	$expiry_date = mktime(0, 0, 0, date("m") + $ad_duration, date("d"), date("Y"));
	$status = 'active';

	// Insert for the adverts table
	$sql = "INSERT INTO ". ADS_ADVERTS_TABLE ." (category, sub_category, ad_type_code, basic_ad_ind, standard_ad_ind, photo_ad_ind, premium_ad_ind, ad_cost, user_id, username, user_ip, time, title, short_desc, price, status, expiry_date, trade_ind, loc_id)
			VALUES ('$category', '$sub_category', '$ad_type_code', '$basic_ad_ind', '$standard_ad_ind', '$photo_ad_ind', '$premium_ad_ind', $ad_cost, '$user_id', '$username', '$user_ip', '$time', '$title', '$short_desc', '$price', '$status', '$expiry_date', '$trade_ind', '$locnum')";

	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Could not insert adverts row', '', __LINE__, __FILE__, $sql);
	}

	$id = $db->sql_nextid();

 

Since I am no programmer I dont know if this problem is related to the code or if this is a paypal issue thing. The money is in my account so that works, but the software still refuses to create an ad.

 

I would appreciate any help!

Link to comment
Share on other sites

Sadly they dont seem to be able to help me. They say:

 

From what you described there is a problem in the program not recognizing the payment coming back. In you button code, you set an IPN script URL so that the program gets the information about the transaction?

 

I dont know what to do.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.