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

[PWA-1514] Cannot place order again after initial order was declined #3091

Merged
merged 4 commits into from
Mar 31, 2021

Conversation

eug123
Copy link
Contributor

@eug123 eug123 commented Mar 29, 2021

Description

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.

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.

Related Issue

Closes #3046
[PWA-1514] Cannot place order again after initial order was declined #3091

Acceptance

Verification Stakeholders

Specification

Verification Steps

  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.

Screenshots / Screen Captures (if appropriate)

Checklist

  • I have added tests to cover my changes, if necessary.
  • I have added translations for new strings, if necessary.
  • I have updated the documentation accordingly, if necessary.

@PWAStudioBot
Copy link
Contributor

PWAStudioBot commented Mar 29, 2021

Messages
📖

Associated JIRA tickets: PWA-1514.

📖 DangerCI Failures related to missing labels/description/linked issues/etc will persist until the next push or next nightly build run (assuming they are fixed).
📖

Access a deployed version of this PR here. Make sure to wait for the "pwa-pull-request-deploy" job to complete.

Generated by 🚫 dangerJS against 58c9254

@eug123 eug123 changed the title PWA-1514 Cannot place order again after initial order was dec… [PWA-1514] Cannot place order again after initial order was dec… Mar 29, 2021
@eug123 eug123 changed the title [PWA-1514] Cannot place order again after initial order was dec… [PWA-1514] Cannot place order again after initial order was declined Mar 29, 2021
sirugh
sirugh previously approved these changes Mar 29, 2021
Copy link
Contributor

@sirugh sirugh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice and simple fix. I was able to test the failure-then-success scenario by filling my cart with just enough items that the items + shipping would put it over $2000. I then placed the order, got the failure, and then set the shipping to free and tried to place the order. It worked!

I just wish we could get order details for rendering a receipt from the placeOrder mutation instead of having to do this temp data workaround.

Oh well!

@@ -5,5 +5,4 @@
* https://devdocs.magento.com/guides/v2.3/graphql/mutations/place-order.html#errors
*/

export const PAYMENT_ERROR =
'Unable to place order: Transaction has been declined. Please try again later.';
export const PAYMENT_ERROR = 'Unable to place order:';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did making this error text more generic catch a case that was being missed previously?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I have different error message, when having order declined by sandbox using mentioned order amount, which would not trigger payment form reset. And it seems there could be more message variation starting with Unable to place order

@eug123 eug123 marked this pull request as ready for review March 29, 2021 21:04
@eug123 eug123 added the version: Patch This changeset includes backwards compatible bug fixes. label Mar 29, 2021
@eug123 eug123 requested a review from sirugh March 29, 2021 21:19
@dpatil-magento
Copy link
Contributor

QA Approved.

@dpatil-magento dpatil-magento merged commit 3f35a5e into magento:develop Mar 31, 2021
@dpatil-magento dpatil-magento deleted the PWA-1514 branch March 31, 2021 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg:peregrine Progress: done version: Patch This changeset includes backwards compatible bug fixes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug]: Cannot place order again after initial order was declined
4 participants