mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-09-22 00:00:31 -04:00
This commit adds `Customer#create_subscription`, which allows a subscription to be created on a customer without first fetching the customer record. Previously: ``` customer = Stripe::Customer.retrieve('cus_abc123def') # GET request customer.subscriptions.create(plan: 'cool-plan-1') # POST request ``` **No alteration has been made to the above method; the preceding implementation still functions as it did previously.** With `#create_subscription`: ``` customer = Stripe::Customer.new('cus_abc123def') # No request customer.create_subscription(plan: 'cool-plan-1') # POST request ``` This method removes the initial `GET` request and instead issues a `POST` directly to create the subscription.