diff --git a/src/PaymentDetails.php b/src/PaymentDetails.php index 61a07a8..988b3d6 100644 --- a/src/PaymentDetails.php +++ b/src/PaymentDetails.php @@ -29,7 +29,9 @@ public static function from_json( $method, $json ) { $details = new PaymentDetails(); - foreach ( $json as $key => $value ) { + $data = (array) $json; + + foreach ( $data as $key => $value ) { $details->{$key} = $value; }