@dotted-labs/ngx-supabase-stripe 0.1.9 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/database.types.d.ts +129 -2
- package/fesm2022/dotted-labs-ngx-supabase-stripe.mjs +71 -75
- package/fesm2022/dotted-labs-ngx-supabase-stripe.mjs.map +1 -1
- package/lib/components/customer/subscriptions/subscriptions-list/subscription-item/subscription-item.component.d.ts +1 -1
- package/lib/components/embedded-subscription/embedded-subscription.component.d.ts +1 -1
- package/lib/components/embedded-subscription/return-page/subscription-return-page.component.d.ts +1 -1
- package/lib/config/supabase.config.d.ts +4 -0
- package/lib/services/supabase-client.service.d.ts +766 -14
- package/lib/store/subscriptions.store.d.ts +2 -1
- package/package.json +1 -1
- package/public-api.d.ts +2 -3
package/database.types.d.ts
CHANGED
|
@@ -354,7 +354,134 @@ export type Database = {
|
|
|
354
354
|
[_ in never]: never;
|
|
355
355
|
};
|
|
356
356
|
Functions: {
|
|
357
|
-
|
|
357
|
+
get_stripe_checkout_session: {
|
|
358
|
+
Args: {
|
|
359
|
+
session_id: string;
|
|
360
|
+
};
|
|
361
|
+
Returns: {
|
|
362
|
+
id: string;
|
|
363
|
+
customer: string;
|
|
364
|
+
payment_intent: string;
|
|
365
|
+
subscription: string;
|
|
366
|
+
attrs: Json;
|
|
367
|
+
}[];
|
|
368
|
+
};
|
|
369
|
+
get_stripe_community_products: {
|
|
370
|
+
Args: {
|
|
371
|
+
p_community_id: string;
|
|
372
|
+
};
|
|
373
|
+
Returns: {
|
|
374
|
+
id: string;
|
|
375
|
+
name: string;
|
|
376
|
+
description: string;
|
|
377
|
+
price: number;
|
|
378
|
+
image_url: string;
|
|
379
|
+
video: string;
|
|
380
|
+
payment_provider_product_id: string;
|
|
381
|
+
created_at: string;
|
|
382
|
+
updated_at: string;
|
|
383
|
+
}[];
|
|
384
|
+
};
|
|
385
|
+
get_stripe_customer: {
|
|
386
|
+
Args: {
|
|
387
|
+
customer_email: string;
|
|
388
|
+
};
|
|
389
|
+
Returns: {
|
|
390
|
+
id: string;
|
|
391
|
+
email: string;
|
|
392
|
+
name: string;
|
|
393
|
+
description: string;
|
|
394
|
+
created: string;
|
|
395
|
+
attrs: Json;
|
|
396
|
+
}[];
|
|
397
|
+
};
|
|
398
|
+
get_stripe_customer_payment_intents: {
|
|
399
|
+
Args: {
|
|
400
|
+
customer_id: string;
|
|
401
|
+
};
|
|
402
|
+
Returns: {
|
|
403
|
+
id: string;
|
|
404
|
+
customer: string;
|
|
405
|
+
amount: number;
|
|
406
|
+
currency: string;
|
|
407
|
+
payment_method: string;
|
|
408
|
+
created: string;
|
|
409
|
+
attrs: Json;
|
|
410
|
+
}[];
|
|
411
|
+
};
|
|
412
|
+
get_stripe_customer_subscriptions: {
|
|
413
|
+
Args: {
|
|
414
|
+
customer_id: string;
|
|
415
|
+
};
|
|
416
|
+
Returns: {
|
|
417
|
+
id: string;
|
|
418
|
+
customer: string;
|
|
419
|
+
currency: string;
|
|
420
|
+
current_period_start: string;
|
|
421
|
+
current_period_end: string;
|
|
422
|
+
attrs: Json;
|
|
423
|
+
}[];
|
|
424
|
+
};
|
|
425
|
+
get_stripe_prices: {
|
|
426
|
+
Args: Record<PropertyKey, never>;
|
|
427
|
+
Returns: {
|
|
428
|
+
id: string;
|
|
429
|
+
active: boolean;
|
|
430
|
+
currency: string;
|
|
431
|
+
product: string;
|
|
432
|
+
unit_amount: number;
|
|
433
|
+
type: string;
|
|
434
|
+
attrs: Json;
|
|
435
|
+
}[];
|
|
436
|
+
};
|
|
437
|
+
get_stripe_product: {
|
|
438
|
+
Args: {
|
|
439
|
+
product_id: string;
|
|
440
|
+
};
|
|
441
|
+
Returns: {
|
|
442
|
+
id: string;
|
|
443
|
+
name: string;
|
|
444
|
+
active: boolean;
|
|
445
|
+
default_price: string;
|
|
446
|
+
description: string;
|
|
447
|
+
attrs: Json;
|
|
448
|
+
}[];
|
|
449
|
+
};
|
|
450
|
+
get_stripe_products: {
|
|
451
|
+
Args: Record<PropertyKey, never>;
|
|
452
|
+
Returns: {
|
|
453
|
+
id: string;
|
|
454
|
+
name: string;
|
|
455
|
+
active: boolean;
|
|
456
|
+
default_price: string;
|
|
457
|
+
description: string;
|
|
458
|
+
attrs: Json;
|
|
459
|
+
}[];
|
|
460
|
+
};
|
|
461
|
+
get_stripe_subscription: {
|
|
462
|
+
Args: {
|
|
463
|
+
subscription_id: string;
|
|
464
|
+
};
|
|
465
|
+
Returns: {
|
|
466
|
+
id: string;
|
|
467
|
+
customer: string;
|
|
468
|
+
currency: string;
|
|
469
|
+
current_period_start: string;
|
|
470
|
+
current_period_end: string;
|
|
471
|
+
attrs: Json;
|
|
472
|
+
}[];
|
|
473
|
+
};
|
|
474
|
+
get_stripe_subscriptions: {
|
|
475
|
+
Args: Record<PropertyKey, never>;
|
|
476
|
+
Returns: {
|
|
477
|
+
id: string;
|
|
478
|
+
customer: string;
|
|
479
|
+
currency: string;
|
|
480
|
+
current_period_start: string;
|
|
481
|
+
current_period_end: string;
|
|
482
|
+
attrs: Json;
|
|
483
|
+
}[];
|
|
484
|
+
};
|
|
358
485
|
};
|
|
359
486
|
Enums: {
|
|
360
487
|
[_ in never]: never;
|
|
@@ -364,7 +491,7 @@ export type Database = {
|
|
|
364
491
|
};
|
|
365
492
|
};
|
|
366
493
|
};
|
|
367
|
-
type DefaultSchema = Database[Extract<keyof Database, "public">];
|
|
494
|
+
type DefaultSchema = Database[Extract<keyof Database, "public" | "stripe">];
|
|
368
495
|
export type Tables<DefaultSchemaTableNameOrOptions extends keyof (DefaultSchema["Tables"] & DefaultSchema["Views"]) | {
|
|
369
496
|
schema: keyof Database;
|
|
370
497
|
}, TableName extends DefaultSchemaTableNameOrOptions extends {
|
|
@@ -85,7 +85,7 @@ class SupabaseClientService {
|
|
|
85
85
|
*/
|
|
86
86
|
async selectCheckoutSession(sessionId) {
|
|
87
87
|
return this.client
|
|
88
|
-
.schema(
|
|
88
|
+
.schema(this.config.supabaseSchema)
|
|
89
89
|
.rpc('get_stripe_checkout_session', { session_id: sessionId })
|
|
90
90
|
.select('*')
|
|
91
91
|
.single();
|
|
@@ -98,7 +98,7 @@ class SupabaseClientService {
|
|
|
98
98
|
*/
|
|
99
99
|
getStripeSubscriptions() {
|
|
100
100
|
return this.client
|
|
101
|
-
.schema(
|
|
101
|
+
.schema(this.config.supabaseSchema)
|
|
102
102
|
.rpc('get_stripe_subscriptions')
|
|
103
103
|
.select('*');
|
|
104
104
|
}
|
|
@@ -108,7 +108,7 @@ class SupabaseClientService {
|
|
|
108
108
|
*/
|
|
109
109
|
selectStripeSubscription(subscriptionId) {
|
|
110
110
|
return this.client
|
|
111
|
-
.schema(
|
|
111
|
+
.schema(this.config.supabaseSchema)
|
|
112
112
|
.rpc('get_stripe_subscription', { subscription_id: subscriptionId })
|
|
113
113
|
.select('*');
|
|
114
114
|
}
|
|
@@ -121,7 +121,7 @@ class SupabaseClientService {
|
|
|
121
121
|
*/
|
|
122
122
|
async selectStripePrices() {
|
|
123
123
|
return this.client
|
|
124
|
-
.schema(
|
|
124
|
+
.schema(this.config.supabaseSchema)
|
|
125
125
|
.rpc('get_stripe_prices')
|
|
126
126
|
.select('*');
|
|
127
127
|
}
|
|
@@ -134,7 +134,7 @@ class SupabaseClientService {
|
|
|
134
134
|
*/
|
|
135
135
|
async selectStripeProducts() {
|
|
136
136
|
return this.client
|
|
137
|
-
.schema(
|
|
137
|
+
.schema(this.config.supabaseSchema)
|
|
138
138
|
.rpc('get_stripe_products')
|
|
139
139
|
.select('*');
|
|
140
140
|
}
|
|
@@ -144,7 +144,7 @@ class SupabaseClientService {
|
|
|
144
144
|
*/
|
|
145
145
|
async selectStripeProduct(productId) {
|
|
146
146
|
return this.client
|
|
147
|
-
.schema(
|
|
147
|
+
.schema(this.config.supabaseSchema)
|
|
148
148
|
.rpc('get_stripe_product', { product_id: productId })
|
|
149
149
|
.select('*');
|
|
150
150
|
}
|
|
@@ -171,7 +171,7 @@ class SupabaseClientService {
|
|
|
171
171
|
* @param email The customer email
|
|
172
172
|
*/
|
|
173
173
|
async getCustomerByEmail(email) {
|
|
174
|
-
return this.client.schema(
|
|
174
|
+
return this.client.schema(this.config.supabaseSchema).rpc('get_stripe_customer', { customer_email: email });
|
|
175
175
|
}
|
|
176
176
|
/**
|
|
177
177
|
* Get customer payment intents
|
|
@@ -179,7 +179,7 @@ class SupabaseClientService {
|
|
|
179
179
|
*/
|
|
180
180
|
async getCustomerPaymentIntents(customerId) {
|
|
181
181
|
return this.client
|
|
182
|
-
.schema(
|
|
182
|
+
.schema(this.config.supabaseSchema)
|
|
183
183
|
.rpc('get_stripe_customer_payment_intents', { customer_id: customerId })
|
|
184
184
|
.select('*');
|
|
185
185
|
}
|
|
@@ -189,7 +189,7 @@ class SupabaseClientService {
|
|
|
189
189
|
*/
|
|
190
190
|
async getCustomerSubscriptions(customerId) {
|
|
191
191
|
return this.client
|
|
192
|
-
.schema(
|
|
192
|
+
.schema(this.config.supabaseSchema)
|
|
193
193
|
.rpc('get_stripe_customer_subscriptions', { customer_id: customerId })
|
|
194
194
|
.select('*');
|
|
195
195
|
}
|
|
@@ -717,13 +717,9 @@ const SubscriptionsStore = signalStore({ providedIn: 'root' }, withState(initial
|
|
|
717
717
|
* Create a subscription
|
|
718
718
|
* @param priceId The price ID for the subscription
|
|
719
719
|
*/
|
|
720
|
-
async createSubscription(priceId, returnPath,
|
|
720
|
+
async createSubscription(priceId, returnPath, customer) {
|
|
721
721
|
patchState(store, { status: 'loading', error: null });
|
|
722
722
|
try {
|
|
723
|
-
let customer = null;
|
|
724
|
-
if (customerEmail) {
|
|
725
|
-
customer = customerStore.customer().data;
|
|
726
|
-
}
|
|
727
723
|
const { clientSecret, error } = await stripeService.createSubscription(priceId, returnPath, customer);
|
|
728
724
|
console.log('🔍 [SubscriptionsStore] created subscription', clientSecret, error);
|
|
729
725
|
if (error) {
|
|
@@ -1316,7 +1312,7 @@ class EmbeddedSubscriptionComponent {
|
|
|
1316
1312
|
createSubscription() {
|
|
1317
1313
|
const baseUrl = window.location.origin;
|
|
1318
1314
|
const returnPath = `${baseUrl}${this.returnPagePath()}`;
|
|
1319
|
-
this.subscriptionsStore.createSubscription(this.priceId(), returnPath, this.customer()
|
|
1315
|
+
this.subscriptionsStore.createSubscription(this.priceId(), returnPath, this.customer());
|
|
1320
1316
|
}
|
|
1321
1317
|
ngOnDestroy() {
|
|
1322
1318
|
this.subscriptionsStore.destroyEmbeddedSubscription();
|
|
@@ -1361,6 +1357,65 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImpor
|
|
|
1361
1357
|
args: [{ selector: 'lib-subscription-return-page', standalone: true, imports: [CommonModule], template: "<div class=\"flex justify-center min-h-screen bg-gradient-to-br from-blue-50 to-indigo-100 p-4\">\n <div class=\"hero-content text-center max-w-md\">\n <div class=\"card w-full bg-base-100 shadow-2xl\">\n <div class=\"card-body items-center text-center\">\n <!-- Success Icon -->\n <div class=\"mb-6\">\n <div class=\"avatar\">\n <div class=\"w-24 h-24 rounded-full bg-success/10 flex items-center justify-center\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"h-full w-full text-success\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z\"\n />\n </svg>\n </div>\n </div>\n </div>\n\n <!-- Status Content -->\n @if (checkoutStore.isStatusLoading()) {\n <div class=\"flex flex-col items-center gap-4 mb-6\">\n <span class=\"loading loading-spinner loading-lg text-primary\"></span>\n <div class=\"alert alert-info\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" class=\"stroke-current shrink-0 w-6 h-6\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z\"></path>\n </svg>\n <span>Cargando detalles de la suscripci\u00F3n...</span>\n </div>\n </div>\n } @else if (checkoutStore.isStatusError()) {\n <div class=\"alert alert-error mb-6\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" class=\"stroke-current shrink-0 h-6 w-6\" fill=\"none\" viewBox=\"0 0 24 24\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z\" />\n </svg>\n <span>{{ subscriptionsStore.error() }}</span>\n </div>\n } @else if (checkoutStore.isPaymentComplete()) {\n\n <!-- Title and Description -->\n <h2 class=\"card-title text-3xl font-bold text-base-content mb-2\">{{ sessionStatus()?.amount_total }}</h2>\n\n <div class=\"alert alert-success mb-6\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" class=\"stroke-current shrink-0 h-6 w-6\" fill=\"none\" viewBox=\"0 0 24 24\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z\" />\n </svg>\n <span class=\"font-medium\">Tu suscripci\u00F3n est\u00E1 activa y lista para usar.</span>\n </div>\n\n <div class=\"bg-base-200 rounded-lg p-4 mb-6 w-full\">\n <h3 class=\"font-semibold text-sm text-base-content/80 mb-3\">Beneficios incluidos:</h3>\n <ul class=\"space-y-2\">\n <li class=\"flex items-center text-sm\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" class=\"h-4 w-4 text-success mr-2\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M5 13l4 4L19 7\" />\n </svg>\n Acceso completo a todas las funciones\n </li>\n <li class=\"flex items-center text-sm\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" class=\"h-4 w-4 text-success mr-2\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M5 13l4 4L19 7\" />\n </svg>\n Soporte prioritario 24/7\n </li>\n <li class=\"flex items-center text-sm\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" class=\"h-4 w-4 text-success mr-2\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M5 13l4 4L19 7\" />\n </svg>\n Actualizaciones autom\u00E1ticas\n </li>\n </ul>\n </div>\n }\n\n <!-- Action Buttons -->\n <div class=\"card-actions justify-center w-full\">\n <button class=\"btn btn-primary btn-wide\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" class=\"h-5 w-5 mr-2\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\"\n d=\"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6\"\n />\n </svg>\n Ir al Panel Principal\n </button>\n </div>\n\n <!-- Additional Help -->\n <div class=\"text-center mt-4\">\n <p class=\"text-xs text-base-content/50\">\n \u00BFNecesitas ayuda?\n <a href=\"#\" class=\"link link-primary\">Contacta soporte</a>\n </p>\n </div>\n </div>\n </div>\n </div>\n</div>" }]
|
|
1362
1358
|
}] });
|
|
1363
1359
|
|
|
1360
|
+
class PaymentIntentsTableComponent {
|
|
1361
|
+
paymentIntents = input.required();
|
|
1362
|
+
paymentIntentsTable = computed(() => {
|
|
1363
|
+
return this.paymentIntents().map(paymentIntent => ({
|
|
1364
|
+
...paymentIntent,
|
|
1365
|
+
selected: false
|
|
1366
|
+
}));
|
|
1367
|
+
});
|
|
1368
|
+
loading = input(false);
|
|
1369
|
+
error = input(null);
|
|
1370
|
+
withControls = input(true);
|
|
1371
|
+
exportSelected = output();
|
|
1372
|
+
onRefresh = output();
|
|
1373
|
+
utils = inject(UtilsService);
|
|
1374
|
+
hasPaymentIntents = computed(() => this.paymentIntents() && this.paymentIntents().length > 0);
|
|
1375
|
+
trackByPaymentIntentId = (index, item) => item.id;
|
|
1376
|
+
refreshPaymentIntents() {
|
|
1377
|
+
this.onRefresh.emit();
|
|
1378
|
+
}
|
|
1379
|
+
allPaymentIntentsSelected() {
|
|
1380
|
+
return this.paymentIntentsTable().every(paymentIntent => paymentIntent.selected);
|
|
1381
|
+
}
|
|
1382
|
+
somePaymentIntentsSelected() {
|
|
1383
|
+
return this.paymentIntentsTable().some(paymentIntent => paymentIntent.selected);
|
|
1384
|
+
}
|
|
1385
|
+
toggleAllPaymentIntents(event) {
|
|
1386
|
+
const checkbox = event.target;
|
|
1387
|
+
const isChecked = checkbox.checked;
|
|
1388
|
+
this.paymentIntentsTable().forEach(paymentIntent => {
|
|
1389
|
+
paymentIntent.selected = isChecked;
|
|
1390
|
+
});
|
|
1391
|
+
}
|
|
1392
|
+
togglePaymentIntent(event, id) {
|
|
1393
|
+
const checkbox = event.target;
|
|
1394
|
+
const isChecked = checkbox.checked;
|
|
1395
|
+
const paymentIntent = this.paymentIntentsTable().find(paymentIntent => paymentIntent.id === id);
|
|
1396
|
+
if (paymentIntent) {
|
|
1397
|
+
paymentIntent.selected = isChecked;
|
|
1398
|
+
}
|
|
1399
|
+
}
|
|
1400
|
+
showDetails(id) {
|
|
1401
|
+
const modalElement = document.getElementById(`modal-${id}`);
|
|
1402
|
+
if (modalElement) {
|
|
1403
|
+
modalElement.showModal();
|
|
1404
|
+
}
|
|
1405
|
+
}
|
|
1406
|
+
exportSelectedPaymentIntents() {
|
|
1407
|
+
this.exportSelected.emit(this.paymentIntentsTable().filter(paymentIntent => paymentIntent.selected));
|
|
1408
|
+
}
|
|
1409
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: PaymentIntentsTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1410
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.5", type: PaymentIntentsTableComponent, isStandalone: true, selector: "lib-payment-intents-table", inputs: { paymentIntents: { classPropertyName: "paymentIntents", publicName: "paymentIntents", isSignal: true, isRequired: true, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, withControls: { classPropertyName: "withControls", publicName: "withControls", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { exportSelected: "exportSelected", onRefresh: "onRefresh" }, ngImport: i0, template: "<div class=\"payment-intents-container\">\n @if (withControls()) {\n <div class=\"controls mb-4 flex justify-between items-center\">\n <div class=\"stats\">\n @if (hasPaymentIntents()) {\n <span class=\"badge badge-soft badge-info\">{{ paymentIntentsTable().length }} payment intents</span>\n }\n </div>\n <div class=\"flex justify-end items-center gap-2\">\n <button class=\"btn btn-sm btn-outline\" (click)=\"refreshPaymentIntents()\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" class=\"h-4 w-4 mr-1\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15\" />\n </svg>\n Actualizar\n </button>\n <button class=\"btn btn-sm btn-primary\" [disabled]=\"!somePaymentIntentsSelected()\" (click)=\"exportSelectedPaymentIntents()\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M8.71 7.71L11 5.41V15a1 1 0 0 0 2 0V5.41l2.29 2.3a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.42l-4-4a1 1 0 0 0-.33-.21a1 1 0 0 0-.76 0a1 1 0 0 0-.33.21l-4 4a1 1 0 1 0 1.42 1.42M21 14a1 1 0 0 0-1 1v4a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-4a1 1 0 0 0-2 0v4a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3v-4a1 1 0 0 0-1-1\"/></svg>\n Export Selected\n </button>\n </div>\n </div>\n }\n\n @if (loading()) {\n <div class=\"overflow-x-auto\">\n <div class=\"skeleton h-32 w-full\"></div>\n </div>\n } @else if (error()) {\n <div class=\"error-container\">\n <div class=\"alert alert-error\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" class=\"stroke-current shrink-0 h-6 w-6\" fill=\"none\" viewBox=\"0 0 24 24\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z\" /></svg>\n <span>{{ error() }}</span>\n </div>\n </div>\n } @else if (hasPaymentIntents()) {\n <div class=\"overflow-x-auto rounded-box border border-base-content/5 bg-base-100\">\n <table class=\"table table-zebra\">\n <!-- head -->\n <thead>\n <tr>\n <th>\n <label>\n <input type=\"checkbox\" class=\"checkbox\" (change)=\"toggleAllPaymentIntents($event)\" [checked]=\"allPaymentIntentsSelected()\" />\n </label>\n </th>\n <th>Amount</th>\n <th>Payment Method</th>\n <th>Status</th>\n <th>Mode</th>\n <th></th>\n </tr>\n </thead>\n <tbody>\n @for (paymentIntent of paymentIntentsTable(); track trackByPaymentIntentId(0, paymentIntent)) {\n <tr>\n <th>\n <label>\n <input type=\"checkbox\" class=\"checkbox\" (change)=\"togglePaymentIntent($event, paymentIntent.id ?? '')\" [checked]=\"paymentIntent.selected\" />\n </label>\n </th>\n <td>{{ utils.formatAmount(paymentIntent.amount ?? 0, paymentIntent.currency ?? 'EUR') }}</td>\n <td>\n <span class=\"badge badge-outline\">\n {{ paymentIntent.paymentMethodId }}\n </span>\n </td>\n <td>\n <span class=\"badge badge-soft {{ utils.getStatusBadgeClass(paymentIntent.status) }}\">\n {{ paymentIntent.status}}\n </span>\n </td>\n <td>{{ paymentIntent.liveMode ? 'Live' : 'Test' }}</td>\n <td>\n <button class=\"btn btn-xs btn-ghost\" (click)=\"showDetails(paymentIntent.id ?? '')\">\n Details\n </button>\n <dialog id=\"modal-{{ paymentIntent.id }}\" class=\"modal\">\n <div class=\"modal-box\">\n <h3 class=\"font-bold text-lg\">Payment Intent Details</h3>\n <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4 mt-4\">\n <div>\n <h4 class=\"text-md font-semibold mb-2\">Payment Details</h4>\n <ul class=\"space-y-1 text-sm\">\n <li><span class=\"font-medium\">Full ID:</span> {{ paymentIntent.id }}</li>\n <li><span class=\"font-medium\">Payment Method:</span> {{ paymentIntent.paymentMethodId }}</li>\n <li><span class=\"font-medium\">Confirmation Method:</span> {{ paymentIntent.confirmationMethod }}</li>\n @if (paymentIntent.invoiceId) {\n <li><span class=\"font-medium\">Invoice ID:</span> {{ paymentIntent.invoiceId }}</li>\n }\n </ul>\n </div>\n <div>\n <h4 class=\"text-md font-semibold mb-2\">Status Information</h4>\n <ul class=\"space-y-1 text-sm\">\n <li>\n <span class=\"font-medium\">Status: </span> \n <span class=\"badge badge-soft {{ utils.getStatusBadgeClass(paymentIntent.status) }}\">\n {{ paymentIntent.status }}\n </span>\n </li>\n <li><span class=\"font-medium\">Mode: </span> {{ paymentIntent.liveMode ? 'Production' : 'Test' }}</li>\n <li><span class=\"font-medium\">Amount: </span> {{ utils.formatAmount(paymentIntent.amount ?? 0, paymentIntent.currency ?? 'EUR') }}</li>\n </ul>\n </div>\n </div>\n <div class=\"modal-action\">\n <form method=\"dialog\">\n <button class=\"btn\">Close</button>\n </form>\n </div>\n </div>\n </dialog>\n </td>\n </tr>\n }\n </tbody>\n </table>\n </div>\n } @else {\n <div class=\"empty-state\">\n <div class=\"card bg-base-100 shadow-sm\">\n <div class=\"card-body items-center text-center\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" class=\"h-12 w-12 text-gray-400 mb-4\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z\" />\n </svg>\n <h2 class=\"card-title text-xl\">No recent payment intents</h2>\n <p class=\"text-gray-600\">No payment intents found in your history.</p>\n </div>\n </div>\n </div>\n }\n</div> ", dependencies: [{ kind: "ngmodule", type: CommonModule }] });
|
|
1411
|
+
}
|
|
1412
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: PaymentIntentsTableComponent, decorators: [{
|
|
1413
|
+
type: Component,
|
|
1414
|
+
args: [{ selector: 'lib-payment-intents-table', standalone: true, imports: [
|
|
1415
|
+
CommonModule
|
|
1416
|
+
], template: "<div class=\"payment-intents-container\">\n @if (withControls()) {\n <div class=\"controls mb-4 flex justify-between items-center\">\n <div class=\"stats\">\n @if (hasPaymentIntents()) {\n <span class=\"badge badge-soft badge-info\">{{ paymentIntentsTable().length }} payment intents</span>\n }\n </div>\n <div class=\"flex justify-end items-center gap-2\">\n <button class=\"btn btn-sm btn-outline\" (click)=\"refreshPaymentIntents()\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" class=\"h-4 w-4 mr-1\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15\" />\n </svg>\n Actualizar\n </button>\n <button class=\"btn btn-sm btn-primary\" [disabled]=\"!somePaymentIntentsSelected()\" (click)=\"exportSelectedPaymentIntents()\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M8.71 7.71L11 5.41V15a1 1 0 0 0 2 0V5.41l2.29 2.3a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.42l-4-4a1 1 0 0 0-.33-.21a1 1 0 0 0-.76 0a1 1 0 0 0-.33.21l-4 4a1 1 0 1 0 1.42 1.42M21 14a1 1 0 0 0-1 1v4a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-4a1 1 0 0 0-2 0v4a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3v-4a1 1 0 0 0-1-1\"/></svg>\n Export Selected\n </button>\n </div>\n </div>\n }\n\n @if (loading()) {\n <div class=\"overflow-x-auto\">\n <div class=\"skeleton h-32 w-full\"></div>\n </div>\n } @else if (error()) {\n <div class=\"error-container\">\n <div class=\"alert alert-error\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" class=\"stroke-current shrink-0 h-6 w-6\" fill=\"none\" viewBox=\"0 0 24 24\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z\" /></svg>\n <span>{{ error() }}</span>\n </div>\n </div>\n } @else if (hasPaymentIntents()) {\n <div class=\"overflow-x-auto rounded-box border border-base-content/5 bg-base-100\">\n <table class=\"table table-zebra\">\n <!-- head -->\n <thead>\n <tr>\n <th>\n <label>\n <input type=\"checkbox\" class=\"checkbox\" (change)=\"toggleAllPaymentIntents($event)\" [checked]=\"allPaymentIntentsSelected()\" />\n </label>\n </th>\n <th>Amount</th>\n <th>Payment Method</th>\n <th>Status</th>\n <th>Mode</th>\n <th></th>\n </tr>\n </thead>\n <tbody>\n @for (paymentIntent of paymentIntentsTable(); track trackByPaymentIntentId(0, paymentIntent)) {\n <tr>\n <th>\n <label>\n <input type=\"checkbox\" class=\"checkbox\" (change)=\"togglePaymentIntent($event, paymentIntent.id ?? '')\" [checked]=\"paymentIntent.selected\" />\n </label>\n </th>\n <td>{{ utils.formatAmount(paymentIntent.amount ?? 0, paymentIntent.currency ?? 'EUR') }}</td>\n <td>\n <span class=\"badge badge-outline\">\n {{ paymentIntent.paymentMethodId }}\n </span>\n </td>\n <td>\n <span class=\"badge badge-soft {{ utils.getStatusBadgeClass(paymentIntent.status) }}\">\n {{ paymentIntent.status}}\n </span>\n </td>\n <td>{{ paymentIntent.liveMode ? 'Live' : 'Test' }}</td>\n <td>\n <button class=\"btn btn-xs btn-ghost\" (click)=\"showDetails(paymentIntent.id ?? '')\">\n Details\n </button>\n <dialog id=\"modal-{{ paymentIntent.id }}\" class=\"modal\">\n <div class=\"modal-box\">\n <h3 class=\"font-bold text-lg\">Payment Intent Details</h3>\n <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4 mt-4\">\n <div>\n <h4 class=\"text-md font-semibold mb-2\">Payment Details</h4>\n <ul class=\"space-y-1 text-sm\">\n <li><span class=\"font-medium\">Full ID:</span> {{ paymentIntent.id }}</li>\n <li><span class=\"font-medium\">Payment Method:</span> {{ paymentIntent.paymentMethodId }}</li>\n <li><span class=\"font-medium\">Confirmation Method:</span> {{ paymentIntent.confirmationMethod }}</li>\n @if (paymentIntent.invoiceId) {\n <li><span class=\"font-medium\">Invoice ID:</span> {{ paymentIntent.invoiceId }}</li>\n }\n </ul>\n </div>\n <div>\n <h4 class=\"text-md font-semibold mb-2\">Status Information</h4>\n <ul class=\"space-y-1 text-sm\">\n <li>\n <span class=\"font-medium\">Status: </span> \n <span class=\"badge badge-soft {{ utils.getStatusBadgeClass(paymentIntent.status) }}\">\n {{ paymentIntent.status }}\n </span>\n </li>\n <li><span class=\"font-medium\">Mode: </span> {{ paymentIntent.liveMode ? 'Production' : 'Test' }}</li>\n <li><span class=\"font-medium\">Amount: </span> {{ utils.formatAmount(paymentIntent.amount ?? 0, paymentIntent.currency ?? 'EUR') }}</li>\n </ul>\n </div>\n </div>\n <div class=\"modal-action\">\n <form method=\"dialog\">\n <button class=\"btn\">Close</button>\n </form>\n </div>\n </div>\n </dialog>\n </td>\n </tr>\n }\n </tbody>\n </table>\n </div>\n } @else {\n <div class=\"empty-state\">\n <div class=\"card bg-base-100 shadow-sm\">\n <div class=\"card-body items-center text-center\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" class=\"h-12 w-12 text-gray-400 mb-4\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z\" />\n </svg>\n <h2 class=\"card-title text-xl\">No recent payment intents</h2>\n <p class=\"text-gray-600\">No payment intents found in your history.</p>\n </div>\n </div>\n </div>\n }\n</div> " }]
|
|
1417
|
+
}] });
|
|
1418
|
+
|
|
1364
1419
|
class SubscriptionItemSkeletonComponent {
|
|
1365
1420
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: SubscriptionItemSkeletonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1366
1421
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: SubscriptionItemSkeletonComponent, isStandalone: true, selector: "lib-subscription-item-skeleton", ngImport: i0, template: "<div class=\"card bg-base-100 shadow-sm\">\n <div class=\"card-body p-4\">\n <div class=\"flex justify-between\">\n <div>\n <div class=\"flex items-center gap-2\">\n <div class=\"skeleton h-6 w-32\"></div>\n <div class=\"skeleton h-5 w-20\"></div>\n </div>\n <div class=\"skeleton h-4 w-48 mt-2\"></div>\n </div>\n \n <div class=\"flex gap-2\">\n <div class=\"skeleton h-8 w-20\"></div>\n </div>\n </div>\n\n <div class=\"mt-2\">\n <div class=\"flex justify-between text-sm\">\n <div class=\"skeleton h-4 w-32\"></div>\n <div class=\"skeleton h-4 w-32\"></div>\n </div>\n </div>\n\n <!--<div class=\"mt-4 border-t pt-4\">\n <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n <div>\n <div class=\"skeleton h-5 w-24 mb-2\"></div>\n <div class=\"space-y-1\">\n <div class=\"skeleton h-4 w-full\"></div>\n <div class=\"skeleton h-4 w-full\"></div>\n <div class=\"skeleton h-4 w-3/4\"></div>\n </div>\n </div>\n \n <div>\n <div class=\"skeleton h-5 w-24 mb-2\"></div>\n <div class=\"space-y-1\">\n <div class=\"skeleton h-4 w-full\"></div>\n <div class=\"skeleton h-4 w-3/4\"></div>\n </div>\n </div>\n </div>\n \n <div class=\"card-actions mt-4 justify-end\">\n <div class=\"skeleton h-8 w-32\"></div>\n </div>\n </div>-->\n </div>\n</div>", dependencies: [{ kind: "ngmodule", type: CommonModule }] });
|
|
@@ -1543,65 +1598,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImpor
|
|
|
1543
1598
|
], template: "<div class=\"payment-intents-container\">\n @if (withControls()) {\n <div class=\"controls mb-4 flex justify-between items-center\">\n <div class=\"stats\">\n @if (paymentIntents().length > 0) {\n <span class=\"badge badge-soft badge-info\">{{ paymentIntents().length }} payment intents</span>\n }\n </div>\n <button class=\"btn btn-sm btn-outline\" (click)=\"refreshPaymentIntents()\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" class=\"h-4 w-4 mr-1\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15\" />\n </svg>\n Actualizar\n </button>\n </div>\n }\n\n @if (loading()) {\n <div class=\"flex flex-col gap-4\">\n @for (item of [1,2,3]; track item) {\n <lib-payment-intent-item-skeleton></lib-payment-intent-item-skeleton>\n }\n </div>\n } @else if (error()) {\n <div class=\"error-container\">\n <div class=\"alert alert-error\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" class=\"stroke-current shrink-0 h-6 w-6\" fill=\"none\" viewBox=\"0 0 24 24\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z\" /></svg>\n <span>{{ error() }}</span>\n </div>\n </div>\n } @else if (paymentIntents().length > 0) {\n <div class=\"flex flex-col gap-4\">\n @for (paymentIntent of paymentIntents(); track paymentIntent.id) {\n <lib-payment-intent-item [paymentIntent]=\"paymentIntent\"></lib-payment-intent-item>\n }\n </div>\n } @else {\n <div class=\"empty-state\">\n <div class=\"card bg-base-100 shadow-sm\">\n <div class=\"card-body items-center text-center\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" class=\"h-12 w-12 text-gray-400 mb-4\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z\" />\n </svg>\n <h2 class=\"card-title text-xl\">No hay payment intents recientes</h2>\n <p class=\"text-gray-600\">No se encontraron payment intents en tu historial.</p>\n </div>\n </div>\n </div>\n }\n</div> " }]
|
|
1544
1599
|
}] });
|
|
1545
1600
|
|
|
1546
|
-
class PaymentIntentsTableComponent {
|
|
1547
|
-
paymentIntents = input.required();
|
|
1548
|
-
paymentIntentsTable = computed(() => {
|
|
1549
|
-
return this.paymentIntents().map(paymentIntent => ({
|
|
1550
|
-
...paymentIntent,
|
|
1551
|
-
selected: false
|
|
1552
|
-
}));
|
|
1553
|
-
});
|
|
1554
|
-
loading = input(false);
|
|
1555
|
-
error = input(null);
|
|
1556
|
-
withControls = input(true);
|
|
1557
|
-
exportSelected = output();
|
|
1558
|
-
onRefresh = output();
|
|
1559
|
-
utils = inject(UtilsService);
|
|
1560
|
-
hasPaymentIntents = computed(() => this.paymentIntents() && this.paymentIntents().length > 0);
|
|
1561
|
-
trackByPaymentIntentId = (index, item) => item.id;
|
|
1562
|
-
refreshPaymentIntents() {
|
|
1563
|
-
this.onRefresh.emit();
|
|
1564
|
-
}
|
|
1565
|
-
allPaymentIntentsSelected() {
|
|
1566
|
-
return this.paymentIntentsTable().every(paymentIntent => paymentIntent.selected);
|
|
1567
|
-
}
|
|
1568
|
-
somePaymentIntentsSelected() {
|
|
1569
|
-
return this.paymentIntentsTable().some(paymentIntent => paymentIntent.selected);
|
|
1570
|
-
}
|
|
1571
|
-
toggleAllPaymentIntents(event) {
|
|
1572
|
-
const checkbox = event.target;
|
|
1573
|
-
const isChecked = checkbox.checked;
|
|
1574
|
-
this.paymentIntentsTable().forEach(paymentIntent => {
|
|
1575
|
-
paymentIntent.selected = isChecked;
|
|
1576
|
-
});
|
|
1577
|
-
}
|
|
1578
|
-
togglePaymentIntent(event, id) {
|
|
1579
|
-
const checkbox = event.target;
|
|
1580
|
-
const isChecked = checkbox.checked;
|
|
1581
|
-
const paymentIntent = this.paymentIntentsTable().find(paymentIntent => paymentIntent.id === id);
|
|
1582
|
-
if (paymentIntent) {
|
|
1583
|
-
paymentIntent.selected = isChecked;
|
|
1584
|
-
}
|
|
1585
|
-
}
|
|
1586
|
-
showDetails(id) {
|
|
1587
|
-
const modalElement = document.getElementById(`modal-${id}`);
|
|
1588
|
-
if (modalElement) {
|
|
1589
|
-
modalElement.showModal();
|
|
1590
|
-
}
|
|
1591
|
-
}
|
|
1592
|
-
exportSelectedPaymentIntents() {
|
|
1593
|
-
this.exportSelected.emit(this.paymentIntentsTable().filter(paymentIntent => paymentIntent.selected));
|
|
1594
|
-
}
|
|
1595
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: PaymentIntentsTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1596
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.5", type: PaymentIntentsTableComponent, isStandalone: true, selector: "lib-payment-intents-table", inputs: { paymentIntents: { classPropertyName: "paymentIntents", publicName: "paymentIntents", isSignal: true, isRequired: true, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, withControls: { classPropertyName: "withControls", publicName: "withControls", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { exportSelected: "exportSelected", onRefresh: "onRefresh" }, ngImport: i0, template: "<div class=\"payment-intents-container\">\n @if (withControls()) {\n <div class=\"controls mb-4 flex justify-between items-center\">\n <div class=\"stats\">\n @if (hasPaymentIntents()) {\n <span class=\"badge badge-soft badge-info\">{{ paymentIntentsTable().length }} payment intents</span>\n }\n </div>\n <div class=\"flex justify-end items-center gap-2\">\n <button class=\"btn btn-sm btn-outline\" (click)=\"refreshPaymentIntents()\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" class=\"h-4 w-4 mr-1\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15\" />\n </svg>\n Actualizar\n </button>\n <button class=\"btn btn-sm btn-primary\" [disabled]=\"!somePaymentIntentsSelected()\" (click)=\"exportSelectedPaymentIntents()\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M8.71 7.71L11 5.41V15a1 1 0 0 0 2 0V5.41l2.29 2.3a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.42l-4-4a1 1 0 0 0-.33-.21a1 1 0 0 0-.76 0a1 1 0 0 0-.33.21l-4 4a1 1 0 1 0 1.42 1.42M21 14a1 1 0 0 0-1 1v4a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-4a1 1 0 0 0-2 0v4a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3v-4a1 1 0 0 0-1-1\"/></svg>\n Export Selected\n </button>\n </div>\n </div>\n }\n\n @if (loading()) {\n <div class=\"overflow-x-auto\">\n <div class=\"skeleton h-32 w-full\"></div>\n </div>\n } @else if (error()) {\n <div class=\"error-container\">\n <div class=\"alert alert-error\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" class=\"stroke-current shrink-0 h-6 w-6\" fill=\"none\" viewBox=\"0 0 24 24\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z\" /></svg>\n <span>{{ error() }}</span>\n </div>\n </div>\n } @else if (hasPaymentIntents()) {\n <div class=\"overflow-x-auto rounded-box border border-base-content/5 bg-base-100\">\n <table class=\"table table-zebra\">\n <!-- head -->\n <thead>\n <tr>\n <th>\n <label>\n <input type=\"checkbox\" class=\"checkbox\" (change)=\"toggleAllPaymentIntents($event)\" [checked]=\"allPaymentIntentsSelected()\" />\n </label>\n </th>\n <th>Amount</th>\n <th>Payment Method</th>\n <th>Status</th>\n <th>Mode</th>\n <th></th>\n </tr>\n </thead>\n <tbody>\n @for (paymentIntent of paymentIntentsTable(); track trackByPaymentIntentId(0, paymentIntent)) {\n <tr>\n <th>\n <label>\n <input type=\"checkbox\" class=\"checkbox\" (change)=\"togglePaymentIntent($event, paymentIntent.id ?? '')\" [checked]=\"paymentIntent.selected\" />\n </label>\n </th>\n <td>{{ utils.formatAmount(paymentIntent.amount ?? 0, paymentIntent.currency ?? 'EUR') }}</td>\n <td>\n <span class=\"badge badge-outline\">\n {{ paymentIntent.paymentMethodId }}\n </span>\n </td>\n <td>\n <span class=\"badge badge-soft {{ utils.getStatusBadgeClass(paymentIntent.status) }}\">\n {{ paymentIntent.status}}\n </span>\n </td>\n <td>{{ paymentIntent.liveMode ? 'Live' : 'Test' }}</td>\n <td>\n <button class=\"btn btn-xs btn-ghost\" (click)=\"showDetails(paymentIntent.id ?? '')\">\n Details\n </button>\n <dialog id=\"modal-{{ paymentIntent.id }}\" class=\"modal\">\n <div class=\"modal-box\">\n <h3 class=\"font-bold text-lg\">Payment Intent Details</h3>\n <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4 mt-4\">\n <div>\n <h4 class=\"text-md font-semibold mb-2\">Payment Details</h4>\n <ul class=\"space-y-1 text-sm\">\n <li><span class=\"font-medium\">Full ID:</span> {{ paymentIntent.id }}</li>\n <li><span class=\"font-medium\">Payment Method:</span> {{ paymentIntent.paymentMethodId }}</li>\n <li><span class=\"font-medium\">Confirmation Method:</span> {{ paymentIntent.confirmationMethod }}</li>\n @if (paymentIntent.invoiceId) {\n <li><span class=\"font-medium\">Invoice ID:</span> {{ paymentIntent.invoiceId }}</li>\n }\n </ul>\n </div>\n <div>\n <h4 class=\"text-md font-semibold mb-2\">Status Information</h4>\n <ul class=\"space-y-1 text-sm\">\n <li>\n <span class=\"font-medium\">Status: </span> \n <span class=\"badge badge-soft {{ utils.getStatusBadgeClass(paymentIntent.status) }}\">\n {{ paymentIntent.status }}\n </span>\n </li>\n <li><span class=\"font-medium\">Mode: </span> {{ paymentIntent.liveMode ? 'Production' : 'Test' }}</li>\n <li><span class=\"font-medium\">Amount: </span> {{ utils.formatAmount(paymentIntent.amount ?? 0, paymentIntent.currency ?? 'EUR') }}</li>\n </ul>\n </div>\n </div>\n <div class=\"modal-action\">\n <form method=\"dialog\">\n <button class=\"btn\">Close</button>\n </form>\n </div>\n </div>\n </dialog>\n </td>\n </tr>\n }\n </tbody>\n </table>\n </div>\n } @else {\n <div class=\"empty-state\">\n <div class=\"card bg-base-100 shadow-sm\">\n <div class=\"card-body items-center text-center\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" class=\"h-12 w-12 text-gray-400 mb-4\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z\" />\n </svg>\n <h2 class=\"card-title text-xl\">No recent payment intents</h2>\n <p class=\"text-gray-600\">No payment intents found in your history.</p>\n </div>\n </div>\n </div>\n }\n</div> ", dependencies: [{ kind: "ngmodule", type: CommonModule }] });
|
|
1597
|
-
}
|
|
1598
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: PaymentIntentsTableComponent, decorators: [{
|
|
1599
|
-
type: Component,
|
|
1600
|
-
args: [{ selector: 'lib-payment-intents-table', standalone: true, imports: [
|
|
1601
|
-
CommonModule
|
|
1602
|
-
], template: "<div class=\"payment-intents-container\">\n @if (withControls()) {\n <div class=\"controls mb-4 flex justify-between items-center\">\n <div class=\"stats\">\n @if (hasPaymentIntents()) {\n <span class=\"badge badge-soft badge-info\">{{ paymentIntentsTable().length }} payment intents</span>\n }\n </div>\n <div class=\"flex justify-end items-center gap-2\">\n <button class=\"btn btn-sm btn-outline\" (click)=\"refreshPaymentIntents()\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" class=\"h-4 w-4 mr-1\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15\" />\n </svg>\n Actualizar\n </button>\n <button class=\"btn btn-sm btn-primary\" [disabled]=\"!somePaymentIntentsSelected()\" (click)=\"exportSelectedPaymentIntents()\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1em\" height=\"1em\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M8.71 7.71L11 5.41V15a1 1 0 0 0 2 0V5.41l2.29 2.3a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.42l-4-4a1 1 0 0 0-.33-.21a1 1 0 0 0-.76 0a1 1 0 0 0-.33.21l-4 4a1 1 0 1 0 1.42 1.42M21 14a1 1 0 0 0-1 1v4a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-4a1 1 0 0 0-2 0v4a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3v-4a1 1 0 0 0-1-1\"/></svg>\n Export Selected\n </button>\n </div>\n </div>\n }\n\n @if (loading()) {\n <div class=\"overflow-x-auto\">\n <div class=\"skeleton h-32 w-full\"></div>\n </div>\n } @else if (error()) {\n <div class=\"error-container\">\n <div class=\"alert alert-error\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" class=\"stroke-current shrink-0 h-6 w-6\" fill=\"none\" viewBox=\"0 0 24 24\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z\" /></svg>\n <span>{{ error() }}</span>\n </div>\n </div>\n } @else if (hasPaymentIntents()) {\n <div class=\"overflow-x-auto rounded-box border border-base-content/5 bg-base-100\">\n <table class=\"table table-zebra\">\n <!-- head -->\n <thead>\n <tr>\n <th>\n <label>\n <input type=\"checkbox\" class=\"checkbox\" (change)=\"toggleAllPaymentIntents($event)\" [checked]=\"allPaymentIntentsSelected()\" />\n </label>\n </th>\n <th>Amount</th>\n <th>Payment Method</th>\n <th>Status</th>\n <th>Mode</th>\n <th></th>\n </tr>\n </thead>\n <tbody>\n @for (paymentIntent of paymentIntentsTable(); track trackByPaymentIntentId(0, paymentIntent)) {\n <tr>\n <th>\n <label>\n <input type=\"checkbox\" class=\"checkbox\" (change)=\"togglePaymentIntent($event, paymentIntent.id ?? '')\" [checked]=\"paymentIntent.selected\" />\n </label>\n </th>\n <td>{{ utils.formatAmount(paymentIntent.amount ?? 0, paymentIntent.currency ?? 'EUR') }}</td>\n <td>\n <span class=\"badge badge-outline\">\n {{ paymentIntent.paymentMethodId }}\n </span>\n </td>\n <td>\n <span class=\"badge badge-soft {{ utils.getStatusBadgeClass(paymentIntent.status) }}\">\n {{ paymentIntent.status}}\n </span>\n </td>\n <td>{{ paymentIntent.liveMode ? 'Live' : 'Test' }}</td>\n <td>\n <button class=\"btn btn-xs btn-ghost\" (click)=\"showDetails(paymentIntent.id ?? '')\">\n Details\n </button>\n <dialog id=\"modal-{{ paymentIntent.id }}\" class=\"modal\">\n <div class=\"modal-box\">\n <h3 class=\"font-bold text-lg\">Payment Intent Details</h3>\n <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4 mt-4\">\n <div>\n <h4 class=\"text-md font-semibold mb-2\">Payment Details</h4>\n <ul class=\"space-y-1 text-sm\">\n <li><span class=\"font-medium\">Full ID:</span> {{ paymentIntent.id }}</li>\n <li><span class=\"font-medium\">Payment Method:</span> {{ paymentIntent.paymentMethodId }}</li>\n <li><span class=\"font-medium\">Confirmation Method:</span> {{ paymentIntent.confirmationMethod }}</li>\n @if (paymentIntent.invoiceId) {\n <li><span class=\"font-medium\">Invoice ID:</span> {{ paymentIntent.invoiceId }}</li>\n }\n </ul>\n </div>\n <div>\n <h4 class=\"text-md font-semibold mb-2\">Status Information</h4>\n <ul class=\"space-y-1 text-sm\">\n <li>\n <span class=\"font-medium\">Status: </span> \n <span class=\"badge badge-soft {{ utils.getStatusBadgeClass(paymentIntent.status) }}\">\n {{ paymentIntent.status }}\n </span>\n </li>\n <li><span class=\"font-medium\">Mode: </span> {{ paymentIntent.liveMode ? 'Production' : 'Test' }}</li>\n <li><span class=\"font-medium\">Amount: </span> {{ utils.formatAmount(paymentIntent.amount ?? 0, paymentIntent.currency ?? 'EUR') }}</li>\n </ul>\n </div>\n </div>\n <div class=\"modal-action\">\n <form method=\"dialog\">\n <button class=\"btn\">Close</button>\n </form>\n </div>\n </div>\n </dialog>\n </td>\n </tr>\n }\n </tbody>\n </table>\n </div>\n } @else {\n <div class=\"empty-state\">\n <div class=\"card bg-base-100 shadow-sm\">\n <div class=\"card-body items-center text-center\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" class=\"h-12 w-12 text-gray-400 mb-4\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z\" />\n </svg>\n <h2 class=\"card-title text-xl\">No recent payment intents</h2>\n <p class=\"text-gray-600\">No payment intents found in your history.</p>\n </div>\n </div>\n </div>\n }\n</div> " }]
|
|
1603
|
-
}] });
|
|
1604
|
-
|
|
1605
1601
|
class SubscriptionsComponent {
|
|
1606
1602
|
customerStore = inject(CustomerStore);
|
|
1607
1603
|
portalAccountStore = inject(PortalAccountStore);
|
|
@@ -1658,5 +1654,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImpor
|
|
|
1658
1654
|
* Generated bundle index. Do not edit.
|
|
1659
1655
|
*/
|
|
1660
1656
|
|
|
1661
|
-
export { CheckoutStore, CustomerDashboardComponent, CustomerStore, EmbeddedCheckoutComponent, EmbeddedSubscriptionComponent,
|
|
1657
|
+
export { CheckoutStore, CustomerDashboardComponent, CustomerStore, EmbeddedCheckoutComponent, EmbeddedSubscriptionComponent, PaymentIntentsListComponent, PaymentIntentsTableComponent, ProductListComponent, ProductsStore, ReturnPageComponent, STRIPE_CONFIG, SUPABASE_CONFIG, StripeClientService, SubscriptionCardComponent, SubscriptionReturnPageComponent, SubscriptionsListComponent, SubscriptionsStore, SupabaseClientService, parsePaymentIntent, parseProduct, parseSubscription, provideNgxSupabaseStripeConfig, provideStripeConfig, provideSupabaseConfig };
|
|
1662
1658
|
//# sourceMappingURL=dotted-labs-ngx-supabase-stripe.mjs.map
|