Negative testing not working

hiboudev
Contributor
Contributor

Hello,

 

I'm trying to enable Negative Testing but I can't simulate any error, order capture is still in status COMPLETED.

 

I'm using the sandbox buyer and business accounts and this last one has Negative Testing enable in dashboard.

 

My PHP code to capture order :

 

 

class PaypalOrder
{
    public static function captureOrder($orderId, $debug = false)
    {
        $request = new OrdersCaptureRequest($orderId);
        $request->headers["PayPal-Mock-Response"] = json_decode("{'mock_application_codes' : 'AUTHORIZATION_DENIED'}");

        $client = PayPalClient::client();
        $response = $client->execute($request);

        return $response;
    }
}

 

 

The "mock_application_codes" part seems useless, PayPal returns payment status "COMPLETED".

 

What could be wrong?

 

Thanks.

 

Login to Me Too
4 REPLIES 4

FormaServe
Contributor
Contributor

Got the same issue here 😞

 

Did you manage to resolve it @hiboudev ?

Login to Me Too

hiboudev
Contributor
Contributor

No I gave up.

Login to Me Too

FormaServe
Contributor
Contributor

@hiboudev thanks anyway.

Login to Me Too

dominiotestxyz
New Community Member

Same here! All day struggling with this. I set the account bussiness to get Negative test, but i still get completed.

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.