Payment Customization Function not applied to re-payment flow from failed payment notification

Hi everyone,

I’m developing a payment customization app using the purchase.payment-customization.run API, and I’ve encountered an issue where customizations don’t apply to re-payment flows.

The Problem

  • Works: Payment methods are correctly hidden/reordered during normal checkout
  • Doesn’t work: When customers retry payment via the link in payment error notification emails, hidden payment methods reappear

Current Implementation

// extensions/payment-customization/src/run.ts
export function run(input: RunInput): FunctionRunResult {
  if (!input.paymentCustomization?.metafield?.value) {
    return { operations: [] };
  }
  
  // Apply hide/rename/reorder operations based on metafield config
  const operations: Operation[] = [];
  
  paymentCustomizations.forEach((customization) => {
    // ... hide/rename/reorder logic
    if (customization.action === Action.HIDE) {
      operations.push({
        hide: { paymentMethodId: method.id }
      });
    }
  });
  
  return { operations };
 }

Extension config:

  • Target: purchase.payment-customization.run
  • API Version: 2024-10

Reproduction Steps

  1. Configure app to hide specific payment method (e.g., “Cash on Delivery”)
  2. Verify it works in normal checkout :white_check_mark:
  3. Initiate payment with external gateway, let it fail
  4. Customer receives payment error notification email
  5. Customer clicks retry link → Hidden payment methods are visible again :cross_mark:

Questions

  1. Is purchase.payment-customization.run supposed to apply to re-payment flows from failed payment notifications?
  2. Are these re-payment screens considered a different context than regular checkout?
  3. What’s the recommended approach to ensure consistent payment method customization across all payment flows?

Additional Context

The Payment Customization API docs list “Checkout” as a supported surface but don’t explicitly mention re-payment flows. Has anyone successfully applied payment customizations to re-payment scenarios? Any insights would be greatly appreciated! Thanks in advance!

1 Like

Hey @wl_Ha_ay unfortunately the payment hide functions are not currently supported to run on the order edit surface which is what it sounds like this is here.