Last active
November 25, 2022 14:01
-
-
Save InpsydeNiklas/ceb05a4d1213135459e2b217789a483b to your computer and use it in GitHub Desktop.
Negative testing PayPal Payments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('ppcp_request_args', function ($args, $url){ | |
if (strpos($url,'capture') !== false) { | |
$args['headers']['PayPal-Mock-Response'] = '{"mock_application_codes": "INSTRUMENT_DECLINED"}'; | |
} | |
return $args; | |
}, 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment