【问题标题】:PayPal IPN not connecting with canceling recurring billingPayPal IPN 无法连接取消定期计费
【发布时间】:2015-03-14 12:43:45
【问题描述】:

当用户通过 PayPal 取消定期付款时,我需要帮助了解如何在我的数据库中将用户标记为已取消。

通知控制器:

 def create
    params.permit! # Permit all Paypal input params
    #query = params
    puts "in method*************************************"   
    #query[:cmd] = "_notify-validate"
    #if  params[:txn_type] == 'subscr_cancel'
    #   user_subscription = Subscription.find_by(paypal_customer_token: params[:payer_id])
        #   user_subscription.update_column("cancelled",1) if user_subscription.present?
    #els
    if  params[:txn_type] == 'recurring_payment_profile_cancel'
      user_subscription = Subscription.find_by(paypal_recurring_profile_token: params[:recurring_payment_id])
      user_subscription.update_column("cancelled",1) if user_subscription.present?
    end
    render :text => 'OK'
  end
end

【问题讨论】:

    标签: ruby-on-rails paypal


    【解决方案1】:

    嗯,我认为您必须取消注释您已评论的行,就像这样:

      if  params[:txn_type] == 'subscr_cancel'
       user_subscription = Subscription.find_by(paypal_customer_token: params[:payer_id])
       user_subscription.update_column("cancelled",1) if user_subscription.present?
      end
    

    我正在使用 php api 并且当用户取消订阅时有这个 'subscr_cancel'

    【讨论】:

      猜你喜欢
      • 2017-08-24
      • 2013-06-09
      • 2010-12-13
      • 2013-02-04
      • 2016-09-22
      • 2014-01-23
      • 2012-11-07
      相关资源
      最近更新 更多