Skip to content

Convert Affirm Payment Method to Use Payment Method Definition #10660

Open
@brettshumaker

Description

@brettshumaker

Description

Convert the Affirm payment method from using the legacy payment method class (Affirm_Payment_Method) to using the new payment method definition system (AffirmDefinition). This is part of the ongoing effort to improve maintenance of payment methods.

Acceptance criteria

  • Create new AffirmDefinition.php class implementing PaymentMethodDefinitionInterface
  • Remove legacy class-affirm-payment-method.php
  • Update PaymentMethodDefinitionRegistry to include AffirmDefinition
  • Remove Affirm references from existing hard-coded lists of payment methods:
    • payment-methods-map.tsx
    • class-duplicates-detection-service.php
    • class-wc-payment-gateway-wcpay.php
    • class-wc-payments.php
    • Test files
    • Check all instances of FLAG: PAYMENT_METHODS_LIST in the codebase to see if Affirm can be removed from that list.
  • All tests pass after implementation

Testing instructions

  1. Enable the Affirm payment method
  2. Verify Affirm appears correctly in checkout when enabled
  3. Process a test payment using Affirm and verify it works correctly
  4. Process a refund and verify it works correctly
  5. Run the full test suite to confirm no regressions

Dev notes

The new definition should maintain all existing functionality while following the new payment method definition pattern. Carefully port any necessary logic from the legacy class file into the definition file.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions