Link to home
Start Free TrialLog in
Avatar of akiles99
akiles99Flag for India

asked on

Paypal expert

I need my order form at www.JointVentureDeals.com/order.htm simply integrated with my Authorize Net gateway account. I have all the fields in the form that I believe are correct.

Need ur assistance...
Avatar of EMB01
EMB01
Flag of United States of America image

I have integrated PayPal from the ground up... What's the specific question?
Avatar of akiles99

ASKER

I'm going to appear for paypal developer certification.Need to learn more about in parallel.

Can u guide me..?
Depends on what you're trying to do - what's your specific question(s) regarding PayPal integration with PHP applications?
Tell me how u integrate paypal with the php code?
The easiest way to integrate PayPal with PHP is to use the PayPal IPN:
https://www.paypal.com/us/cgi-bin/webscr?cmd=p/pdn/ipn-codesamples-pop-outside
Also when i learning abt the paypal i heard of soap API...

Any idea about it?
Can u explain this code...I'm new to coding..But can understand if u teach me...
// read the post from PayPal system and add 'cmd'
$req = 'cmd=_notify-validate';
 
foreach ($_POST as $key => $value) {
$value = urlencode(stripslashes($value));
$req .= "&$key=$value";
}
 
// 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 ('ssl://www.paypal.com', 443, $errno, $errstr, 30);
 
// assign posted variables to local variables
$item_name = $_POST['item_name'];
$item_number = $_POST['item_number'];
$payment_status = $_POST['payment_status'];
$payment_amount = $_POST['mc_gross'];
$payment_currency = $_POST['mc_currency'];
$txn_id = $_POST['txn_id'];
$receiver_email = $_POST['receiver_email'];
$payer_email = $_POST['payer_email'];
 
if (!$fp) {
// HTTP ERROR
} else {
fputs ($fp, $header . $req);
while (!feof($fp)) {
$res = fgets ($fp, 1024);
if (strcmp ($res, "VERIFIED") == 0) {
// 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
}
else if (strcmp ($res, "INVALID") == 0) {
// log for manual investigation
}
}
fclose ($fp);
}
?>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of EMB01
EMB01
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
P.S. The function above isn't exactly a for-loop, but it is good to know how to use one anyway. Here is documentation on the actual function used in the script:
http://us.php.net/foreach
>>>I highly recommend reading the following book... I didn't know how to integrate PayPal before I read it either:

But u know some coding languages right?But i dont know any language.Jus starting my carreer.
I knew very little, but PHP is quite easy for me now. Let me tell you, PHP (in my experience) is simply getting an understanding of how programming works (i.e. declaring variables, using functions, etc.), learning functions, and learning best programming practices. If you're beginning programming, I would also recommend this series of books (Visual Blueprint):
http://www.amazon.com/PHP-Blueprint-Creating-Server-Side-Content/dp/0764535617

That book will help you understand programming in general, and show you how PHP works at the same time.

Also, if you're just beginning; you probably don't want to just start out learning PHP. I think it would be wise to gain a solid understanding of HTML (if you havn't already). That way, you'll get to learn how programming works.

It took me a pretty long time before I was able to program my own applications. You may be better off taking a computer-programming class. All I did was read books...
So u first want me to read HTML?Any good links for that...
Of course, check this place out:
http://www.w3schools.com/html/DEFAULT.asp

Another good way to accomplish programming goals for beginners is to use pre-built tools, such as these from WebAssist:
http://www.webassist.com/
U really helped a lot...

I will sure read the books u preferred.

I have a account to my company library where i have all the books u said.Jus now going thru the web API also i found a book same like this but that is development with API.

Anyway i first follow ur instructions.

1.Html
2.PHP
3.WebAPI

Right?
Who is Expert?

Who shares and care for helping others and EMB01 is the one and best i have seen.

Thanks a lot:)
Yes, I believe that's the best way to go about your education in this field. Remember, these are the goals to go after:
- Gain a solid understanding of general programming (via simple languages such as HTML, CSS, even BBCODE.
- Learn basic PHP syntax and use of variables, functions and operators (http://us2.php.net/manual/en/language.basic-syntax.php).
- Implement these programming practices to create custom applications using a web-based API (such as PayPal).
Thanks i will sure follow this may be it takes some years But i will be reach u oneday with my improvement...

Also http://www.webassist.com/  which one i need to use?
Well, I'm not sure you'll ever reach me! (just kidding!)

I recommend using WebAssist if you use Dreamweaver. They make extensions for Dreamweaver that will assist in development. For example, if you want a pre-built (but customizable) shopping cart that will integrate PayPal with Authorize.NET, check out this product:
http://www.webassist.com/professional/products/productdetails.asp?PID=123
Ok Thanks....Its already late see u tomorrow on different thread:)

Good Night::)-
Take it easy! I'm glad I could help. Goodluck and stick with it - it'll be hard at first (I'm self-educated) and you'll probably get lost a bit; but remember: You can do it!