Skip to content

Preserve authorization expiry in payment extension configs#8143

Open
jenny-codes wants to merge 1 commit into
Shopify:mainfrom
jenny-codes:jennyshih/preserve-authorization-expiry-config
Open

Preserve authorization expiry in payment extension configs#8143
jenny-codes wants to merge 1 commit into
Shopify:mainfrom
jenny-codes:jennyshih/preserve-authorization-expiry-config

Conversation

@jenny-codes

@jenny-codes jenny-codes commented Jul 21, 2026

Copy link
Copy Markdown

WHY are these changes introduced?

Shopify CLI's payment extension schemas don't recognize the optional enforce_authorization_expiry field. When the field is present in shopify.extension.toml, schema parsing strips it before the deploy configuration is generated.

This prevents payment extensions from preserving their configured authorization-expiry behavior during deployment. The field remains optional, so existing extensions keep their current behavior when it is omitted.

WHAT is this pull request doing?

Implementation

  • Adds a reusable AuthorizationExpirySchema for enforce_authorization_expiry.
  • Applies it to credit card, custom credit card, custom onsite, and offsite payment extensions.
  • Preserves the field in both directions:
    • shopify.extension.toml -> deploy configuration
    • existing draft or published configuration -> generated TOML
  • Adds schema and transformation coverage for all four extension types.
  • Adds a minor changeset for the new optional manifest field.

This PR only updates CLI schema validation and configuration transformation. It does not change authorization-expiry defaults, enable the option for existing extensions, or add it to redeemable or card-present extensions.

How to test your changes?

pnpm vitest run \
  packages/app/src/cli/models/extensions/specifications/payments_app_extension_schemas/base_payments_app_extension_schema.test.ts \
  packages/app/src/cli/models/extensions/specifications/payments_app_extension_schemas/credit_card_payments_app_extension_schema.test.ts \
  packages/app/src/cli/models/extensions/specifications/payments_app_extension_schemas/custom_credit_card_payments_app_extension_schema.test.ts \
  packages/app/src/cli/models/extensions/specifications/payments_app_extension_schemas/custom_onsite_payments_app_extension_schema.test.ts \
  packages/app/src/cli/models/extensions/specifications/payments_app_extension_schemas/offsite_payments_app_extension_schema.test.ts \
  packages/app/src/cli/services/payments/extension-config-builder.test.ts

Result: 67 tests passed. Repository lint and type checks also passed.

Checklist

  • I've considered possible cross-platform impacts. This is platform-independent schema and object transformation code.
  • I've considered possible documentation changes. The new field may require payment-extension documentation after release.
  • I've considered analytics changes. No analytics changes are required.
  • The change is user-facing. It adds a backward-compatible optional manifest field and includes a minor changeset.

Core accepts the optional enforce_authorization_expiry configuration and Connected PayPal declares it, but Shopify CLI does not recognize the field. Zod therefore strips it before deployment and the published extension keeps the backward-compatible one-year buffer.

Complete the extension-config design introduced in shop/world#453909 by supporting the field for credit card, custom credit card, custom onsite, and offsite extensions in both transform directions.

Add schema and round-trip regression coverage so a configured value cannot silently disappear again. The field remains optional to preserve existing partner behavior.

Tracking: shop/issues-card-payment-methods#1366
Co-authored-by: AI (Pi/GPT-5.6 Sol) <noreply@pi.dev>
@jenny-codes
jenny-codes requested review from a team as code owners July 21, 2026 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant