forked from LiveCarta/PayPal-PHP-SDK
Updates to Sample Code
- Updated UI Presentation on samples - Fixed Bugs
This commit is contained in:
@@ -247,7 +247,7 @@ class Payment extends ResourceModel
|
||||
* A payment can have more than one transaction, with each transaction establishing a contract between the payer and a payee
|
||||
*
|
||||
*
|
||||
* @param \PayPal\Api\Transaction $transactions
|
||||
* @param \PayPal\Api\Transaction[] $transactions
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
|
||||
@@ -14,14 +14,18 @@ class JsonValidator
|
||||
* Helper method for validating if string provided is a valid json.
|
||||
*
|
||||
* @param string $string String representation of Json object
|
||||
* @param bool $silent Flag to not throw \InvalidArgumentException
|
||||
* @return bool
|
||||
*/
|
||||
public static function validate($string)
|
||||
public static function validate($string, $silent = false)
|
||||
{
|
||||
json_decode($string);
|
||||
if (json_last_error() != JSON_ERROR_NONE) {
|
||||
//Throw an Exception for string or array
|
||||
throw new \InvalidArgumentException("Invalid JSON String");
|
||||
if ($silent == false) {
|
||||
//Throw an Exception for string or array
|
||||
throw new \InvalidArgumentException("Invalid JSON String");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ class ModelAccessorValidator
|
||||
if (!method_exists($class, $methodName)) {
|
||||
//Delegate the error based on the choice
|
||||
$className = is_object($class) ? get_class($class) : (string)$class;
|
||||
$errorMessage = "Missing Accessor: $className:$methodName. Please let us know by creating an issue at https://github.com/paypal/rest-api-sdk-php/issues";
|
||||
$errorMessage = "Missing Accessor: $className:$methodName. Please let us know by creating an issue at https://github.com/paypal/PayPal-PHP-SDK/issues";
|
||||
PPLoggingManager::getInstance(__CLASS__)->warning($errorMessage);
|
||||
if ($mode == 'strict') {
|
||||
trigger_error($errorMessage, E_USER_NOTICE);
|
||||
@@ -41,4 +41,4 @@ class ModelAccessorValidator
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user