Conversation
…webhook flow Coinbase has no capture API (the Capture flow returns FlowNotSupported) and does not support refunds, but its connector specification declared CaptureMethod::Manual and EventClass::Refunds. /feature_matrix and the generated connector docs advertised both. Keep SequentialAutomatic: a Coinbase charge never reports Authorized, so should_initiate_capture_flow never chains a capture call for it and it behaves like Automatic. Add unit tests for capture method validation and declared webhook flows. Fixes juspay#14277 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of Change
Description
The Coinbase connector specification declared capabilities that the connector does not implement, so
GET /feature_matrix(and the connector docs generated from it) advertised them:supported_capture_methodsAutomatic,Manual,SequentialAutomaticAutomatic,SequentialAutomaticConnectorIntegration<Capture>returnsFlowNotSupported, so a manual capture can never be completedCOINBASE_SUPPORTED_WEBHOOK_FLOWSPayments,RefundsPaymentsNotSupported,ExecutereturnsFlowNotSupported, andget_webhook_event_typemaps no refund eventBecause the default
ConnectorValidation::validate_connector_against_payment_requestchecks the requested capture method againstsupported_capture_methods, a Coinbase payment withcapture_method: manualis now rejected up front withNotSupported, instead of being accepted and failing at capture time.Why
SequentialAutomaticis kept (the issue suggests removing it):should_initiate_capture_flowonly chains a capture call when the attempt isAuthorized, and only for Paybox. Coinbase's status mapping never producesAuthorized(New→AuthenticationPending,Completed/Resolved→Charged), so for CoinbaseSequentialAutomaticbehaves exactly likeAutomaticand works today. Removing it would start rejecting requests that currently succeed. This matchescryptopay, which declares the same pair.Additional Changes
Motivation and Context
Fixes #14277.
How did you test it?
Added unit tests in
crates/hyperswitch_connectors/src/connectors/coinbase.rsthat callvalidate_connector_against_payment_requestfor each capture method and checkget_supported_webhook_flows.Tests against the old declarations (tests only):
With the fix:
Not tested against a live Coinbase account: the change only affects declarations and request validation, and no Coinbase API call changes.
Checklist
cargo +nightly fmt --allcargo clippy🤖 Generated with Claude Code