cancel
Showing results for 
Search instead for 
Did you mean: 

Negative testing not working

Options
hiboudev
Contributor
Posted on

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.

 

4 REPLIES 4

Negative testing not working

Options
FormaServe
Contributor

Got the same issue here 😞

 

Did you manage to resolve it @hiboudev ?

Negative testing not working

Options
hiboudev
Contributor

No I gave up.

Negative testing not working

Options
FormaServe
Contributor

@hiboudev thanks anyway.

Negative testing not working

Options
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.

Haven't Found your Answer?

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