Enabled Payment Experience

- Updated Api to enabled Payment Experience
- Updated Tests and Samples
- Added Json Validator
- Ability for PPModel to return array of self objects
This commit is contained in:
japatel
2014-10-13 12:00:31 -05:00
parent 792cdc2b93
commit 0cb302326a
55 changed files with 1936 additions and 654 deletions

View File

@@ -0,0 +1,28 @@
<?php
namespace PayPal\Validation;
/**
* Class JsonValidator
*
* @package PayPal\Validation
*/
class JsonValidator
{
/**
* Helper method for validating if string provided is a valid json.
*
* @param string $string String representation of Json object
* @return bool
*/
public static function validate($string)
{
json_decode($string);
if (json_last_error() != JSON_ERROR_NONE) {
//Throw an Exception for string or array
throw new \InvalidArgumentException("Invalid JSON String");
}
return true;
}
}