Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
PHP code link to paypal .???????????????
Old 04-19-2005, 01:28 PM PHP code link to paypal .???????????????
Average Talker

Posts: 20
Trades: 0
Hi Guys , thanks in advance for starters ,
Im really stuck , Im fairly new to PHP but have used a script written by a company for a site design,
basically it is a classifieds site , but when i go to make a payment to Paypal , the payment always appears in dollars and not pounds
the buy now buttons work fine but there is something in the coding I am missing
Have trawled through the site and cant seem to find the problem ,
Have spoken to Paypal and they say the problem is at my end so I am at whitts end !!!!!!

Any help would be greatly appreciated ..!!

I have added all the php file here.......
Attached Files
File Type: zip help.zip (2.3 KB, 6 views)
dookster is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-19-2005, 01:30 PM site title
Average Talker

Posts: 20
Trades: 0
to view the site online


www.yournoticeboard.com


Cheers


banner advertising payment works fine goes to pounds
but when you log on or register and go to place an add the payment reverts to dollars when you click the pay now pay pal link ..
Cheers
Dooks
dookster is offline
Reply With Quote
View Public Profile
 
Old 04-19-2005, 02:48 PM
Republikin's Avatar
Defies a Status

Posts: 3,189
Trades: 3
Are pounds the default on the account your sending payments too? I noticed that in payment.php the string to send the information to paypal does not contain any specification of currency type so I think it's defaulting to your account default. Either way, here is a modified payment.php that "should" work. Let me know if it does not...

PHP Code:
<?
require_once("conn.php");
require_once(
"includes.php");

if(empty(
$_GET[SelectedPackage]))
{
    
header("location:$_SERVER[HTTP_REFERER]?e=1&PaymentGateway=$_GET[PaymentGateway]");
    exit();
}
elseif(empty(
$_GET[PaymentGateway]))
{
    
header("location:$_SERVER[HTTP_REFERER]?e=2&SelectedPackage=$_GET[SelectedPackage]");
    exit();
}
else
{
    if(!empty(
$_SESSION[AgentID]))
    {
        
$MyID $_SESSION[AgentID];
    }

    if(!empty(
$_SESSION[MemberID]))
    {
        
$MyID $_SESSION[MemberID];
    }

    
//get the agent details
    
$q1 "select * from class_members where MemberID = '$MyID' ";
    
$r1 mysql_query($q1) or die(mysql_error());
    
$a1 mysql_fetch_array($r1);

    
//get the price details
    
$q2 "select * from class_prices where PriceID = '$_GET[SelectedPackage]' ";
    
$r2 mysql_query($q2) or die(mysql_error());
    
$a2 mysql_fetch_array($r2);

    
/*

    flags:

    r -> renew

    n -> new

    m -> more

    */

    
if(ereg("renew.php"$_SERVER[HTTP_REFERER]))
    {
        
$flag "r";
        
$action "Renewal";
    }
    elseif(
ereg("more.php"$_SERVER[HTTP_REFERER]))
    {
        
$flag "m";
        
$action "Upgrade";
    }
    else
    {
        
$flag "n";
        
$action "Activation";
    }

    if(
$_GET[PaymentGateway] == "paypal")
    {
        
header("location:https://www.paypal.com/xclick?business=$aset[PayPalEmail]&currency_code=USD&item_name=$a2[ads] ads for $a2[days] days&first_name=$a1[FirstName]&last_name=$a1[LastName]&email=$a1[email]&item_number=1&custom=$MyID|$_GET[SelectedPackage]|$flag&amount=$a2[price]&notify_url=http://$_SERVER[HTTP_HOST]".dirname($_SERVER[PHP_SELF])."/notify.php&return=http://$_SERVER[HTTP_HOST]".dirname($_SERVER[PHP_SELF])."/login.php");

        exit();

    }

}

?>
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Republikin is offline
Reply With Quote
View Public Profile
 
Old 04-19-2005, 05:12 PM still dollars
Average Talker

Posts: 20
Trades: 0
Code link still works but it still showing up in dollars .????????

I have set all permissions in Paypal to united kingdom and currency to pounds sterling ,
it works fine if you click on nthe banner ads but coding is different for the buy now buttons ...
im still searching thanks for your help any more ideas.??
dookster is offline
Reply With Quote
View Public Profile
 
Old 04-19-2005, 05:17 PM
Gaffer Sports's Avatar
Ultra Talker

Posts: 397
Name: Steve
Location: Scotland
Trades: 1
Cptn,

Did you mean the code below?

PHP Code:
header("location:https://www.paypal.com/xclick?business=$aset[PayPalEmail]&currency_code=GBP&item_name=$a2[ads] ads for $a2[days] days&first_name=$a1[FirstName]&last_name=$a1[LastName]&email=$a1[email]&item_number=1&custom=$MyID|$_GET[SelectedPackage]|$flag&amount=$a2[price]&notify_url=http://$_SERVER[HTTP_HOST]".dirname($_SERVER[PHP_SELF])."/notify.php&return=http://$_SERVER[HTTP_HOST]".dirname($_SERVER[PHP_SELF])."/login.php"); 
You have set the default currency to USD, yet his problem is he wants GBP.

Steve.
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
Gaffer Sports is offline
Reply With Quote
View Public Profile Visit Gaffer Sports's homepage!
 
Old 04-19-2005, 05:20 PM Doh.!!!
Average Talker

Posts: 20
Trades: 0
silly me works a treat matey just had to change the currency in the coding you sent
you are a star if you need any flash help just gimmie a tap...
many thanks

J



)


big smile and I dont have to bang my head on the wall anymore .!!!!!!
dookster is offline
Reply With Quote
View Public Profile
 
Old 04-19-2005, 05:21 PM
Average Talker

Posts: 20
Trades: 0
Thanks guys , need some sleep i th9ink ..lol
dookster is offline
Reply With Quote
View Public Profile
 
Old 04-19-2005, 05:22 PM
Republikin's Avatar
Defies a Status

Posts: 3,189
Trades: 3
You know, I was at work when I did that and I transposed your needs, I thought it was the other way around. Glad you got it though.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Republikin is offline
Reply With Quote
View Public Profile
 
Old 04-19-2005, 05:22 PM
Average Talker

Posts: 20
Trades: 0
Once again thanks
dookster is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to PHP code link to paypal .???????????????
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.28528 seconds with 13 queries