id ) ) { throw new RuntimeException( __( 'No id for product given', 'woocommerce-paypal-payments' ) ); } if ( ! isset( $data->name ) ) { throw new RuntimeException( __( 'No name for product given', 'woocommerce-paypal-payments' ) ); } return new Product( $data->id, $data->name, $data->description ?? '' ); } }