/    Sign up×
Community /Pin to ProfileBookmark

Paid Advertising Banner System(w/PayPal)

Paid Advertising Banner System.

I need to make a system that will take interested users to paypal to take payment and return them and give my php script some kind of confirmation of the purchase. so then my user will be able to sumbit his image, url, name, and description of the banner he would like to place in rotation on ErieScene.Com. I do everything else, what I need to know is how the heck does this Payment Data Transfer work with paypal?

I can find no information on this as of yet.

This is what PayPal Says::

[QUOTE]

Payment Data Transfer allows you to receive notification of successful payments as they are made. The use of Payment Data Transfer depends on your system configuration and your Return URL. Please note that in order to use Payment Data Transfer, you must turn on Auto Return.

[/QUOTE]

Hit the Link to have it describe to you more about it it says this::

[QUOTE]

PayPal will post a token associated with the transaction, and you will need to send this token back to PayPal in order to obtain the payment details associated with the transaction. Based in the CGI script that you write for the page associated with the Return URL, you may dynamically post transaction details and confirmation that the payment has been completed to your customer. To use Payment Data Transfer, you must be able to support this notification system.

[/QUOTE]

Can anyone help me or direct me to the resource on this because I am at a loss.

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@Markbad311authorSep 28.2006 — Here is a script I had just found only problem is it is telling me I must have SSL. Well I don't that is why I am having PayPal handle billing and not me, for security. I just want some kind of confirmation. Here is the script I C&P from there.

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

$tx_token = $_GET['tx'];

$auth_token = "HEREISMYTOKEN ";

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


// post back to PayPal system to validate
$header .= "POST /cgi-bin/webscr HTTP/1.0rn";
$header .= "Content-Type: application/x-www-form-urlencodedrn";
$header .= "Content-Length: " . strlen($req) . "rnrn";
$fp = fsockopen ('www.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.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, "rn") == 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);
}
// 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);

?>

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='https://www.paypal.com'>www.paypal.com</a> to view details of this transaction.<br>
[/code]
Copy linkTweet thisAlerts:
@Markbad311authorSep 30.2006 — any have experince with this system. As you can figure this could cost subsantial money to test
Copy linkTweet thisAlerts:
@Markbad311authorOct 09.2006 — Well got it all figured out using some modifications on the script I posted. I recommend the script for those experiencing a feeling of "What The *&%^&".
×

Success!

Help @Markbad311 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...