Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter francescopanco

    (@francescopanco)

    I know it doesn’t make sense. But this issue is very similar to this https://stackoverflow.com/questions/40859629/wordpress-ajax-returns-json-with-php-opening-tag even though I don’t have the PHP tag but just an array coming from my request body.

    I did all that and it looks all fine, the API call to the endpoint is all fine, I got the right response, it is just after wp_send_json that the problem comes. I don’t know what to do since the solution for the mentioned link doesn’t work for me. I need to change my local env to see if it is the root cause of that.

    Thread Starter francescopanco

    (@francescopanco)

    thanks for that. It is indeed a portion of the remote API’s response body. Now the point is to understand why and then fix it and I have no clue.

    As I said before error_log($api_response) is {message: success} so the correct JSON response. It’s just after wp_send_json that the portion of remote API’s response is appended.

    I am aware that with application/json I need to pass the action inside of a json like that {action: ‘send_api_request’, data: ‘dummy@email.test’}

    I did everything as you said but it’s not working! always status 400 and response 0 so I turned to

    application/x-www-form-urlencoded

    I got the same problem. Basically, I switch from PayPal Standard to Paypal Payments. Everything is pretty ok but receiving the IPN warning message every day on my email. I deleted the Paypal Standard plugin and I disabled IPN on my Paypal account but I keep receiving the same message every day:

    ——————————————-

    Hello, xxx
    
    Please check your server that handles PayPal Instant Payment Notifications (IPN). IPNs sent to the following URL(s) are failing:
    
    https://mysite.com/?wc-api=WC_Gateway_Paypal
    
    If you do not recognize this URL, you may be using a service provider that is using IPN on your behalf. Please contact your service provider with the above information. If this problem continues, IPNs may be disabled for your account. 
    
    Thank you for your prompt attention to this issue.
    

    ——————————————-

    I don’t know what else to do, can someone help me, please?

Viewing 3 replies - 1 through 3 (of 3 total)