PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.6.5
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.6.5
1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 1.3.19 trunk All 48 releases
← All changes | app/Modules/PaymentMethods/PayPalGateway/API/API.php +3 -1 1.6.1 → 1.6.5 View file →
@@ -128,9 +128,11 @@
128 128
129 129 $response = wp_remote_post($paypal_api_url, [
130 130 'headers' => $headers,
131 131 'method' => $method,
132 - 'body' => json_encode($args)
132 + // An empty array encodes to a literal [], which PayPal rejects
133 + // with MALFORMED_REQUEST_JSON — it requires a {} body.
134 + 'body' => json_encode($args ?: new \stdClass())
133 135 ]);
134 136
135 137 if (is_wp_error($response)) {
136 138 return new \WP_Error('general_error', $response->get_error_message(), $response);