it was kinda cumbersome that I could not verify my domain after logging in the domain agent that I'm using.
So I needed to add settings to the DNS record.
リンクを取得
Facebook
Twitter
Pinterest
メール
他のアプリ
コメント
このブログの人気の投稿
Pay.jp定期課金更新及び checkout Token 使用 controller class WebhockController< ApplicationController protect_from_forgery except: :create def create Payjp.api_key = 'あなたのキー' event = Payjp::Event.retrieve(params[:id]) case event.type when 'subscription.updated' subscription = event.data user = User.find_by(subscription_id: subscription.id) user.update_subscription(subscription) when 'subscription.created' subscription = event.data user = User.find_by(subscription_id: subscription.id) user.test when 'subscription.deleted' subscription = event.data user = User.find_by(subscription_id: subscription.id) user.test end head :ok end end controller 解説 eventをwebhockで受け取って、 subscription.updated の時に subscription_id を元にユーザーを割り出し、 subscription を update 簡単に実装できます modelで課金が有効かチェック&課金をupdate def update_subscription(subscription
コメント
コメントを投稿