Repository navigation
Conversation
A consumer building a gateway settings screen had to keep its own list of gateways, with each one's description, docs link and settings DocType, so every new gateway meant a change in each consumer. - api.get_gateways() returns a GatewayInfo (name, settings_doctype, description, docs_url, capabilities, logos) for every gateway Settings Single on the site, enabled or not, including another app's gateways. - The contract gains description, docs_url and capabilities class attributes. REUSABLE_CHECKOUT says the checkout link stays payable after the shopper leaves it. - Razorpay, Stripe, Telr and Tabby describe themselves. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A tuple of capability strings and a constant carried one flag that nothing in this app reads. reusable_checkout: bool says the same on the contract and on GatewayInfo. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
get_gateways imported every `% Gateway Settings` controller, so one DocType left behind by a removed app, or by code on another branch, raised ImportError and broke every screen that lists gateways, such as a storefront checkout. It is now skipped and logged to the file log. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
A consumer that builds a gateway settings screen had to keep its own list of gateways, with each one's description, docs link and settings DocType. Every new gateway meant a change in each consumer.
api.get_gateways()returns aGatewayInfofor every gateway Settings Single on the site, enabled or not, including another app's gateways. bwh_payments stays independent of any one consumer.Split out of #7 on review. #7 (PayPal) is stacked on this PR.
Changes
api.get_gateways()returnsGatewayInfo:name,settings_doctype,description,docs_url,reusable_checkoutand logosdescription,docs_urlandreusable_checkoutclass attributes onPaymentGatewayBase. Razorpay, Stripe, Telr and Tabby describe themselvesreusable_checkout: boolsays the checkout link stays payable after the shopper leaves it. It replaces thecapabilitiestuple andREUSABLE_CHECKOUTconstant from the first version of feat: add PayPal gateway #7, which carried only this one flagutils.get_gateway_settings_doctypes()finds every Single whose controller implementsPaymentGatewayBase. A DocType whose controller cannot be imported (its app was removed, or its code is on another branch) is skipped and logged, so it cannot break every screen that lists gatewaysTesting
bwh_payments.tests.test_apichecks that every installed gateway is listed, set up or not, names its settings DocType, and carries a description, docs link, logo andreusable_checkout. Full suite passes locally.🤖 Generated with Claude Code