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.
- PAYER_ACTION_REQUIRED returned for Capture intent when calling v2 checkout orders in Sandbox Environment
- How to retrieve merchant integration status through the API? in REST APIs
- How to tell if a customer subscribed as a guest or a paypal member in REST APIs
- JavaScript SDK unreliable redirect using "Sofortüberweisung" Klarna payment provider in SDKs
- Client Authentication Failed in REST APIs