app/services/pro_membership_manager.rb
# Charge the user, then add the resulting PRO duration to a different user to
# whom the PRO is being gifted.
Charge the user, then add the resulting PRO duration to a different user to
whom the PRO is being gifted.
Charge the user then add the resulting PRO duration to a different user to whom the PRO is being gifted .
def gift!(plan, token, gift_to, gift_message)
    if plan.recurring?
      raise "Recurring subscriptions cannot be gifted"
    end
    charge_user! token, (plan.amount * 100).to_i
    give_pro! gift_to, plan.duration.months
    ProMailer.delay.gift_email(gift_to, @user, gift_message)
  end
def gift! ( plan , token , gift_to , gift_message ) if plan . recurring? raise "Recurring subscriptions cannot be gifted" end charge_user! token , ( plan . amount * 100 ) . to_i give_pro! gift_to , plan . duration . months ProMailer . delay . gift_email ( gift_to , @user , gift_message ) end
Charge the user, then add the resulting PRO duration to a different user to
whom the PRO is being gifted.
Charge the user then add the resulting PRO duration to a different user to whom the PRO is being gifted .
plan
<not_specific>
token
<not_specific>
gift_to
<not_specific>
gift_message
<not_specific>