Paypal returns captcha as a response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I'm using this code to verify a payment and all the time it worked perfectly:
namespace Donate\Vendor;
if ( ! defined('STARTED')) exit;
use \Donate\Vendor\Settings;
use \Donate\Vendor\DB;
class Paypal
{
private static $paypalSandboxUrl = 'https://www.sandbox.paypal.com/cgi-bin/webscr';
private static $paypalUrl = 'https://www.paypal.com/cgi-bin/webscr';
public static function verify()
{
if (Settings::get('app.paypal.test'))
{
$url = self::$paypalSandboxUrl;
}
else
{
$url = self::$paypalUrl;
}
$encodedData = 'cmd=_notify-validate';
if ( ! empty($_POST))
{
$encodedData .= '&' . file_get_contents('php://input');
}
else
{
throw new Exception("No POST data found.");
}
DB::query("UPDATE paypal SET status = ? WHERE item_number = ?", [$encoded_data,$_POST['item_number']]);
$response = @file_get_contents($url . '/' . $encodedData);
$response = trim($response);
_log($response, 'user');
return ($response == 'VERIFIED') ? true : false;
}
}
and now it stopped working for no reason.
There where is response line the paypal returns whole html code of captcha, but works without any issue same code with sandbox. Any idea how to fix? Any smartman could to suggest something? 🙂

Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- AUTH_FLOW_REQUIRED in SDKs
- Getting 400 Bad Request error when rendering PayPal Button using JS SDK in SDKs
- PayPal-Mock-Response header not working -- got 403 error instead. Help! in Sandbox Environment
- Receiving APPROVED Webhooks for Order, but capture leads to 404 or ORDER_NOT_APPROVED in REST APIs
- Is there a list of all the types of link that we might get back from the Order endpoints? in REST APIs