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

Stripe.PaymentIntent.create is missing a type option #844

Closed
2 tasks done
michelboaventura opened this issue Jul 5, 2024 · 6 comments
Closed
2 tasks done

Stripe.PaymentIntent.create is missing a type option #844

michelboaventura opened this issue Jul 5, 2024 · 6 comments

Comments

@michelboaventura
Copy link

Existing Issue or Pull Request Verification

  • Confirmed, no existing Issues or Pull Requests found related to my submission.

Package Version

3.2.0

Are you using the latest version?

  • Yes, I verified the issue is still present in the latest version.

Steps to Reproduce

Stripe's PaymentIntent allows for a payment method option for us bank accounts called verification_method as can be seen here, but on the lib's spec there's no such option.

Expected Result

No dialyzer error when using the option

Actual Result

The function call will not succeed.

Stripe.PaymentIntent.create(
  _stripe_params :: %{
    :amount => _,
    :application_fee_amount => _,
    :currency => _,
    :metadata => %{<<_::136>> => _},
    :payment_method_options => %{:us_bank_account => %{:verification_method => <<_::72>>}},
    :payment_method_types => [<<_::32, _::size(88)>>, ...],
    :setup_future_usage => :on_session
  },
  [{:api_key, _} | {:connect_account, _}, ...]
)

breaks the contract
(
  params :: %{
    :amount => integer(),
    :application_fee_amount => integer(),
    :automatic_payment_methods => automatic_payment_methods(),
    :capture_method => :automatic | :automatic_async | :manual,
    :confirm => boolean(),
    :confirmation_method => :automatic | :manual,
    :currency => binary(),
    :customer => binary(),
    :description => binary(),
    :error_on_requires_action => boolean(),
    :expand => [binary()],
    :mandate => binary(),
    :mandate_data => mandate_data() | binary(),
    :metadata => %{binary() => binary()},
    :off_session => boolean() | :one_off | :recurring,
    :on_behalf_of => binary(),
    :payment_method => binary(),
    :payment_method_configuration => binary(),
    :payment_method_data => payment_method_data(),
    :payment_method_options => payment_method_options(),
    :payment_method_types => [binary()],
    :radar_options => radar_options(),
    :receipt_email => binary(),
    :return_url => binary(),
    :setup_future_usage => :off_session | :on_session,
    :shipping => shipping(),
    :statement_descriptor => binary(),
    :statement_descriptor_suffix => binary(),
    :transfer_data => transfer_data(),
    :transfer_group => binary(),
    :use_stripe_sdk => boolean()
  },
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

________________________________________________________________________________
done (warnings were emitted)
Halting VM with exit status 2
@michelboaventura
Copy link
Author

I noticed that if I run mix stripe.generate on the lib's folder the new generated code does contain this, so maybe it's just a matter of releasing a new version?

@yordis
Copy link
Member

yordis commented Jul 5, 2024

Is this related to #843

@michelboaventura
Copy link
Author

I don't think so. Mine seems related to a difference between open api spec versions.

@michelboaventura
Copy link
Author

Do you folks think it's possible to cut a new release using the current openapi spec from stripe?

Copy link

This issue has been automatically marked as "stale:discard". If this issue still relevant, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment.

Copy link

github-actions bot commented Sep 8, 2024

Closing this issue after a prolonged period of inactivity. If this issue is still relevant, feel free to re-open the issue. Thank you!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants