rjg
rjg

Reputation: 105

Paypal API issues

I am using Paypal and got a few questions actually.

  1. My IPN script is not getting called. I've tried it with the IPN simulator, and just put a simple error log that writes to a file, and it doesn't write when the simulator runs, it gives a success message although when I visit it manually, it does successfully log.

Here is the IPN script:

ini_set('error_reporting', E_ALL);
error_reporting(E_ALL);
ini_set('log_errors',TRUE);
ini_set('html_errors',FALSE);
ini_set('error_log', dirname(__FILE__).'/ipn_errors.log');          
error_log('CALLED');

I've set the form variables as so:

<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="*SELLER EMAIL*">
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="item_name" value="Mr Strong T-Shirt">
<input type="hidden" name="item_number" value="XQk0tZm0OavuvAP0gmxRdntLUpsmwZfiE%2FzjunlSAeN4F73sgzXjyVaclgY6nfvoKRyqrZICW3z5beEcs693lA%3D%3D">
<input type="hidden" name="amount" value="3.00">
<input type="hidden" name="return" value="http://*WEBSITE URL*/success/">
<input type="hidden" name="notify_url" value="http://*WEBSITE URL*/buy/ipn">
<input type="submit" value="Submit">

WEBSITE URL is NOT local, its hosted online and accessible.

  1. The 'seller' will vary, as it's a selling platform. Can I set a return URL without having to enable it on each seller account?

Any idea? Help is always much appreciated.

Upvotes: 0

Views: 85

Answers (3)

rjg
rjg

Reputation: 105

Problem sorted! There was a login validation which kept redirecting it to login, stripped this out and it worked fine. Few.

Upvotes: 0

Drixson Ose&#241;a
Drixson Ose&#241;a

Reputation: 3641

I had the same problem with IPN before:

So here are the following things that I did:

Check if paypal IPN sends notification to my notify_url using IPN Simulator

a.)Your page should allow paypal IPN notification

b.) Your notify_url link is correct

If all are met above and IPN is still not working then there should be problem a problem in your configuration check your paypal configuration for validating IPN

Not this using port:80

$fp = fsockopen('ssl://'. $url_parsed['host'], '80', $err_num, $err_str, 30);

But this using port:443

$fp = fsockopen('ssl://'. $url_parsed['host'], '443', $err_num, $err_str, 30);

And that should fix all for paypal's IPN notification.

Please take note also that there's a problem with IPN notification not working in sandbox see my reference before here (a bit old but in the same year)

Hope it all helps you

Upvotes: 0

PayPal_Federica
PayPal_Federica

Reputation: 926

Yes you can set up "return" without having to enable it on each seller's account.

When the buyer will complete the purchase, he will need to click on the link "Return to Merchant website" as the redirect won't be automatic.

If merchants wants to enable AutoReturn (which works only for buyers that pay with Login), they will need to access to Profile in their PayPal account in order to set it up.

Ref. AutoReturn

Upvotes: 1

Related Questions