Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Paypal integration with PHP step by step [closed]

Tags:

php

paypal

I am new to Paypal integration with PHP, i have searched in the internet i am not able to get correct one to implement in my website.

Can anyone help to to integration of paypal for my website with step by step including the test account creation .

Thanks in advance.

like image 537
Antoniraj Avatar asked Oct 15 '12 03:10

Antoniraj


2 Answers

When I made my first paypal script one of the most useful things that I did was to log every piece of information that came through. I just dumped everything into a text file whenever Paypal called the confirmation page. It was incredibly helpfull to see what they were passing over and to debug. Paypal sends a POST of the transaction.

$dumpfile = "=== post fields\n";
foreach($_POST as $k=>$v)
    $dumpfile .= "[$k] => $v\n";

$dumpfile .= "=== http request headers\n";
foreach(apache_request_headers() as $k=>$v)
    $dumpfile .= "[$k] => $v\n";

file_put_contents('pathToAWritableFile', $dumpfile);

I hope this saves you some headache. As a side note, I still keep all the paypal request info in a database in case the purchase logic fails after I update the paypal confirmation script, that has saved me a couple of times.

Here's a tut on how to handle the callback from paypal.

like image 180
Adam Avatar answered Oct 19 '22 14:10

Adam


https://developer.paypal.com/ is a great place to start.

They offer guides and code libraries and examples there.

like image 29
Dean Rather Avatar answered Oct 19 '22 15:10

Dean Rather