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(Adyen) - Also send webhook for missing payment provider code #2728

Merged
merged 1 commit into from
Oct 23, 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
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ def call

def handle_payment_provider_failure(payment_provider_result)
return payment_provider_result unless payment_provider_result.error.is_a?(BaseService::ServiceFailure)
return payment_provider_result unless payment_provider_result.error.code == 'payment_provider_code_missing'

result.service_failure!(code: 'webhook_error', message: 'Payment provider code is missing')
result.service_failure!(code: 'webhook_error', message: payment_provider_result.error.error_message)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/services/payment_providers/find_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def call
if code.blank? && scope.count > 1
return result.service_failure!(
code: 'payment_provider_code_missing',
message: 'Code is missing'
message: 'Payment provider code is missing'
)
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
aggregate_failures do
expect(result).not_to be_success
expect(result.error).to be_a(BaseService::ServiceFailure)
expect(result.error.code).to eq('payment_provider_not_found')
expect(result.error.code).to eq('webhook_error')
expect(result.error.error_message).to eq('Payment provider not found')
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/services/payment_providers/find_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
expect(result).not_to be_success
expect(result.error).to be_a(BaseService::ServiceFailure)
expect(result.error.code).to eq('payment_provider_code_missing')
expect(result.error.error_message).to eq('Code is missing')
expect(result.error.error_message).to eq('Payment provider code is missing')
end
end
end
Expand Down