Skip to content

Commit

Permalink
Merge pull request #8271 from fjordllc/chore/retire-in-hibernated
Browse files Browse the repository at this point in the history
サブスクリプションをキャンセル済みの場合はキャンセル処理をしないようにした
  • Loading branch information
komagata authored Jan 17, 2025
2 parents 89624d7 + c75c33c commit 1cc40ba
Show file tree
Hide file tree
Showing 3 changed files with 418 additions and 50 deletions.
2 changes: 2 additions & 0 deletions app/models/subscription.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ def create(customer_id, idempotency_key = SecureRandom.uuid, trial: 3)
end

def destroy(subscription_id)
return true if retrieve(subscription_id).status == 'canceled'

Stripe::Subscription.update(subscription_id, cancel_at_period_end: true)
end

Expand Down
1 change: 0 additions & 1 deletion test/application_system_test_case.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
driven_by :selenium, using: :chrome
else
driven_by(:selenium, using: :headless_chrome) do |driver_option|
driver_option.add_argument('--headless=old')
driver_option.add_argument('--no-sandbox')
driver_option.add_argument('--disable-dev-shm-usage')
end
Expand Down
Loading

0 comments on commit 1cc40ba

Please sign in to comment.