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

Transaction Details → Show steps to resolve for inquiries #7292

Merged
merged 16 commits into from
Oct 4, 2023

Conversation

Jinksi
Copy link
Member

@Jinksi Jinksi commented Sep 26, 2023

Fixes #7245 (Inquiry steps to resolve)
Fixed #7255 (Show "Past due" in steps to resolve when dispute past due)

Note
This PR is behind feature flag _wcpay_feature_dispute_on_transaction_page

Changes proposed in this Pull Request

Add the 'Steps to resolve' section on the transaction details page for inquiries.

inquiry-steps

Notes:

Testing instructions

  • Enable the feature flag by running update_option( '_wcpay_feature_dispute_on_transaction_page', '1' ); in WP Console.
  • Create a disputed inquiry transaction using the card 4000000000001976 at checkout.
  • Open the transaction details page of that new order by going to admin > Payments > Transactions > click on the topmost transaction.
  • Confirm there is 'Steps to resolve' section.
  • Confirm the steps are:
     1. Email the customer to identify the issue and work towards a resolution where possible.
     2. Submit evidence (?) or issue a refund by (date)
    
  • Click on the 'Email the customer' link. It should open your local email client. Confirm:
    • To address is the customer's email address.
    • Subject is Problem with your purchase from {store name} on {YYYY-MM-DD of the charge date}?
    • Body is:
      Hello {customer name}
      
      We noticed that on {YYYY-MM-DD of the dispute created date}, you disputed a {currency formatted dispute amount, eg: $10.00} from {YYYY-MM-DD of the charge date}. We wanted to contact you to make sure everything was all right with your purchase and see if there's anything else we can do to resolve any problems you might have had.
      
      Alternatively, if the dispute was a mistake, you could easily withdraw it by calling the number on the back of your card. Thank you so much - we appreciate your business and look forward to working with you.
      
  • Confirm the 2nd step has the tooltip:
     To submit evidence, provide documentation that supports your case. Keep in mind that submitting evidence doesn't ensure a favorable outcome. If the cardholder agrees to withdraw the inquiry, you'll still need to officially submit your evidence to prevent bank escalation. Learn more (links to `https://woocommerce.com/document/woopayments/fraud-and-disputes/managing-disputes/#inquiries`)
    

  • Run npm run changelog to add a changelog file, choose patch to leave it empty if the change is not significant. You can add multiple changelog files in one PR by running this command a few times.
  • Covered with tests (or have a good reason not to test in description ☝️)
  • Tested on mobile (or does not apply)

Post merge

@@ -28,6 +28,42 @@ interface Props {
daysRemaining: number;
}

const DueByDate: React.FC< {
Copy link
Member Author

@Jinksi Jinksi Sep 26, 2023

Choose a reason for hiding this comment

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

I moved this out to a standalone shared component in 5c8a008 since it is relatively complex logic and is identical for both cases.

@@ -76,7 +76,7 @@ export type DisputeStatus =
export interface Dispute {
status: DisputeStatus;
id: string;
evidence_details?: EvidenceDetails;
evidence_details: EvidenceDetails;
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a required field as per the Stripe dispute API docs.

@botwoo
Copy link
Collaborator

botwoo commented Sep 26, 2023

Test the build

Option 1. Jetpack Beta

  • Install and activate Jetpack Beta.
  • Use this build by searching for PR number 7292 or branch name add/7245-transaction-details-inquiry-steps-to-resolve in your-test.site/wp-admin/admin.php?page=jetpack-beta&plugin=woocommerce-payments

Option 2. Jurassic Ninja - available for logged-in A12s

🚀 Launch a JN site with this branch 🚀

ℹ️ Install this Tampermonkey script to get more options.


Build info:

  • Latest commit: 5a4cf65
  • Build time: 2023-10-04 23:33:22 UTC

Note: the build is updated when a new commit is pushed to this PR.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 26, 2023

Size Change: +220 B (0%)

Total Size: 1.42 MB

Filename Size Change
release/woocommerce-payments/dist/index.js 284 kB +220 B (0%)
ℹ️ View Unchanged
Filename Size
release/woocommerce-payments/assets/css/admin.css 1.03 kB
release/woocommerce-payments/assets/css/success.css 158 B
release/woocommerce-payments/dist/blocks-checkout-rtl.css 1.51 kB
release/woocommerce-payments/dist/blocks-checkout.css 1.51 kB
release/woocommerce-payments/dist/blocks-checkout.js 74.6 kB
release/woocommerce-payments/dist/checkout-rtl.css 440 B
release/woocommerce-payments/dist/checkout.css 441 B
release/woocommerce-payments/dist/checkout.js 28.8 kB
release/woocommerce-payments/dist/index-rtl.css 36.4 kB
release/woocommerce-payments/dist/index.css 36.4 kB
release/woocommerce-payments/dist/multi-currency-analytics.js 1.05 kB
release/woocommerce-payments/dist/multi-currency-rtl.css 2.88 kB
release/woocommerce-payments/dist/multi-currency-switcher-block.js 60.2 kB
release/woocommerce-payments/dist/multi-currency.css 2.88 kB
release/woocommerce-payments/dist/multi-currency.js 54.8 kB
release/woocommerce-payments/dist/order-rtl.css 676 B
release/woocommerce-payments/dist/order.css 679 B
release/woocommerce-payments/dist/order.js 41 kB
release/woocommerce-payments/dist/payment-gateways-rtl.css 690 B
release/woocommerce-payments/dist/payment-gateways.css 692 B
release/woocommerce-payments/dist/payment-gateways.js 38.5 kB
release/woocommerce-payments/dist/payment-request-rtl.css 146 B
release/woocommerce-payments/dist/payment-request.css 146 B
release/woocommerce-payments/dist/payment-request.js 11.8 kB
release/woocommerce-payments/dist/product-details.js 898 B
release/woocommerce-payments/dist/settings-rtl.css 8.93 kB
release/woocommerce-payments/dist/settings.css 8.94 kB
release/woocommerce-payments/dist/settings.js 233 kB
release/woocommerce-payments/dist/subscription-edit-page.js 669 B
release/woocommerce-payments/dist/subscription-product-onboarding-modal-rtl.css 519 B
release/woocommerce-payments/dist/subscription-product-onboarding-modal.css 519 B
release/woocommerce-payments/dist/subscription-product-onboarding-modal.js 20.3 kB
release/woocommerce-payments/dist/subscription-product-onboarding-toast.js 693 B
release/woocommerce-payments/dist/subscriptions-empty-state-rtl.css 117 B
release/woocommerce-payments/dist/subscriptions-empty-state.css 117 B
release/woocommerce-payments/dist/subscriptions-empty-state.js 19.5 kB
release/woocommerce-payments/dist/tos-rtl.css 230 B
release/woocommerce-payments/dist/tos.css 231 B
release/woocommerce-payments/dist/tos.js 21.9 kB
release/woocommerce-payments/dist/upe_checkout-rtl.css 440 B
release/woocommerce-payments/dist/upe_checkout.css 441 B
release/woocommerce-payments/dist/upe_checkout.js 34.1 kB
release/woocommerce-payments/dist/upe_split_checkout-rtl.css 440 B
release/woocommerce-payments/dist/upe_split_checkout.css 441 B
release/woocommerce-payments/dist/upe_split_checkout.js 34.6 kB
release/woocommerce-payments/dist/upe_with_deferred_intent_creation_checkout.js 36.7 kB
release/woocommerce-payments/dist/upe-blocks-checkout-rtl.css 1.51 kB
release/woocommerce-payments/dist/upe-blocks-checkout.css 1.51 kB
release/woocommerce-payments/dist/upe-blocks-checkout.js 39.5 kB
release/woocommerce-payments/dist/upe-split-blocks-checkout-rtl.css 1.51 kB
release/woocommerce-payments/dist/upe-split-blocks-checkout.css 1.51 kB
release/woocommerce-payments/dist/upe-split-blocks-checkout.js 41 kB
release/woocommerce-payments/dist/woopay-express-button-rtl.css 146 B
release/woocommerce-payments/dist/woopay-express-button.css 146 B
release/woocommerce-payments/dist/woopay-express-button.js 51.6 kB
release/woocommerce-payments/dist/woopay-rtl.css 3.85 kB
release/woocommerce-payments/dist/woopay.css 3.85 kB
release/woocommerce-payments/dist/woopay.js 71.6 kB
release/woocommerce-payments/includes/subscriptions/assets/css/plugin-page.css 622 B
release/woocommerce-payments/includes/subscriptions/assets/js/plugin-page.js 814 B
release/woocommerce-payments/vendor/automattic/jetpack-assets/build/i18n-loader.js 2.43 kB
release/woocommerce-payments/vendor/automattic/jetpack-assets/src/js/i18n-loader.js 1.01 kB
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/tracks-ajax.js 522 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/tracks-callables.js 581 B
release/woocommerce-payments/vendor/automattic/jetpack-identity-crisis/babel.config.js 160 B
release/woocommerce-payments/vendor/automattic/jetpack-identity-crisis/build/index.css 2.32 kB
release/woocommerce-payments/vendor/automattic/jetpack-identity-crisis/build/index.js 13.8 kB
release/woocommerce-payments/vendor/automattic/jetpack-identity-crisis/build/index.rtl.css 2.32 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/about.css 1.2 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/admin-empty-state.css 291 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/admin-order-statuses.css 403 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/admin.css 3.56 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/checkout.css 299 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/modal.css 742 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/view-subscription.css 572 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/wcs-upgrade.css 411 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/admin-pointers.js 544 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/admin.js 9.63 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/jstz.js 6.8 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/jstz.min.js 3.83 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/meta-boxes-coupon.js 544 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/meta-boxes-subscription.js 2.38 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/moment.js 22.1 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/moment.min.js 11.6 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/payment-method-restrictions.js 1.29 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/wcs-meta-boxes-order.js 502 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/frontend/payment-methods.js 355 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/frontend/single-product.js 429 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/frontend/view-subscription.js 1.38 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/frontend/wcs-cart.js 781 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/modal.js 1.1 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/wcs-upgrade.js 1.27 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/build/index.css 392 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/build/index.js 3.06 kB

compressed-size-action

Copy link
Member Author

Choose a reason for hiding this comment

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

This UI component <DisputeDueByDate /> is now shared by 3 components on this screen, so I've moved it to it's own component file.

@Jinksi Jinksi requested a review from a team October 4, 2023 04:43
@Jinksi Jinksi marked this pull request as ready for review October 4, 2023 04:43
Copy link
Contributor

@haszari haszari left a comment

Choose a reason for hiding this comment

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

Looks good and I didn't see any major issues in my testing.

I tested:

  • Inquiry due today
  • Inquiry due soon
  • Dispute due soon
  • Regular purchase
Screenshot 2023-10-05 at 10 41 57 AM Inquiry due today

One minor blocker – there's an extra line under the last list item.

Inquiry due today

The other thing I noticed is that the coloured Due soon Due now Past due text is rendered "inside" the sentence, which feels inconsistent to me.

I think that of that highlight as being stamped on to the screen to signal urgency, rather than "inserted" into the copy. So if it was me, I'd move that out, and then the two places on the screen would look more consistent (the one above is not part of a sentence).

Screenshot 2023-10-05 at 10 41 57 AM

However, with this nice new component rendering both values, and a sense of urgency, I only raise this as something to consider in future. @nikkivias FYI, curious for your thoughts

dueByDate: (
<DisputeDueByDate
dueBy={ dispute.evidence_details.due_by }
/>
Copy link
Contributor

Choose a reason for hiding this comment

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

Love the way you've decoupled this into a self-contained component, and simplified props in the process.

),
{
a: (
// eslint-disable-next-line jsx-a11y/anchor-has-content
Copy link
Contributor

Choose a reason for hiding this comment

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

😭

__( '(Past due)', 'woocommerce-payments' ) }
</span>
</span>
<DisputeDueByDate dueBy={ dispute.evidence_details.due_by } />
Copy link
Contributor

Choose a reason for hiding this comment

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

🔥 🚀 🏅

Copy link

@nikkivias nikkivias Oct 10, 2023

Choose a reason for hiding this comment

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

Oh god sorry for the late reply on this I get lost in the Github threads 🥲 please forgive me. I agree with your comment @haszari it should appear more as a stamp instead of an insert in that last bullet point. However! I'm looking at the latest designs, the second [Due in X days] was removed, and the only one that should remain is the one in the dispute details. That's my fault, I didn't specifically call that out in the Figma file. Can we please remove, or do I need to create an issue? @Jinksi

image

On another note, I'm curious as you talk about the extra line at the bottom, why are the buttons not visible here?

image

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we please remove, or do I need to create an issue?

@nikkivias if you can make an issue to get us started we'd really appreciate it! We can handle this as maintenance, should be a relatively painless fix.

On another note, I'm curious as you talk about the extra line at the bottom, why are the buttons not visible here?

I suspect this is an old screenshot from when those specific action buttons were not implemented. Feel free to test and if you see any gaps chat in slack or just make an issue 🙌

client/payment-details/dispute-details/dispute-steps.tsx Outdated Show resolved Hide resolved
@Jinksi Jinksi enabled auto-merge October 4, 2023 23:31
@Jinksi Jinksi added this pull request to the merge queue Oct 4, 2023
Merged via the queue into develop with commit 1ab3115 Oct 4, 2023
26 of 27 checks passed
@Jinksi Jinksi deleted the add/7245-transaction-details-inquiry-steps-to-resolve branch October 4, 2023 23:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants