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

Adds ability to edit CheckMo extension Billing Address #3239

Merged
merged 18 commits into from
Jun 28, 2021

Conversation

supernova-at
Copy link
Contributor

@supernova-at supernova-at commented Jun 16, 2021

Description

This PR adds the ability to modify your billing address when you pay with Check / Money Order.

Out of scope are:

  1. The ability to change your selected payment method once selected, and
  2. Billing Address form improvements

both of which I have created internal tickets to address.

Related Issue

Closes PWA-1701.

Acceptance

Verification Stakeholders

Specification

Test Plan

Verification Steps

Test scenario(s) for direct fix/feature

Before performing the following tests, be sure to enable the Check / Money Order extension on your local development storefront by adding the following lines to your venia-concept package.json dependencies section:

    "dependencies": {
        "@magento/venia-sample-payments-checkmo": "link:../extensions/venia-sample-payments-checkmo"
    }
Billing Address Same
  1. Add item to guest cart
  2. Navigate to /checkout page
  3. Fill in Shipping Information and Shipping Methods sections
  4. Select "Check / Money Order" in Payment Information section
  5. Keep "Billing Address same as Shipping" checkbox checked
  6. Verify that "Review Order" button works
  7. Verify that an "Edit" button appears for the Payment Information section
Billing Address Same - Edit
  1. Click to "Edit" your Payment Information
  2. Verify that "Billing Address same as Shipping" is checked
Switch to Alternate Billing Address
  1. Uncheck the "Billing Address same as Shipping" checkbox
  2. Fill in a billing address
  3. Click "Update"
  4. Verify that there are no errors presented and that the edit dialog is dismissed
Billing Address Different - Edit
  1. Click to "Edit" your Payment Information
  2. Verify that "Billing Address same as Shipping" is not checked and that your different billing address is pre-populated in the form
Switch back to Same Billing Address
  1. Re-check the "Billing Address same as Shipping" checkbox
  2. Click "Update"
  3. Verify that there are no errors presented and that the edit dialog is dismissed
Place Order
  1. Verify that you can successfully place an order with a Check / Money Order payment method when the billing address is the same as the shipping address
  2. Verify that you can successfully place an order with a Check / Money Order payment method when the billing address is not the same as the shipping address

Test scenario(s) for any existing impacted features/areas

  1. Authenticated user flow still works
  2. Switching back and forth between "billing address same as shipping" and not does not result in errors
  3. Credit Card / Braintree payment flow still works

Test scenario(s) for any Magento Backend Supported Configurations

The Magento Backend likely needs to enable Check / Money Order payments for the actual placement of orders to succeed.

Is Browser/Device testing needed?

No

Any ad-hoc/edge case scenarios that need to be considered?

No

Screenshots / Screen Captures (if appropriate)

Breaking Changes (if any)

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.

@@ -139,7 +136,11 @@ export const useBillingAddress = props => {
* If billing address is same as shipping address, do
* not auto fill the fields.
*/
if (billingAddressData && !isBillingAddressSame) {
if (isBillingAddressSame) {
return { isBillingAddressSame, ...billingAddress };
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I really only changed this to match the comment above.

yarn.lock Outdated Show resolved Hide resolved
@PWAStudioBot
Copy link
Contributor

PWAStudioBot commented Jun 16, 2021

Messages
📖

Associated JIRA tickets: PWA-1701.

📖 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 162b91f

@supernova-at supernova-at added the version: Minor This changeset includes functionality added in a backwards compatible manner. label Jun 21, 2021
@larsroettig larsroettig self-requested a review June 22, 2021 16:48
onPaymentSuccess,
onPaymentError
});
} = useCheckmo(props);
Copy link
Member

@larsroettig larsroettig Jun 23, 2021

Choose a reason for hiding this comment

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

Nice catch

larsroettig
larsroettig previously approved these changes Jun 23, 2021
@larsroettig
Copy link
Member

Looks good to send to QA would nice if you can cover new code with tests

@supernova-at
Copy link
Contributor Author

supernova-at commented Jun 23, 2021

Coverage

File % Stmts % Branch % Funcs % Lines Uncovered Line #s
venia-sample-payments-checkmo/src/components 100 100 100 100
checkmo.js 100 100 100 100
edit.js 100 100 100 100
summary.js 100 100 100 100
venia-sample-payments-checkmo/src/talons 100 100 100 100
checkmo.gql.js 100 100 100 100
useCheckmo.js 100 100 100 100
useBillingAddress.js 92.42 70.59 100 92.42 41,262-269

✅ Addressed in 3b17d56.

@tjwiebell
Copy link
Contributor

This is QA Passed ✅ but had one UX observation. First time I've seen multiple payment options, but the grid looks a little off when there are. Doesn't appear to have been introduced in your PR, so I'll create a bug and we can confirm with product if we should fix before release.

Screen Shot 2021-06-28 at 5 31 51 PM

Copy link
Contributor

@tjwiebell tjwiebell left a comment

Choose a reason for hiding this comment

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

Re-approving after fixing merge conflict.

@tjwiebell tjwiebell merged commit 7c8b1d2 into develop Jun 28, 2021
@tjwiebell tjwiebell deleted the supernova/1701_edit_billing branch June 28, 2021 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg:extensions pkg:peregrine pkg:venia-concept pkg:venia-ui Progress: done version: Minor This changeset includes functionality added in a backwards compatible manner.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants