-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TrimStrings middleware breaks signature verification #120
Comments
Can you give a specific example of how to do this? |
It happened to me when having a whitespace in a passthrough parameter, but I think if you have whitespace in your name, it should happen too |
@mpociot I'll take a look tomorrow 👍 |
This all works for me: Auth::user()->charge(12.55, 'Test Charge', ['passthrough' => ['test' => ' Test with space ']]); I tried also to set the name on the card with a leading and trailing space. Funny thing is that Paddle marked the name as invalid when I have a leading space but it doesn't when I have a trailing space. In any case, the trailing space also didn't cause the signature to be broken. I'll need more specific steps to reproduce this. |
Okay, then this only happens with a passthrough that contains a leading space:
|
That's not possible. You should get an exception for that. It's not possible to do a charge like that. The passthrough should always be an array. Are you overwriting this somehow? cashier-paddle/src/Concerns/PerformsCharges.php Lines 67 to 69 in 31c5c18
|
Paddle verifies the signature based on the input as they have it on their end. If Cashier receives strings that have been trimmed the signature verification fails. The fields need to stay as they are. laravel#120 laravel#152 laravel#173
Description:
When a user enters any data with a leading/trailing whitespace, the signature verification is broken, because the
TrimStrings
middleware removed the whitespace, while the provided signature expects the whitespace.Steps To Reproduce:
Perform a Paddle request with a leading/trailing whitespace.
The text was updated successfully, but these errors were encountered: