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

670 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
+1 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.

670 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
+1 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 :)

670 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
+1 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.

by
by
by
by
by
by