Skip to content

Checkout mutation does not return WC Session Notices #666

Open
@plexus77

Description

@plexus77

Describe the bug
When using the test stripe gateway (and probably any other for that matter) and then performing a checkout mutation the WC Session notices are not returned with a failed payment. If you then replace the details with a successful payment test card the failure notices from the previous mutation are returned.

To Reproduce
Steps to reproduce the behavior:

  1. Go to the checkout on the frontend
  2. Enter test card details for a failed transaction
  3. Checkout mutation fails but does not return notices
  4. Enter test card details for a successful transaction and attempt payment again
  5. The payment is not processed and the notices from the previous failed transaction are returned
  6. Attempt payment again and it is successful

Expected behavior
Session notices are returned and cleared on every checkout mutation

Desktop (please complete the following information):

  • OS: MacOS
  • Browser: Chrome
  • Version: Latest

Plugin Versions

  • WooGraphQL Version: 0.11.2
  • WPGraphQL Version: 1.11.2
  • WordPress Version: 6.1
  • WooCommerce Version: 7.0.0

Additional context
In order to fix this bug I ended up creating a REST API endpoint that calls the checkout mutation and then before returning the result to the frontend adds the notices and clears them from the session.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions