RailsApps / rails-stripe-membership-saas

An example Rails 4.2 app with Stripe and the Payola gem for a membership or subscription site.

Home Page:http://railsapps.github.io/rails-stripe-membership-saas

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getting Null GUID on Create

RailsCod3rFuture opened this issue · comments

I'm having trouble figuring out why I am receiving {"guid":null,"status":"pending","error":"Email can't be blank"} after I attempt to create a user. Even though, all of the input fields are correct. I cannot get past this point. My server log information is below. Can you help me, please?

Started POST "/" for 127.0.0.1 at 2017-03-02 21:33:09 -0500
Processing by Users::RegistrationsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"cZqJL55nm/CDUEoe4K+opEtIG/hS+eztoIOCoH85KsTbKBRQgz41YKcszUnD2uwlrqzrtUE2L6ENPzRikfcDcQ==", "user"=>{"plan_id"=>"2", "email"=>"testdoctor100@hotmail.com", "username"=>"TestDoctor100", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]", "full_name"=>"David Wright", "terms_and_conditions"=>"1"}, "commit"=>"Sign up"}
Plan Load (0.0ms) SELECT "plans".* FROM "plans" WHERE "plans"."id" = ? LIMIT ? [["id", 2], ["LIMIT", 1]]
CACHE (0.0ms) SELECT "plans".* FROM "plans" WHERE "plans"."id" = ? LIMIT ? [["id", 2], ["LIMIT", 1]]
(1.0ms) begin transaction
User Exists (1.0ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "testdoctor100@hotmail.com"], ["LIMIT", 1]]
Plan Exists (0.0ms) SELECT 1 AS one FROM "plans" WHERE "plans"."stripe_id" = ? AND ("plans"."id" != ?) LIMIT ? [["stripe_id", "ultimate_suite"], ["id", 2], ["LIMIT", 1]]
User Exists (0.0ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "TestDoctor100"], ["LIMIT", 1]]
User Exists (15.8ms) SELECT 1 AS one FROM "users" WHERE LOWER("users"."username") = LOWER(?) LIMIT ? [["username", "TestDoctor100"], ["LIMIT", 1]]
Plan Exists (0.0ms) SELECT 1 AS one FROM "plans" WHERE "plans"."stripe_id" = ? AND ("plans"."id" != ?) LIMIT ? [["stripe_id", "ultimate_suite"], ["id", 2], ["LIMIT", 1]]
SQL (2.0ms) INSERT INTO "users" ("email", "username", "encrypted_password", "created_at", "updated_at", "plan_id", "full_name") VALUES (?, ?, ?, ?, ?, ?, ?) [["email", "testdoctor100@hotmail.com"], ["username", "TestDoctor100"], ["encrypted_password", "$2a$11$fvyCFGmPyaMHKLrJgU9C.eccFiyyIuP/CxoIZsqJNUZ2KTI8qdbSS"], ["created_at", 2017-03-03 02:33:10 UTC], ["updated_at", 2017-03-03 02:33:10 UTC], ["plan_id", 2], ["full_name", "David Wright"]]
SQL (1.0ms) INSERT INTO "user_profiles" ("user_id", "created_at", "updated_at") VALUES (?, ?, ?) [["user_id", 2], ["created_at", 2017-03-03 02:33:10 UTC], ["updated_at", 2017-03-03 02:33:10 UTC]]
(98.4ms) commit transaction
(0.0ms) begin transaction
SQL (2.0ms) UPDATE "users" SET "sign_in_count" = ?, "current_sign_in_at" = ?, "last_sign_in_at" = ?, "current_sign_in_ip" = ?, "last_sign_in_ip" = ?, "updated_at" = ? WHERE "users"."id" = ? [["sign_in_count", 1], ["current_sign_in_at", 2017-03-03 02:33:10 UTC], ["last_sign_in_at", 2017-03-03 02:33:10 UTC], ["current_sign_in_ip", "127.0.0.1"], ["last_sign_in_ip", "127.0.0.1"], ["updated_at", 2017-03-03 02:33:10 UTC], ["id", 2]]
(98.5ms) commit transaction
(0.0ms) begin transaction
Payola::Subscription Exists (0.0ms) SELECT 1 AS one FROM "payola_subscriptions" WHERE "payola_subscriptions"."guid" IS NULL LIMIT ? [["LIMIT", 1]]
(0.0ms) rollback transaction
(0.0ms) begin transaction
Plan Exists (0.0ms) SELECT 1 AS one FROM "plans" WHERE "plans"."stripe_id" = ? AND ("plans"."id" != ?) LIMIT ? [["stripe_id", "ultimate_suite"], ["id", 2], ["LIMIT", 1]]
User Exists (0.0ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "TestDoctor100"], ["LIMIT", 1]]
User Exists (0.0ms) SELECT 1 AS one FROM "users" WHERE LOWER("users"."username") = LOWER(?) AND ("users"."id" != ?) LIMIT ? [["username", "TestDoctor100"], ["id", 2], ["LIMIT", 1]]
Plan Exists (0.0ms) SELECT 1 AS one FROM "plans" WHERE "plans"."stripe_id" = ? AND ("plans"."id" != ?) LIMIT ? [["stripe_id", "ultimate_suite"], ["id", 2], ["LIMIT", 1]]
(0.0ms) commit transaction
Completed 400 Bad Request in 1441ms (Views: 0.3ms | ActiveRecord: 223.7ms)

It may be an issue with the Background Worker. I see that the user has been created in my Rails Console, but the process fails over the GUID and default Email. Also, the role is nil, when it's supposed to be user by default.
#<User id: 2, email: "testdoctor100@hotmail.com", username: "TestDoctor100", created_at: "2017-03-03 02:33:10", updated_at: "2017-03-03 02:33:10", time_zone: nil, role: nil, plan_id: 2, full_name: "David Wright">]>