Web Hosting
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb HostingWeb Hosting

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 14th, 2004, 09:36 PM
isheikh isheikh is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2003
Posts: 566 isheikh New User: is a brand new recruit and a unknown entity at this point. 
Time spent in forums: 2 Days 11 h 35 m 19 sec
Reputation Power: 0
paypal and hosting

Hi,

I have hooked up a website with Palpal on my home server.
It is working fine. I get "FAIL" or "SUCCESS" response from PayPal.
But when I put the exact same code on hosting company (dynonames.com). I get empty response from Paypal.

Paypal says talk to your hosting company, hosting company says everthing is fine on our side talk to PayPal.

I wonder if anyone has any idea why I am having this problem?

Thanks
__________________
web developer

Reply With Quote
  #2  
Old December 15th, 2004, 03:13 AM
monsterhosting's Avatar
monsterhosting monsterhosting is offline
Moderator
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2003
Location: Vancouver, BC
Posts: 889 monsterhosting User rank is Second Lieutenant (5000 - 10000 Reputation Level)monsterhosting User rank is Second Lieutenant (5000 - 10000 Reputation Level)monsterhosting User rank is Second Lieutenant (5000 - 10000 Reputation Level)monsterhosting User rank is Second Lieutenant (5000 - 10000 Reputation Level)monsterhosting User rank is Second Lieutenant (5000 - 10000 Reputation Level)monsterhosting User rank is Second Lieutenant (5000 - 10000 Reputation Level)monsterhosting User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 5 Days 9 h 57 m 24 sec
Reputation Power: 61
Send a message via AIM to monsterhosting Send a message via MSN to monsterhosting
Can you provide a link or something so we can all test it?
__________________
Gary Jones

BlueFur.com - Canada Web Hosting

Reply With Quote
  #3  
Old December 15th, 2004, 04:20 AM
AtomixNetwork's Avatar
AtomixNetwork AtomixNetwork is offline
The Local Host
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Location: Auckland, New Zealand
Posts: 92 AtomixNetwork User rank is Private First Class (20 - 50 Reputation Level)AtomixNetwork User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 6 h 30 m 37 sec
Reputation Power: 5
Send a message via AIM to AtomixNetwork Send a message via MSN to AtomixNetwork
I'd recommend checking the code.. making sure it submits to the right site.. or else maybe the server doesn't support the coding language?

Would be a good idea to post the link(s) as monsterhosting has said above..

Reply With Quote
  #4  
Old December 15th, 2004, 02:31 PM
isheikh isheikh is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2003
Posts: 566 isheikh New User: is a brand new recruit and a unknown entity at this point. 
Time spent in forums: 2 Days 11 h 35 m 19 sec
Reputation Power: 0
i don't think you can test unless you have account on PayPal sandbox, which is their testing inviorment.

Anyway link for Host

http://teststore420.biz/php_uploads/testbutton_paypal_host.htm


Link to my server

http://www.test420.biz/testbutton_paypal_home.htm

********The code ****************
<?php
// read the post from PayPal system and add 'cmd'
$req = 'cmd=_notify-synch';

$tx_token = $_GET['tx'];

$auth_token = "U9ki_Q_3BcBVti61nFNHr5KHudpGu4SzxOjIS9gr0nGY55kcSiWtVX58qQe";

$req .= "&tx=$tx_token&at=$auth_token";


$header = "";
// post back to PayPal system to validate
$header .= "POST /cgi-bin/webscr HTTP/1.0\r\n";
$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
$header .= "Content-Length: " . strlen($req) . "\r\n\r\n";



$fp = fsockopen ('www.sandbox.paypal.com', 80, $errno, $errstr, 30);


// If possible, securely post back to paypal using HTTPS
// Your PHP server will need to be SSL enabled
// $fp = fsockopen ('ssl://www.sandbox.paypal.com', 443, $errno, $errstr, 30);

if (!$fp) {
// HTTP ERROR
} else {
fputs ($fp, $header . $req);
// read the body data
$res = '';
$headerdone = false;
while (!feof($fp)) {






$line = fgets ($fp, 1024);


if (strcmp($line, "\r\n") == 0) {
// read the header
$headerdone = true;
}
else if ($headerdone)
{
// header has been read. now read the contents
$res .= $line;



}
}

// parse the data
$lines = explode("\n", $res);
$keyarray = array();
//if (strcmp ($lines[0], "SUCCESS") == 0) {






//for ($i=1; $i<count($lines);$i++){
//list($key,$val) = explode("=", $lines[$i]);
//$keyarray[urldecode($key)] = urldecode($val);



//}









if (strcmp ($lines[0], "SUCCESS") == 0) {

for ($i=1; $i<count($lines);$i++)
{
if (strpos($lines[$i], '=') !== false)
{
list($key,$val) = explode("=", $lines[$i]);
$keyarray[urldecode($key)] = urldecode($val);
}
}


// check the payment_status is Completed
// check that txn_id has not been previously processed
// check that receiver_email is your Primary PayPal email
// check that payment_amount/payment_currency are correct
// process payment
$firstname = $keyarray['first_name'];
$lastname = $keyarray['last_name'];
$itemname = $keyarray['item_name'];
$amount = $keyarray['mc_gross'];

echo ("<p><h3>Thank you for your purchase!</h3></p>");

echo ("<b>Payment Details</b><br>\n");
echo ("<li>Name: $firstname $lastname</li>\n");
echo ("<li>Item: $itemname</li>\n");
echo ("<li>Amount: $amount</li>\n");
echo ("");
}
else if (strcmp ($lines[0], "FAIL") == 0) {
// log for manual investigation



}

}



fclose ($fp);

?>
<BR><BR>
Your transaction has been completed, and a receipt for your purchase has been emailed to you.<br>You may log into your account at <a href='www.paypal.com</a>" target="_blank">www.paypal.com</a>" target="_blank">https://www.paypal.com'>www.paypal.com</a> to view details of this transaction.<br>

*********

Array $lines comes empty on Hosting company

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb HostingWeb Hosting > paypal and hosting


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT