Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to create new customer #164

Open
ericgross opened this issue Jun 16, 2016 · 2 comments
Open

Unable to create new customer #164

ericgross opened this issue Jun 16, 2016 · 2 comments

Comments

@ericgross
Copy link

I am submitting the payment-form which is being sent to Stripe, then this is being returned to SubscriptionsController#update:

{                "utf8" => "✓",
    "authenticity_token" => "E5akFRcgxk/rU1AMKdmZXzVavtuBC48nIWHomLdYoeJrh6i8A21LKrTm81QRkhxXMOoVExUJ5/D7BljHp1E62w==",
          "subscription" => {
                  "plan_id" => "3",
        "credit_card_token" => "tok_18N5V2DVs23CpRtBZoolhbpZ",
                "last_four" => "2021",
                "card_type" => "American Express"
    },
            "controller" => "koudoku/subscriptions",
                "action" => "create",
              "owner_id" => "3d726ddc-bb43-4cd3-8b83-b4f9745a6a9e"
}

I am getting this error:

Could not determine which URL to request: Stripe::Customer instance has invalid ID: nil

from Stripe::Customer#resource_url, and I see that stripe_id is nil. Any ideas what I am doing wrong?

@ericgross
Copy link
Author

I guess I don't understand how we get from a token to a customer in koudoku.

@ericgross
Copy link
Author

I have determined that the failing line is this:
customer = Stripe::Customer.retrieve(self.stripe_id)
in the subscription concern (line 125).

How is the stripe_id supposed to get set?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant