23 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 1-2 years
  • Sold between 1 000 and 5 000 dollars
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
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 1-2 years
  • Sold between 1 000 and 5 000 dollars
yourkishore says

please help

5456 posts
  • Australia
  • Bought between 100 and 499 items
  • Envato Studio (Microlancer) Beta Tester
  • Exclusive Author
  • Has been a member for 4-5 years
  • Interviewed on the Envato Notes blog
  • Referred between 1 and 9 users
  • Sold between 1 000 and 5 000 dollars
Australia says

winner of this weeks div buster title thread.

can you not use curl

635 posts
  • Envato Studio (Microlancer) Beta Tester
  • Exclusive Author
  • Has been a member for 2-3 years
  • Referred between 1 and 9 users
  • Sold between 10 000 and 50 000 dollars
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
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 1-2 years
  • Sold between 1 000 and 5 000 dollars
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
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 1-2 years
  • Sold between 1 000 and 5 000 dollars
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.

635 posts
  • Envato Studio (Microlancer) Beta Tester
  • Exclusive Author
  • Has been a member for 2-3 years
  • Referred between 1 and 9 users
  • Sold between 10 000 and 50 000 dollars
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 :)

635 posts
  • Envato Studio (Microlancer) Beta Tester
  • Exclusive Author
  • Has been a member for 2-3 years
  • Referred between 1 and 9 users
  • Sold between 10 000 and 50 000 dollars
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
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 1-2 years
  • Sold between 1 000 and 5 000 dollars
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