diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e8aee24..c86d1ef1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## Next Release + +- Sends card details in the request body instead of the URL query string when `referralCustomer->addCreditCard` creates a Stripe token + ## v8.8.3 (2026-08-26) - Preserves caller-provided plain PHP objects in request params so `(object) []` is sent as an empty JSON object (`{}`) instead of being stringified diff --git a/lib/EasyPost/Service/ReferralCustomerService.php b/lib/EasyPost/Service/ReferralCustomerService.php index 9ff66f32..a65d8a46 100644 --- a/lib/EasyPost/Service/ReferralCustomerService.php +++ b/lib/EasyPost/Service/ReferralCustomerService.php @@ -220,7 +220,9 @@ private function createStripeToken( $guzzleClient = new Client(); - $requestOptions['query'] = $creditCardDetails; + // Card details must travel in the form-encoded request body, never in the URL, + // so they cannot end up in access logs, proxy logs, or Referer headers. + $requestOptions['form_params'] = $creditCardDetails; $requestOptions['headers'] = $headers; $requestOptions['http_errors'] = false;