Closed Sudakatux closed 3 months ago
What endpoint are you sending this request to?
I’m seeing this too, when creating a payment intent with this data:
$stripe = new \Stripe\StripeClient('sk_test_Tm42SIKZinsVvyBCHb01UHcI');
$stripe->paymentIntents->create([
'amount' => 2000,
'currency' => 'usd',
'automatic_payment_methods' => [
'enabled' => true,
'allow_redirects' => 'never', // or 'always' <------------- this is the problem line
],
]);
Sounds like maybe it just needs to be rebuilt against a newer OpenAPI spec?
Some more information:
go run main.go
, I do not experience this error; everything works fineSteps to reproduce:
automatic_payment_methods.allow_redirects: true
docker run -it -p 12111:12111 stripemock/stripe-mock:latest
Unable to find image 'stripemock/stripe-mock:latest' locally
latest: Pulling from stripemock/stripe-mock
5843afab3874: Pull complete
08aba54b252b: Pull complete
91920f087607: Pull complete
Digest: sha256:a77358595cb30f2c7d48b42e8971f46456486e2cc04f6dc2465ca9057b48dd12
Status: Downloaded newer image for stripemock/stripe-mock:latest
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
stripe-mock 0.110.0
Routing to 234 path(s) and 384 endpoint(s) with 384 validator(s)
Listening for HTTP at address: [::]:12111
Listening for HTTPS at address: [::]:12112
Request: POST /v1/customers
Request data = map[email:schowalter.seamus@example.org name:Jess Nikolaus]
Response: elapsed=9.888ms status=200
Request: POST /v1/payment_intents
Request data = map[amount:1000 automatic_payment_methods:map[allow_redirects:never enabled:true] currency:usd setup_future_usage:off_session statement_descriptor:A really long string t]
Request validation error: validator 0xc000836480 failed: additional properties are not allowed: automatic_payment_methods
Response: elapsed=2.275ms status=400
@xavdid-stripe any ideas on this? Why would cloning the repo and using homebrew work fine, while the docker image apparently has old validation rules?
I wonder if this is due to #432… the main dockerfile includes a build step, while the goreleaser dockerfile doesn’t… @richardm-stripe since you added #432, do you have any ideas on that?
I've been looking into this today and I think it all comes back to our OpenAPI updater pipeline getting stuck. This PR should be green and atuo-merged. Instead it's had failing tests and been open for 2 weeks: https://github.com/stripe/stripe-mock/pull/941
I'm not sure why the two installation methods include different versions of the OpenAPI spec, but that would explain the inconsistencies.
I know why the tests are failing on that PR so I'm trying to figure out the right things to tweak to clear up the fixture generation. Will hopefully have that ready soon!
I've fixed the upstream fixtures issue internally and the fix should make its way through Stripe CI into the public OpenAPI repo. https://github.com/stripe/stripe-mock/pull/941 should get auto-merged and everything should iron out. Definitely let us know if that's not the case though and sorry for the hassle!
Thanks…does somebody need to tag a new release though? I still see 0.186.0 from May 16 as the latest on Docker Hub and GitHub
Looks like that's all set now! Docker and GH releases have been updated.
I'll go ahead and close out, but let us know if there are still OpenAPI staleness issues!
Im running stipe-mock with latests: apiVersion: '2024-06-20'
Im making a direct post with the following form data:
amount=12000¤cy=usd&automatic_payment_methods%5Benabled%5D=true&payment_method=pm_N3nSweYlJXcFLkB&off_session=true&confirm=true&customer=cus_N3nSwrsmxhPglKR
but the container is failing with "validator 0xc000b3f0e0 failed: additional properties are not allowed: automatic_payment_methods" is automatic_payment_methods[enabled]=true not supported by stripe-mock ?