stripe / stripe-ruby

Ruby library for the Stripe API.
https://stripe.com
MIT License
1.96k stars 548 forks source link

Wiki: Version 13 of migration guide contains error #1464

Closed vietqhoang closed 1 month ago

vietqhoang commented 1 month ago

Describe the bug

Page and section in question: https://github.com/stripe/stripe-ruby/wiki/Migration-guide-for-v13#how-to-upgrade

Item 1 of the section shares an example of initializing the Stripe::StripeClient. The example is wrong in that it should be initialize a new instance instead of a class method.

To Reproduce

  1. Read the Version 13 migration guide located https://github.com/stripe/stripe-ruby/wiki/Migration-guide-for-v13
  2. Under the How to upgrade section, item 1, and section After, try using the example in a Ruby console.
  3. Experience the exception raised.

Expected behavior

The example,

client = Stripe::StripeClient("sk_test_123")

should be the following

client = Stripe::StripeClient.new("sk_test_123")

Code snippets

No response

OS

macOS

Language version

Ruby 3.3.5

Library version

stripe-ruby v13.0.0

API version

2024-09-30.acacia

Additional context

Not an issue with the library, but with the documentation. Nothing is breaking.

Rest of the examples on the migration guide correctly represents the instantiation of the client.

helenye-stripe commented 1 month ago

Hi @vietqhoang! This should be fixed now. Thanks for pointing this out.