-
Notifications
You must be signed in to change notification settings - Fork 759
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
Move all platform-specific implementations into PlatformFunctions #1679
Conversation
a52996c
to
ef4162c
Compare
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.
Mostly nits + let's try and make the library work without customers providing extra parameters.
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.
...
…ssertion, more specific return type on createStripe
81c80d5
to
45d9d1d
Compare
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.
nits
…tpClient if httpAgent config option is set
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!
Summary
createStripe
andcreateWebhooks
function that takes in platform functions as a parameter, removing the need for a global_platformFunctions
field.create...CryptoProvider
andcreate...HttpClient
intoPlatformFunctions
).a. l removed
createHttpClient
from Stripe and_createCryptoProvider
fromWebhook
, since we can't have a "default" implementation ascreate...CryptoProvider
andcreate...HttpClient
take different types of arguments. The user will have to keep specifyinghttpClient
on the stripe config andcryptoProvider
inconstructEvent
/constructEventAsync
.Testing
Added tests in
PlatformFunctions.spec.ts
and removed no-op tests fromstripe.spec.ts
. Also ran manual end-to-end tests in a Cloudflare Pages Functions and Cloudflare Worker project.