Payola , , Stripe. , subscription_controller.rb: 28, , Payola ( Payola , before_filter find_plan_coupon_and_quantity, change_plan. find_plan_coupon_and_quantity @coupon = cookies[:cc] || params[:cc] || params[:coupon_code] || params[:coupon]). , , Payola::ChangeSubscriptionPlan.call(@subscription, @plan), change_subscription_plan.rb: 3 retrieve_subscription_for_customer . , .
def self.retrieve_subscription_for_customer(subscription, secret_key)
customer = Stripe::Customer.retrieve(subscription.stripe_customer_id, secret_key)
customer.subscriptions.retrieve(subscription.stripe_id)
end
Payola .
, , Payola, . , messing Payola: , Payola, , , Payola, .
, , , .