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

feat: adds button message popup handling for purchase protection #2376

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

danzhaaspaypal
Copy link
Contributor

@danzhaaspaypal danzhaaspaypal commented Apr 17, 2024

Description

Adds feature to have button messages open a popup (or new tab, depending on settings) on click instead of always a modal.

Why are we making these changes? Include references to any related Jira tasks or GitHub Issues

Supporting Purchase Protection messages, which will open a popup in cases where showing credit product presentment is inappropriate.

Reproduction Steps (if applicable)

Test on this demo page

Screenshots (if applicable)

Screenshot 2024-05-15 at 10 38 54 AM

Dependent Changes (if applicable)

Groups who should review (if applicable)

❤️ Thank you!

package.json Outdated Show resolved Hide resolved
src/zoid/buttons/component.jsx Show resolved Hide resolved
@danzhaaspaypal danzhaaspaypal marked this pull request as ready for review May 15, 2024 14:30
@danzhaaspaypal danzhaaspaypal requested a review from a team as a code owner May 15, 2024 14:30
Copy link
Member

@wsbrunson wsbrunson left a comment

Choose a reason for hiding this comment

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

I don't see any issues with this but wanted to ask a question about webviews

is this completely configurable by the merchant? One issue we see with window.open / popups is that they don't work on mobile in-app webviews. Our checkout popup actually renders inline on the page inside of an iframe if it detects that it is in a webview.

not sure if we need to go that far for this popup or if we suggest to merchants to not use that setting if they are using mobile in-app webviews

return window.open(uri, "_blank");
}
} catch (err) {
getLogger()
Copy link
Contributor

Choose a reason for hiding this comment

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

I would suggest adding a fallback logic here to fallback to modal experience if popup fails.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the suggestion @ravishekhar. Sounds like we will be doing some dev work to make a purchase protection modal to address this issue that you and @wsbrunson called out.

Copy link
Contributor

@spencersablan spencersablan left a comment

Choose a reason for hiding this comment

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

Quick find but otherwise lgtm 😄 👾

@@ -451,14 +452,18 @@ describe(`paypal button message`, () => {
});
});

describe("modal", () => {
describe.only("modal", () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this .only left in accidentally? 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

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

😅 indeed, good eye. let me fix that

@Seavenly Seavenly marked this pull request as draft May 20, 2024 18:29
@Seavenly
Copy link
Contributor

Changed back to a draft PR for the time being while the details are worked out internally to address the issue raised about webview popups.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants