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

Payments: scaffold the checkout pending page, the 2nd attempt. #23827

Merged
merged 11 commits into from
Apr 13, 2018

Conversation

southp
Copy link
Contributor

@southp southp commented Apr 2, 2018

Summary

This PR renovates #23670 so that the pending checkout page routes according to the new state tree defined in #23822.

Test Plan

  1. Access the pending checkout page URL, e.g. http://calypso.localhost:3000/checkout/thank-you/southptestcall.wordpress.com/pending/12345. Note that 12345 here is considered as the order ID, and the site slug should be the one belonging to the account that you have logged in. You should see this:
    image
  2. For the payment succeeded scenario, In the browser console. run: dispatch( { type: 'ORDER_TRANSACTION_SET', orderId: 12345, transaction: { processingStatus: 'ORDER_TRANSACTION_STATUS_SUCCESS' } } ); and you should see:
    image
  3. For the payment error scenario, go back to the pending checkout page, and run dispatch( { type: 'ORDER_TRANSACTION_SET', orderId: 12345, transaction: { processingStatus: 'ORDER_TRANSACTION_STATUS_ERROR' } } );. You should be redirected to the checkout page like this:
    image
  4. For the case that API responded with HTTP error, run dispatch( { type: 'ORDER_TRANSACTION_FETCH_ERROR', orderId: 12345, error: {} } ); and you should see the same page like above.
  5. For the case that a user has cancelled a payment, run dispatch( { type: 'ORDER_TRANSACTION_SET', orderId: 12345, transaction: { processingStatus: 'ORDER_TRANSACTION_STATUS_FAILURE' } } ); and you should be redirected back to homepage.
  6. For the case that API responded with an unknown status string, run dispatch( { type: 'ORDER_TRANSACTION_SET', orderId: 12345, transaction: { processingStatus: 'ORDER_TRANSACTION_STATUS_UKNOWN' } } ); and you should be redirected back to homepage with an error notice like this:
    image

@southp southp self-assigned this Apr 2, 2018
@matticbot
Copy link
Contributor

page( '/' );

showErrorNotice(
translate( "Sorry, we've encountered an unknown problem. Please try again later." )
Copy link

Choose a reason for hiding this comment

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

Hi! I've found a possible matching string that has already been translated 19 times:
translate( 'We've encountered a problem. Please try again later.' ) ES Score: 12

Help me improve these suggestions: react with 👎 if the suggestion doesn't make any sense, or with 👍 if it's a particularly good one (even if not implemented).

@southp southp added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. and removed [Status] In Progress labels Apr 2, 2018
@southp southp requested review from a team April 2, 2018 11:11
page( '/' );

showErrorNotice(
translate( "Sorry, we've encountered an unknown problem. Please try again later." )
Copy link

Choose a reason for hiding this comment

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

Hi! I've found a possible matching string that has already been translated 19 times:
translate( 'We've encountered a problem. Please try again later.' ) ES Score: 12

Help me improve these suggestions: react with 👎 if the suggestion doesn't make any sense, or with 👍 if it's a particularly good one (even if not implemented).

@southp southp added the [Status] Needs Copy Review Add this when you'd like to get a review / feedback from the Editorial team on your PR label Apr 3, 2018
@benhuberman
Copy link

Hi @southp -- going through the various screens, here are a couple of quick notes re: the copy:

  1. The congrats message looks fine! It would be even nicer if it were a little more specific, e.g. "Congratulations on your new plan!", "Congratulations on your new domain!" etc. but it's not a huge deal if this isn't possible.
  2. The error message in bullet point Menus: Alignment issue with undo link in is-info notice after deleting menu #3 sounds slightly off. I'd tweak to:

Sorry, we couldn't process your payment. Please try again later.

  1. The error message in bullet point Site Picker: Always show search if user has hidden site #4 is also a bit weird -- specifically, the "unknown problem" bit, which leaves the user entirely unsure what's happened. I don't know that any alternative would make a user significantly more confident, but even changing "unknown" to "unexpected" could soften the effect here. This is a moment in which a slightly "warmer" message might be worth considering, e.g.:

Oops! Something went wrong. Please try again later.

@southp southp force-pushed the add/scaffold-the-checkout-pending-page-2nd branch from 9d53ff6 to 999a8be Compare April 10, 2018 02:38
@southp
Copy link
Contributor Author

southp commented Apr 10, 2018

@benhuberman Thanks for the feedback! I've updated the two screens as:
image
and
image

Does it look good to you?

@southp southp force-pushed the update/match-response-format-of-order-transaction-endpoint branch from 1365c79 to 99ea650 Compare April 10, 2018 03:40
@southp southp force-pushed the add/scaffold-the-checkout-pending-page-2nd branch from 999a8be to ef4821d Compare April 10, 2018 03:48
// See the explanation in https://github.com/Automattic/wp-calypso/pull/23670#issuecomment-377186515
if ( ORDER_TRANSACTION_STATUS.FAILURE === processingStatus ) {
// Bring the user back to the homepage in this case.
page( '/' );
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm having second doubts about this - maybe the plans page is better?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After playing a bit more, I agree with you. Since the whole flow is initiated from the plan page, redirecting back there is much less confusing. I've updated it in 9fc71cf. The case of unknown status has been updated as well, which I think the same reasoning applied :)

@southp southp force-pushed the add/scaffold-the-checkout-pending-page-2nd branch from 9fc71cf to 53b7e6a Compare April 13, 2018 02:10
@southp southp changed the base branch from update/match-response-format-of-order-transaction-endpoint to master April 13, 2018 02:10
@southp southp merged commit caedb8a into master Apr 13, 2018
@matticbot matticbot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Apr 13, 2018
@benhuberman
Copy link

Looks good to me, @southp!

@alisterscott alisterscott deleted the add/scaffold-the-checkout-pending-page-2nd branch August 8, 2018 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] Needs Copy Review Add this when you'd like to get a review / feedback from the Editorial team on your PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants