-
Notifications
You must be signed in to change notification settings - Fork 260
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
refactor: payment context to follow the new flow of fetching from API #4356
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
Big PR and very critical so we might need to define some new critical flows for purchases, can you maybe set a confluence page up for this? (CC: @idoshamun )
Also would like to have @omBratteng look at it for the IAP stuff.
In general looks ok, minor question around the extension layer.
return duration === PlusPriceType.Yearly ? 0 : 1; | ||
}) | ||
.at(0), | ||
productOptions.find( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering if we should just expose this early adopter package in the context already so it's uniform?
staleTime: StaleTime.Default, | ||
}); | ||
|
||
const giftOneYear = useMemo( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean we could expose the earlyAdopted like this :)
@@ -64,25 +42,25 @@ export const PaddleSubProvider = ({ | |||
eventCallback: (event: PaddleEventData) => { | |||
switch (event?.name) { | |||
case CheckoutEventNames.CHECKOUT_PAYMENT_INITIATED: | |||
logRef.current({ | |||
logRef.current?.({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why these conditionals?
if (checkIsExtension()) { | ||
return <ChromeExtensionProvider>{children}</ChromeExtensionProvider>; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this correct though?
I can actually show prices now right, it just can't handle checkout.
I agree with @rebelchris, this will have to be thoroughly tested and we should define critical flows for payment. We will need it for web funnels as well |
Changes
isTrial ? 'success' : 'help'
, etc.BasePaymentProvider
that will handle common PaymentContextProviders like the one for Paddle and Extension. Most logics are stored from the base provider then any requirements based on platform will be hosted on their respective contexts.earlyAdopterId
prop as it is not being used anymore.StoreKit
provider to fetch the metadata for easier maintenance of metadata.To test this locally, you can simply pull this PR for API until it is merged: dailydotdev/daily-api#2741
After that, everything should work out of the box.
Events
Did you introduce any new tracking events?
Experiment
Did you introduce any new experiments?
Manual Testing
Caution
Please make sure existing components are not breaking/affected by this PR
Jira ticket
MI-853
Preview domain
https://mi-853.preview.app.daily.dev