Skip to content
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

Incorrect JSON Format for PHP Serialization #377

Open
ryan-timothy-albert opened this issue Dec 20, 2023 · 0 comments
Open

Incorrect JSON Format for PHP Serialization #377

ryan-timothy-albert opened this issue Dec 20, 2023 · 0 comments
Labels

Comments

@ryan-timothy-albert
Copy link
Contributor

The serialization of the paymentMethod property in the NewPayment class is not producing the desired JSON format. The generated JSON encompasses the payment method object in quotes, treating it as a string. This is being caused by the type in NewPayment where it defines the NewPayment property in itself. It annotates the object as "mixed" but it should be "TheLogicStudio\ExactPayments\Models\Operations\PaymentMethod".

The effect of the "mis-serialization" is the exact server returning a 400 Bad request & not being able to process the payment.

Expected JSON request:
{
...
"paymentMethod": {"token": "$TOKEN"}
}
Actual Behavior
{
"paymentMethod": "{"token":"$TOKEN"}"
}

A simple change of the annotation in Models\Shared\NewPayment.php fixes the issue. I would've made a pull request but as this repo is handled by speakeasy I wasn't sure of the procedure 🙌

https://github.com/speakeasy-sdks/exactpayments-php/issues

@ryan-timothy-albert ryan-timothy-albert changed the title PHP Serialization Incorrect JSON Format for PHP Serialization Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant