lib/pay/billable.rb
def create_subscription(subscription, processor, name, plan, options = {})
      options[:quantity] ||= 1

      options.merge!(
        name: name || "default",
        processor: processor,
        processor_id: subscription.id,
        processor_plan: plan,
        trial_ends_at: send("#{processor}_trial_end_date", subscription),
        ends_at: nil
      )
      subscriptions.create!(options)
    end
# Used for creating a Pay::Subscription in the database
Used for creating a Pay::Subscription in the database
Used for creating a Pay :: Subscription in the database
def create_subscription(subscription, processor, name, plan, options = {})
      options[:quantity] ||= 1
      options.merge!(
        name: name || "default",
        processor: processor,
        processor_id: subscription.id,
        processor_plan: plan,
        trial_ends_at: send("#{processor}_trial_end_date", subscription),
        ends_at: nil
      )
      subscriptions.create!(options)
    end
def create_subscription ( subscription , processor , name , plan , options = { } ) options [ :quantity ] ||= 1 options . merge! ( name : name || "default" , processor : processor , processor_id : subscription . id , processor_plan : plan , trial_ends_at : send ( "#{processor}_trial_end_date" , subscription ) , ends_at : nil ) subscriptions . create! ( options ) end
Used for creating a Pay::Subscription in the database
Used for creating a Pay :: Subscription in the database
subscription
processor
name
plan
options