cf: fix stripe api issue by setting httpClient
This commit is contained in:
parent
86f13a1748
commit
19a6c4d994
@ -48,7 +48,13 @@ export class StripeProvider implements PaymentProvider {
|
||||
}
|
||||
|
||||
// Initialize Stripe without specifying apiVersion to use default/latest version
|
||||
this.stripe = new Stripe(apiKey);
|
||||
// https://opennext.js.org/cloudflare/howtos/stripeAPI
|
||||
// When creating a Stripe object, the default http client implementation is based on
|
||||
// node:https which is not implemented on Workers.
|
||||
this.stripe = new Stripe(apiKey, {
|
||||
// Cloudflare Workers use the Fetch API for their API requests.
|
||||
httpClient: Stripe.createFetchHttpClient(),
|
||||
});
|
||||
this.webhookSecret = webhookSecret;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user