paypal/rest-api-sdk-php — pull request #70 by brendo (2014-05-04 07:06:48+00:00)
Title: Add validation of Return/Cancel URL's (with test cases)

I recently was integrating with PayPal and during development I set my return/cancel URL's to omit the hostname (eg. `paypal.com` instead of `https://paypal.com`). This caused my request to fail with a 400 response and set me down a rabbit hole for a little bit until I realised what I'd done.

This pull request adds some basic validation to the `setReturnUrl` and `setCancelUrl` methods to check the argument is a URL (or at least looks like one). An `\InvalidArgumentException` is thrown otherwise.

I've also added the corresponding Unit Test as well as the `RedirectUrls` class is currently not covered :)