23 posts
  • Has been part of the Envato Community for over 1 year
  • Has sold $1,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
yourkishore says

I am using paypal sandbox mode for testing payments. and this hook woocommerce_payment_complete after payement returning to website. It doesnot fire the function.

add_action( 'woocommerce_payment_complete', 'payment_complete_func' );

function payment_complete_func(){

    file_get_contents("http://localhost/wordpress/test.php?i
d=paymentagain2");
}
23 posts
  • Has been part of the Envato Community for over 1 year
  • Has sold $1,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
yourkishore says

please help

5492 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 1+ members
  • Located in Australia
  • Has sold $1,000+ on Envato Market
+4 more
Australia says

winner of this weeks div buster title thread.

can you not use curl

736 posts
  • Has been part of the Envato Community for over 2 years
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has been a beta tester for an Envato feature
+2 more
Typps says

@yourkishore, Couldn’t help but notice your URL. Your on localhost, hence Paypal IPN ( instant payment notification) will not work for you.

You are required to provide a URL that can be accessed from the outside (outside your localhost), one that Paypal can reach ( from their servers). How are you expecting Paypal to send you a notification with just a localhost address ? Hence why you end up not getting a notification at all :P

23 posts
  • Has been part of the Envato Community for over 1 year
  • Has sold $1,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
yourkishore says

i am using file_get_contnets just for testing the function, the actual code is different. to ust test wheather its working or not.

23 posts
  • Has been part of the Envato Community for over 1 year
  • Has sold $1,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
yourkishore says

@yourkishore, Couldn’t help but notice your URL. Your on localhost, hence Paypal IPN ( instant payment notification) will not work for you. You are required to provide a URL that can be accessed from the outside (outside your localhost), one that Paypal can reach ( from their servers). How are you expecting Paypal to send you a notification with just a localhost address ? Hence why you end up not getting a notification at all :P

Thanks for the reply, the local host file is nothing to do with paypal. I just wantted to fire that function and check its working or not the local host link is connected to my local database.

736 posts
  • Has been part of the Envato Community for over 2 years
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has been a beta tester for an Envato feature
+2 more
Typps says

OK, but do verify that in your actual code, the notify URL provided is not a localhost address. If you have provided a public URL, then I’m out of ideas :)

736 posts
  • Has been part of the Envato Community for over 2 years
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has been a beta tester for an Envato feature
+2 more
Typps says

By the way, if it is not clear, at some point somewhere you’ve specified the notify URL, this is the URL that Paypal will hit to send you a notification.

For the record, my response has got nothing to do with the URL you’ve used in file_get_contents, but it did help to see that your testing in localhost ( the root of your problem).

23 posts
  • Has been part of the Envato Community for over 1 year
  • Has sold $1,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
yourkishore says

By the way, if it is not clear, at some point somewhere you’ve specified the notify URL, this is the URL that Paypal will hit to send you a notification. For the record, my response has got nothing to do with the URL you’ve used in file_get_contents, but it did help to see that your testing in localhost ( the root of your problem).

Yeah, thats what i think. The localhost may be the problem. I will test it in a live wordpress environment and will let you know the result :) Thansk for the reply.

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by