如何使用条带保存返回的客户数据

时间:2016-06-17 11:25:36

标签: ruby-on-rails stripe-payments

我正在使用payola,这是一种用于条纹支付的rails引擎。我使用订阅方法进行订阅。目前用户可以进行订阅,并可以将数据保存在条带上。如何将返回数据保存到我的数据库。 在我的订阅控制器上,我将它设置为这样

 def create
   # do any required setup here, including finding or creating the owner object
   owner = current_user # this is just an example for Devise

   # set your plan in the params hash
   params[:plan] = SubscriptionPlan.find_by(id: params[:plan_id])

   # call Payola::CreateSubscription
   subscription = Payola::CreateSubscription.call(params, owner)

   # Render the status json that Payola's javascript expects
   render_payola_status(subscription)
   subscriptions = Subscription.new
   subscriptions.stripeid = subscription.id
    subscriptions.customer = subscription.customer
     subscriptions.plan = subscription.plan.name
      subscriptions.subscriptiondate = subscription.current_period_start
       subscriptions.subscriptionenddate = subscription.current_period_end
       subscriptions.save

 end

但是当我在我的数据库中检查它是空的

0 个答案:

没有答案