Skip to content

Fetching the charge on each order screen is causing excessive resource_missing (charge id) errors #7076

Closed
@Jinksi

Description

Describe the bug

On each order screen where WooPayments is the payment method, we fetch the charge to determine if the charge is disputed and render a disputed order notice.

This is contributing to excessive Invalid request error: resource_missing (charge id) errors occurring (see logstash), due to:

  • the charge ID stored as order meta may be for a live transaction, and the site is in test mode (or vice versa).
  • the charge ID stored as order meta may not exist anymore (I'm unsure if this is a possibility).

To Reproduce

  1. Use a WooPayments account that can switch between live/test mode (e.g. onboard with real bank account details).
  2. Enable test mode.
  3. Create a disputed order in test mode using the card 4000000000000259.
  4. View the order. See the dispute notice introduced in 6.2.
  5. Switch to live mode.
  6. View the order. See request to /charges responds 500 with message
    Error: No such charge: 'ch_abcde'; a similar object exists in test mode, but a live mode key was used to make this request.
    

Additional context

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

category: coreWC Payments core related issues, where it’s obvious.component: disputesIssues related to Disputestype: bugThe issue is a confirmed bug.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions