Negative testing not working
hiboudev
Contributor
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on
Sep-16-2021
08:06 AM
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
FormaServe
Contributor
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar-30-2022
02:12 AM
hiboudev
Contributor
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar-30-2022
05:21 AM
FormaServe
Contributor
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar-30-2022
06:30 AM
dominiotestxyz
New Community Member
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sep-03-2022
07:59 AM
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.
Related Content
- Advanced Checkout Error Trigger is not triggering an error but still going through onApprove in Sandbox Environment
- PayPal Standard Checkout Integration in PHP (500 error) in Sandbox Environment
- IPN SHOWS NO HTTP RESPONSE - LISTENER WORKS WITH LOCAL FORM POST in Sandbox Environment
- REST API issues in sandbox in REST APIs
- Why am I not seeing HTTP responses for IPN? in Sandbox Environment