Skip to content

Refresh on payment accepted not working #1

@marcoandre1

Description

@marcoandre1

After log in, a customer can go to his profile by clicking his mail adress on the lop left of the screen.

<div class="container">
  <h3>Account for <%= current_user.email %></h3>
  <% if @subscription.active %>
  subscribed
  <% else %>
    <%= render 'form' %>
  <% end %>
</div>

If the customer is subscribed he get's the message subscribed, otherwise he gets the Stripe payment form. When the payment is accepted. The redirection method in users_controllers#charge which is redirect_to users_info_path doesn't seem to reload html properly. If the browser is refreshed (F5), then the html is also refreshed.

def charge
  paymentMethodId = params["paymentMethodId"]
    
  # Create subscription

  redirect_to users_info_path
end

I can see the new subscription on my Stripe dashboard. The problems seems to be that I can't redirect with a redirect_to. I have tried other methods but with no success.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions