Open
Description
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 implementingPaymentMethodDefinitionInterface
- Remove legacy
class-affirm-payment-method.php
- Update
PaymentMethodDefinitionRegistry
to includeAffirmDefinition
- 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
- Enable the Affirm payment method
- Verify Affirm appears correctly in checkout when enabled
- Process a test payment using Affirm and verify it works correctly
- Process a refund and verify it works correctly
- 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.