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

additional properties are not allowed: automatic_payment_methods #926

Closed
Sudakatux opened this issue Jul 19, 2024 · 10 comments
Closed

additional properties are not allowed: automatic_payment_methods #926

Sudakatux opened this issue Jul 19, 2024 · 10 comments

Comments

@Sudakatux
Copy link

Im running stipe-mock with latests:
apiVersion: '2024-06-20'

Im making a direct post with the following form data:

amount=12000&currency=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 ?

@xavdid-stripe
Copy link
Member

What endpoint are you sending this request to?

@macbookandrew
Copy link

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
  ],
]);

Docs: https://docs.stripe.com/api/payment_intents/create?lang=php#create_payment_intent-automatic_payment_methods-allow_redirects

@macbookandrew
Copy link

Sounds like maybe it just needs to be rebuilt against a newer OpenAPI spec?

@macbookandrew
Copy link

macbookandrew commented Aug 1, 2024

Some more information:

  • Using stripe-mock installed via homebrew on macOS, I do not experience this error; everything works fine
  • Using stripe-mock installed via cloning the repo and running go run main.go, I do not experience this error; everything works fine
  • Using stripe-mock:latest installed via Docker on macOS (and Ubuntu in GitLab CI/CD pipelines), I do experience this error.

Steps to reproduce:

  1. Install and run stripe-mock using Docker
  2. Create a payment intent using 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:[email protected] 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

@macbookandrew
Copy link

@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?

@macbookandrew
Copy link

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?

@xavdid-stripe
Copy link
Member

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: #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!

@xavdid-stripe
Copy link
Member

I've fixed the upstream fixtures issue internally and the fix should make its way through Stripe CI into the public OpenAPI repo. #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!

@macbookandrew
Copy link

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

@xavdid-stripe
Copy link
Member

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants