forked from LiveCarta/PayPal-PHP-SDK
Fixes to Json conversion logic for empty objects
- If the object is empty, an empty json object is generated on conversion - Fixes #223
This commit is contained in:
@@ -162,6 +162,12 @@ class PayPalModel
|
||||
$ret[$k] = $v;
|
||||
}
|
||||
}
|
||||
// If the array is empty, which means an empty object,
|
||||
// we need to convert array to StdClass object to properly
|
||||
// represent JSON String
|
||||
if (sizeof($ret) <= 0) {
|
||||
$ret = new PayPalModel();
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user