Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug]: Cannot place order again after initial order was declined #3046

Closed
1 of 8 tasks
mikhaelbois opened this issue Mar 5, 2021 · 4 comments · Fixed by #3091
Closed
1 of 8 tasks

[bug]: Cannot place order again after initial order was declined #3046

mikhaelbois opened this issue Mar 5, 2021 · 4 comments · Fixed by #3091
Labels
bug Something isn't working Progress: done

Comments

@mikhaelbois
Copy link
Contributor

mikhaelbois commented Mar 5, 2021

Describe the bug

When placing an order, if the initial order is declined and cause a Checkout Error, we won't be able to try again without reloading the page.

To reproduce

Steps to reproduce the behavior:

  1. Create an order that will be de declined.
    In our case, we are using Braintree in sandbox mode and had an order between 2000.00 - 2999.99.
    https://developers.braintreepayments.com/reference/general/testing/php#transaction-amounts
  2. Place order and get the Checkout Error stating your order was declined.
  3. Update your payment information.
  4. Place order and see that nothing happens.

Expected behavior

We should be able to place a new order when our first try was declined.

Possible solutions

In useCheckoutPage.js we are listening to placeOrderCalled.
Initially it is set to false.
Then when we try to place an order, the value is set to true.
However, in the case we get an error with the placeOrderMutation, placeOrderCalled will still be set to true.
So we won't be able to place a new order.
Refreshing the page will reset that value to false.

Here's an opened issue that relates to this kind of behavior: <https://github.com/apollographql/apollo-feature-requests/issues/170]

Please let us know what packages this bug is in regards to:

  • venia-concept
  • venia-ui
  • pwa-buildpack
  • peregrine
  • pwa-devdocs
  • upward-js
  • upward-spec
  • create-pwa

Acceptance Criteria

  1. Users can submit an order after an initial order is declined

Test Plan

  1. Create an order that will be de declined.
    In our case, we are using Braintree in sandbox mode and had an order between 2000.00 - 2999.99.
    [https://developers.braintreepayments.com/reference/general/testing/php#transaction-amounts>
  2. Place order and get the Checkout Error stating your order was declined.
  3. Update your payment information.
  4. Place order and see that it works.

 

@mikhaelbois mikhaelbois added the bug Something isn't working label Mar 5, 2021
@m2-assistant
Copy link

m2-assistant bot commented Mar 5, 2021

Hi @mikhaelbois. Thank you for your report.
To help us process this issue please make sure that you provided sufficient information.

Please, add a comment to assign the issue: @magento I am working on this


@sirugh
Copy link
Contributor

sirugh commented Mar 6, 2021

@magento export issue to JIRA project PWA as Bug

@github-jira-sync-bot
Copy link

✅ Jira issue (https://jira.corp.magento.com/browse/PWA-1514) is successfully created for this issue.

@fooman
Copy link
Contributor

fooman commented Mar 9, 2021

As a sidenote Braintree does not support (confirmed with their support) using different credit card numbers to illicit a different payment gateway response in their sandbox. As such it will not be possible to test the following

  1. enter not working credit card details
  2. braintree declines
  3. enter working credit card details
  4. braintree accepts and order is placed

without navigating away (or some other action to update the cart total) between step 2 and 4 thereby altering state.

¯_(ツ)_/¯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Progress: done
Projects
None yet
4 participants