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

bug(PayInAdvance) - Add dedicated lock_key_arguments for pay in advance jobs #2755

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions app/jobs/fees/create_pay_in_advance_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ def perform(charge:, event:, billing_at: nil)
result.raise_if_error!
end

def lock_key_arguments
args = arguments.first
event = Events::CommonFactory.new_instance(source: args[:event])
[args[:charge], event.organization_id, event.external_subscription_id, event.transaction_id]
end

private

def tax_error?(result)
Expand Down
6 changes: 6 additions & 0 deletions app/jobs/invoices/create_pay_in_advance_charge_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ def perform(charge:, event:, timestamp:, invoice: nil)
)
end

def lock_key_arguments
args = arguments.first
event = Events::CommonFactory.new_instance(source: args[:event])
[args[:charge], event.organization_id, event.external_subscription_id, event.transaction_id]
end

private

def tax_error?(result)
Expand Down