You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TRANSACTION (0.1ms) commit transaction
08:24:47 web.1 | [ActiveJob] Enqueued Pay::Webhooks::ProcessJob (Job ID: fc8197f8-b893-4c97-a064-82c8d126480a) to Async(default) with arguments: #<GlobalID:0x000000016ed5a8a8 @uri=#<URI::GID gid://daisy-solid-template/Pay::Webhook/15>>
Inspecting the logs, this is the only query that is made to any of the pay models from within the job
Pay::Customer Load (0.0ms) SELECT "pay_customers".* FROM "pay_customers" WHERE "pay_customers"."processor" = ? AND "pay_customers"."processor_id" = ? LIMIT ? [["processor", "lemon_squeezy"], ["processor_id", "3847429"], ["LIMIT", 1]]
I think the problem stems from this query here. Pay is trying to find a customer with processor_id 3847429, but the customer that got created with Current.user.set_payment_processor(:lemon_squeezy) does not have any processor ID assigned.
#<Pay::LemonSqueezy::Customer:0x00000001271b9ec8
id: 6,
owner_type: "User",
owner_id: 621,
processor: "lemon_squeezy",
processor_id: nil,
default: true,
data: nil,
stripe_account: nil,
deleted_at: nil,
created_at: Wed, 02 Oct 2024 06:51:51.666428000 UTC +00:00,
updated_at: Wed, 02 Oct 2024 06:51:53.028335000 UTC +00:00,
type: "Pay::LemonSqueezy::Customer">
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hey guys!
I'm integrating
pay
with LemonSqueezy within my app. This is what I've got:In my
BillingController
I set the payment processor for the userThen, in the view I render this button
The
url_for
is defined in a model that looks like thisWhen I click that link and go through the checkout process, I see the incoming webhook
And the job gets enqueued
Inspecting the logs, this is the only query that is made to any of the pay models from within the job
I think the problem stems from this query here. Pay is trying to find a customer with
processor_id
3847429, but the customer that got created withCurrent.user.set_payment_processor(:lemon_squeezy)
does not have any processor ID assigned.Any ideas as to what I may be doing wrong?
Beta Was this translation helpful? Give feedback.
All reactions