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

[DTPPCPSDK-2824] [DTPRP-1734] [DTPRP-1751] Limit eligible button to Paypal when new createSubscription is used #2456

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

9zees
Copy link
Contributor

@9zees 9zees commented Dec 6, 2024

Description

This PR is for this JIRA: https://paypal.atlassian.net/browse/DTPPCPSDK-2824

FSS = Full Stack subscription
NGS = Next Gen subscription

Goal: When we have FSS, we want to limit the only to PayPal button.
When we have NGS, we need to show all the branded buttons as usual.

NGS requirements:
createSubscription() callback must be passed
onApprove() callback must be passed
intent=subscription must be passed
vault=true must be passed
sdkToken can either be passed or not

FSS requirements:
createSubscription() callback must be passed
onApprove() callback must be passed (for CardFields, unbranded)
No intent=subscription can be passed
vault=true can either be passed or not
sdkToken must be passed and truthy

Screenshots:

Case of NGS:
image

Case of FSS:
image

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

JIRA: https://paypal.atlassian.net/browse/DTPPCPSDK-2824
We are making this change to support the new Fullstack Subscription.

Reproduction Steps (if applicable)

http://localhost.paypal.com:8080/xo-integrations/paypal/subscriptions

Screenshots (if applicable)

(See above)

Dependent Changes (if applicable)

Groups who should review (if applicable)

❤️ Thank you!

@9zees 9zees requested a review from a team as a code owner December 6, 2024 21:48
Copy link

codecov bot commented Dec 6, 2024

Codecov Report

Attention: Patch coverage is 46.87500% with 17 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@f0b5eeb). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/zoid/buttons/component.jsx 5.88% 15 Missing and 1 partial ⚠️
src/ui/buttons/buttons.jsx 92.85% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2456   +/-   ##
=======================================
  Coverage        ?   56.54%           
=======================================
  Files           ?      150           
  Lines           ?    13209           
  Branches        ?      814           
=======================================
  Hits            ?     7469           
  Misses          ?     5638           
  Partials        ?      102           
Flag Coverage Δ
jest 31.50% <75.00%> (?)
karma 54.36% <62.50%> (?)
vitest 51.53% <46.87%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -613,6 +614,16 @@ export const getButtonsComponent: () => ButtonsComponent = memoize(() => {
value: getIntent,
},

isFsSubscription: {
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
Contributor Author

@9zees 9zees Jan 27, 2025

Choose a reason for hiding this comment

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

@ravishekhar @imbrian What new flow should I name it as?

Do we want a way to distinguish the FSS and NGS 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.

We need to differentiate is from existing subscriptions. full_stack_subscription_setup?

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 can do that @imbrian

Copy link
Contributor Author

@9zees 9zees Jan 27, 2025

Choose a reason for hiding this comment

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

@ravishekhar @imbrian I'm noticing that when we use flow, we have to update the config for each funding each time. I can submit this code, but wanted to check once if this is the expected behavior. Thank you.

Right now since we're only enabling the PayPal button, I'm only adding this in the PayPal config:

https://github.com/paypal/paypal-checkout-components/blob/main/src/funding/paypal/config.jsx#L21-L26

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

Successfully merging this pull request may close these issues.

3 participants