payolapayments / payola

Drop-in Rails engine for accepting payments with Stripe
http://www.payola.io
Other
819 stars 157 forks source link

Error trying to subscribe #325

Closed sechix closed 5 years ago

sechix commented 7 years ago

Hello, I tried in different ways but I am not able to subscribe with payola. I have solidus app. This is my subscriptions/new:

`<% content_for :head do %> <%= render 'payola/transactions/stripe_header' %> <% end %> <% @plan.plan_class = 'subscription_plan' %>

<%= form_tag(recurring_plan_subscriptions_url(@plan), role: 'form', class: 'payola-onestep-subscription-form', :method => :post, 'data-payola-base-path' => '/payola', 'error-selector' => '.payola-error', 'data-payola-plan-type' => @plan.plan_class, 'data-payola-plan-id' => @plan.id ) do |f| %> <%= hidden_field_tag :stripeEmail,spree_current_user.email, 'data-payola' => 'email' %> <%= hidden_field_tag :quantity, 1, 'data-payola' => 'quantity' %> <%= hidden_field_tag :stripe_customer_id, spree_current_user.stripe_customer_id %> <%= image_tag 'credit_cards/credit_card.gif', :id => 'credit-card-image' %>

<%= label_tag "card_number", Spree.t(:card_number) %>*
<% options_hash = Rails.env.production? ? {:autocomplete => 'off'} : {} %> <%= text_field_tag "card_number", '', options_hash.merge(:id => 'card_number', :class => 'required cardNumber', :size => 19, :maxlength => 19, :autocomplete => "off", 'data-stripe' => 'number') %>  

<%= label_tag "card_expiry", Spree.t(:expiration) %>*
<%= text_field_tag "card_expiry", '', :id => 'card_expiry', :class => "required cardExpiry", :placeholder => "MM / YY" , 'data-stripe' => 'card_expiry'%> <%= hidden_field_tag :exp_month, nil, name: nil, id: "stripe-card-exp-month", data: { stripe: "exp-month" }, 'data-payola' => 'exp_month' %> <%= hidden_field_tag :exp_year, nil, name: nil, id: "stripe-card-exp-year", data: { stripe: "exp-year" } , 'data-stripe' => 'exp_year' %>

<%= label_tag "card_code", Spree.t(:card_code) %>*
<%= text_field_tag "card_code", '', options_hash.merge(:id => 'card_code', :class => 'required cardCode', :size => 5, 'data-stripe' => 'cvc') %> (¿Qué es esto?)

<%= button_tag Spree.t(:subscribe), class: 'continue button primary', :id => "button_pay" %>

<%= check_box_tag :accept_terms_and_conditions ,'accepted',false %>

<%= label_tag :accept_terms_and_conditions, Spree.t(:acepto) %> las condiciones de uso

<% end %> `

I don't know why I get this error processing the job : NameError: uninitialized constant User. I guess its due to solidus, but I don't know how to fix it.