Jump to content


Photo

New problem(bottom post)Paypal developer center?


  • Please log in to reply
9 replies to this topic

#1 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 03 October 2006 - 03:25 PM

I was wondering, here
https://developer.pa...cmd=_signup-run

I have a paypal account with my email address.
I also use paypal alot during development, and I have always had issues getting it to work, and to test it, I sit there and send the person 1 penny at a time, over and over again during the testing phase.  As well as send all the money back to me, and when I did 2 projects back, I noticed I had sent here nearly 2 dollars in pennies, through paypal.  I was figuring there had to be an easier way, so I went to paypal dev center, to see if I wanted to use. 
I don't get a few things go, I set up an email there, if I use the same email tosign up for that as my original paypal account what happens?

Can someone also tell me a little about how this works.  I know quite a bit about it, I have read what I could find about it?

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#2 jcombs_31

jcombs_31
  • Staff Alumni
  • Advanced Member
  • 2,066 posts
  • LocationFL

Posted 03 October 2006 - 03:56 PM

They have all the documentation available on the paypal site. I think they would know best.

#3 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 03 October 2006 - 04:30 PM

I finally got in, I set up 2 paypal email accounts, in the sandbox.  I was wondering how to figure out one thing though, I choose 2 test email accounts, but how do I use those accounts when I am trying to mess with the form, that I am putting through the payments.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#4 Daniel0

Daniel0
  • Staff Alumni
  • Advanced Member
  • 11,956 posts

Posted 03 October 2006 - 05:29 PM

Try the SDK here: https://www.paypal.c...k-resource.html

#5 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 03 October 2006 - 05:42 PM

I don't know anything about them, I don't think I have any need for paypal's api, I have so far only needed the ipn,  I think they are for different purposes, I can always go back to testing it with 1 penny at a time, but I was hoping the sandbox would fix that, is there another way, or another idea.  Like for instance how to use the paypal email's in the sandbox to test the stuff.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#6 neylitalo

neylitalo
  • Staff Alumni
  • Advanced Member
  • 1,854 posts
  • LocationMichigan, USA

Posted 03 October 2006 - 05:54 PM

Yes, the sandbox does fix that. You just have to change the action="" attribute of your PayPal form. It normally points to https://www.paypal.com/something, but you need to change it to point to https://sandbox.paypal.com/something. I believe that's the URL, anyway - look around and you'll find it.
http://nealylitalo.net - My personal website, and home of The Netizen's Journal.

#7 Daniel0

Daniel0
  • Staff Alumni
  • Advanced Member
  • 11,956 posts

Posted 03 October 2006 - 06:30 PM

Yes, the sandbox does fix that. You just have to change the action="" attribute of your PayPal form. It normally points to https://www.paypal.com/something, but you need to change it to point to https://sandbox.paypal.com/something. I believe that's the URL, anyway - look around and you'll find it.


You just need www. in front of it, so it is: https://www.sandbox.paypal.com/

#8 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 03 October 2006 - 08:01 PM

Thank you, finally I was able to get someone to help, I was trying on 2 different paypal forums.

Now in reality you see why I come to phpfreaks, for every single question I have, except some php questions, adn a few css questions at w3schools.  90% of the time phpfreaks is the best place to ask for questions.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#9 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 03 October 2006 - 09:12 PM

<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="business" value="testrecieve@paypaldev.com" />
<input type="hidden" name="item_name" value="Payment Option 1" />
<input type="hidden" name="item_number" value="1" />
<input type="hidden" name="amount" value="0.01" />
<input type="hidden" name="no_shipping" value="1" />
<input type="hidden" name="no_note" value="1" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="bn" value="PP-BuyNowBF" />
<input type="hidden" name="return" value="http://www.hasbadservice.com/thankyou.php" />
<input type="hidden" name="cancel_return" value="http://www.hasbadservioce.com/cancelpayment.php" />
<input type="hidden" name="notify_url" value="http://www.hasbadservice.com/ipn.com" />
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but02.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!" />
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
That fixed that problem, it's starting to work now, but it's not doing what I need in the ipn, I am just testing it out to see if it'll email me, but for now, I changed paypal address to sandbox, and it's not working here it is.

<?php
// 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 ('www.sandbox.paypal.com', 80, $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'];
mysql_connect("localhost", "#####", "####");
mysql_select_db("hasbadse_hbservice");
mail("businessman332211@hotmail.com", "successful", "Message goes here");



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);
}

?>

I don't get it.  There is probably something simple, it is however successfully doing the full payment process, I have just to get it to test the ipn for me.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#10 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 04 October 2006 - 03:18 PM

I am having problems, can someone help me with this again.

I have had a few problems, but reduced them to one, impassable one.

At first I was having overall troubles, but after a lot of work, and a mini tutorial, I set up a developer account(a paypal sandbox test account setup), and created 2 email addressses on there for testing the ipn.  I tested it, and after some work I was able to create a developer account(overall account setup), and then 2 test emails for it.  One was testrecieve, and one was testpay.  The test recieve is recieving the payment, and the testpay, is sending the payment.  I tested it, and the payments were going greate, but it's simply ignoring my call to the ipn, and it's not sending me the email like it's suppose to, so it's totally ignoring it.
The problem now is that I can't get it to just read the ipn. I just want it(for now), to email me, so I know it's working.  Here is my coding for the form, and the ipn set. 

<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="business" value="testrecieve@paypaldev.com" />
<input type="hidden" name="item_name" value="Payment Option 1" />
<input type="hidden" name="item_number" value="1" />
<input type="hidden" name="amount" value="0.01" />
<input type="hidden" name="no_shipping" value="1" />
<input type="hidden" name="no_note" value="1" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="bn" value="PP-BuyNowBF" />
<input type="hidden" name="return" value="http://www.hasbadservice.com/thankyou.php" />
<input type="hidden" name="cancel_return" value="http://www.hasbadservioce.com/cancelpayment.php" />
<input type="hidden" name="notify_url" value="http://www.hasbadservice.com/ipn.com" />
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but02.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!" />
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>

ipn page.
<?php
// 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 ('www.sandbox.paypal.com', 80, $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'];
mysql_connect("localhost", "#####", "#####");
mysql_select_db("hasbadse_hbservice");
mail("businessman332211@hotmail.com", "successful", "Message goes here");



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);
}

?>

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users