Skip to content

Commit 7d7f583

Browse files
committed
Fix: I broke this code when refactoring
1 parent 9c6d458 commit 7d7f583

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/controllers/account/subscriptions_controller.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def create
1010
plan = Plan.find(params[:plan])
1111

1212
session = Stripe::Checkout::Session.create \
13-
customer: find_or_create_stripe_customer.id,
13+
customer: find_or_create_stripe_customer,
1414
mode: "subscription",
1515
line_items: [{ price: plan.stripe_price_id, quantity: 1 }],
1616
success_url: account_subscription_url + "?session_id={CHECKOUT_SESSION_ID}",
@@ -42,7 +42,7 @@ def find_or_create_stripe_customer
4242
end
4343

4444
def find_stripe_customer
45-
@account.subscription&.stripe_customer_id if @account.subscription&.stripe_customer_id
45+
Stripe::Customer.retrieve(@account.subscription.stripe_customer_id) if @account.subscription&.stripe_customer_id
4646
end
4747

4848
def create_stripe_customer

0 commit comments

Comments
 (0)