[DTPPCPSDK-2824] [DTPRP-1734] [DTPRP-1751] Limit eligible button to Paypal when new createSubscription is used #2456
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR is for this JIRA: https://paypal.atlassian.net/browse/DTPPCPSDK-2824
We need to evaluate 3 conditions to check if we are handling a Full-Stack Subscription (not NextGen Subscription or any other flows like createOrders, createVaultSetupToken, etc).
Condition 1:
createSubscription
callback must have been passed. It cannot beundefined
ornull
.Condition 2:
sdkToken
must have been passed. It cannot beundefined
ornull
.Condition 3:
intent
cannot equal to "subscription".When all 3 conditions have been met, the
isFsSubscription
flag should evaluate totrue
.This is the flag that we use to only display 1 PayPal payment button if it's a Full-Stack Subscription.
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)
Here we can see that only 1 PayPal button is being shown, and nothing else.
Dependent Changes (if applicable)
Groups who should review (if applicable)
❤️ Thank you!