started implementing stripe
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{% from "settings/components/connection_modals.html" import connection_modals %}
|
||||
|
||||
{% macro connections_tab(portainer_settings, nginx_settings, site_settings, git_settings, cloudflare_settings) %}
|
||||
{% macro connections_tab(portainer_settings, nginx_settings, site_settings, git_settings, cloudflare_settings, stripe_settings) %}
|
||||
<!-- Meta tags for JavaScript -->
|
||||
<meta name="management-api-key" content="{{ site_settings.management_api_key }}">
|
||||
<meta name="git-settings" content="{{ git_settings|tojson|safe }}">
|
||||
@@ -212,6 +212,67 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Stripe Connection Card -->
|
||||
<div class="col-md-6 mb-4">
|
||||
<div class="card h-100">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h5 class="mb-0">
|
||||
<i class="fab fa-stripe me-2"></i>Stripe Connection
|
||||
</h5>
|
||||
<button class="btn btn-sm btn-outline-primary" onclick="testStripeConnection()">
|
||||
<i class="fas fa-plug me-1"></i>Test Connection
|
||||
</button>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form id="stripeForm" onsubmit="saveStripeConnection(event)">
|
||||
<div class="mb-3">
|
||||
<label for="stripePublishableKey" class="form-label">Publishable Key</label>
|
||||
<input type="text" class="form-control" id="stripePublishableKey" name="stripePublishableKey"
|
||||
placeholder="pk_test_..." required
|
||||
value="{{ stripe_settings.publishable_key if stripe_settings and stripe_settings.publishable_key else '' }}">
|
||||
<div class="form-text">Your Stripe publishable key (starts with pk_test_ or pk_live_)</div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="stripeSecretKey" class="form-label">Secret Key</label>
|
||||
<input type="password" class="form-control" id="stripeSecretKey" name="stripeSecretKey"
|
||||
placeholder="sk_test_..." required
|
||||
value="{{ stripe_settings.secret_key if stripe_settings and stripe_settings.secret_key else '' }}">
|
||||
<div class="form-text">Your Stripe secret key (starts with sk_test_ or sk_live_)</div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="stripeWebhookSecret" class="form-label">Webhook Secret (Optional)</label>
|
||||
<input type="password" class="form-control" id="stripeWebhookSecret" name="stripeWebhookSecret"
|
||||
placeholder="whsec_..."
|
||||
value="{{ stripe_settings.webhook_secret if stripe_settings and stripe_settings.webhook_secret else '' }}">
|
||||
<div class="form-text">Webhook endpoint secret for secure event handling</div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="stripeCustomerPortalUrl" class="form-label">Customer Portal URL</label>
|
||||
<input type="url" class="form-control" id="stripeCustomerPortalUrl" name="stripeCustomerPortalUrl"
|
||||
placeholder="https://billing.stripe.com/p/login/..."
|
||||
value="{{ stripe_settings.customer_portal_url if stripe_settings and stripe_settings.customer_portal_url else '' }}">
|
||||
<div class="form-text">URL for customers to manage their subscriptions and billing</div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="stripeTestMode" name="stripeTestMode"
|
||||
{% if stripe_settings and stripe_settings.test_mode %}checked{% endif %}>
|
||||
<label class="form-check-label" for="stripeTestMode">
|
||||
Test Mode (Use test keys)
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-text">Enable this to use Stripe test mode for development</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-end">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="fas fa-save me-1"></i>Save Stripe Settings
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Save Connection Modal -->
|
||||
|
||||
Reference in New Issue
Block a user