Tests: Stripe- und Appwrite-Nachbau im Testprozess
getStripe() nutzt in Tests über STRIPE_API_BASE den Nachbau auf 127.0.0.1; in Produktion ist der Wert leer und nichts ändert sich. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
877fde7a6f
commit
54defb75c4
6 files changed
+271
-1
No files matched your search
@@ -30,7 +30,13 @@ export function getStripe() {
|
||||
throw err
|
||||
}
|
||||
if (!stripeClient) {
|
||||
stripeClient = new Stripe(config.stripe.secretKey, { maxNetworkRetries: 2 })
|
||||
const options = { maxNetworkRetries: 2 }
|
||||
// Tests: Stripe-Nachbau auf 127.0.0.1 (config.stripe.apiBase ist in Produktion leer)
|
||||
if (config.stripe.apiBase) {
|
||||
const base = new URL(config.stripe.apiBase)
|
||||
Object.assign(options, { host: base.hostname, port: Number(base.port), protocol: base.protocol.replace(':', '') })
|
||||
}
|
||||
stripeClient = new Stripe(config.stripe.secretKey, options)
|
||||
}
|
||||
return stripeClient
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user