@tapni/auth 1.0.61 → 1.0.66
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/dist/.vite/manifest.json +69 -0
- package/dist/Apps-BGr6XXC1.js +109 -0
- package/dist/CustomApp-CUbr7Yc0.js +83 -0
- package/dist/QR-C-hIeHAf.js +41 -0
- package/dist/TapniAuth.es.js +4 -0
- package/dist/TapniAuth.umd.js +167 -0
- package/dist/install-NW33kPfJ.js +20276 -0
- package/dist/style.css +1 -0
- package/dist/web-LIfHmYL2.js +54 -0
- package/dist/web-UrTMimK1.js +86 -0
- package/dist/web-XbruGdlD.js +121 -0
- package/package.json +3 -2
- package/src/App.vue +78 -5
- package/src/index.js +4 -0
- package/src/services/Api.js +3 -3
- package/src/store/auth.js +23 -19
- package/src/store/constants.js +2 -2
- package/src/store/locales/cn.js +33 -31
- package/src/store/locales/de.js +38 -36
- package/src/store/locales/en.js +454 -513
- package/src/store/locales/es.js +34 -32
- package/src/store/locales/fr.js +33 -31
- package/src/store/locales/it.js +34 -32
- package/src/store/locales/ja.js +488 -0
- package/src/store/locales/kr.js +34 -32
- package/src/store/locales/lang.js +8 -0
- package/src/store/locales/pt.js +488 -0
- package/src/store/locales/sr.js +37 -35
- package/src/store/locales/tr.js +40 -38
- package/src/views/Account.vue +14 -2
- package/src/views/Billing.vue +216 -40
- package/src/views/General.vue +152 -168
- package/src/views/Welcome.vue +85 -66
- package/dist/assets/Apps-DRNQ66T5.css +0 -1
- package/dist/assets/Apps-Y4SdRTLA.js +0 -1
- package/dist/assets/Billing-Bwm-D3JZ.js +0 -1
- package/dist/assets/Billing-COZeuzks.css +0 -1
- package/dist/assets/CustomApp-BCUrlnlC.js +0 -1
- package/dist/assets/CustomApp-EflPiIBk.css +0 -1
- package/dist/assets/Inter-ZO3WBJgw.ttf +0 -0
- package/dist/assets/QR-DmlpvOTV.js +0 -1
- package/dist/assets/fontawesome-webfont-CQDK8MU3.ttf +0 -0
- package/dist/assets/fontawesome-webfont-DXgy9qkh.svg +0 -2671
- package/dist/assets/fontawesome-webfont-G5YE5S7X.eot +0 -0
- package/dist/assets/index-B2NkTeng.js +0 -181
- package/dist/assets/index-BrLpR8cl.css +0 -1
- package/dist/assets/web-0Odj9drH.js +0 -1
- package/dist/assets/web-B6dACyEr.js +0 -5
- package/dist/assets/web-Cw9PHD75.js +0 -1
- package/dist/assets/web-CzLXrrwg.js +0 -1
- package/dist/assets/web-D_iNPwxM.js +0 -1
- package/dist/assets/web-DnM9fFvq.js +0 -1
- package/dist/index.html +0 -39
package/src/store/locales/tr.js
CHANGED
|
@@ -9,6 +9,8 @@ export default {
|
|
|
9
9
|
serbian: 'Sırpça',
|
|
10
10
|
turkish: 'Çince',
|
|
11
11
|
chinese: 'Kineski',
|
|
12
|
+
japanese: 'Japonca',
|
|
13
|
+
portuguese: 'Portekizce',
|
|
12
14
|
app_language: 'Dil seçin',
|
|
13
15
|
profile_preview: 'Profil Önizlemesi',
|
|
14
16
|
edit_profile: 'Profili Düzenle',
|
|
@@ -23,9 +25,9 @@ export default {
|
|
|
23
25
|
exchange_contact: 'Değişim İletişim',
|
|
24
26
|
add_details: 'Daha fazlasını ekle',
|
|
25
27
|
show_details: 'Daha fazlasını göster',
|
|
26
|
-
download_contact:
|
|
27
|
-
stay_in_touch:
|
|
28
|
-
no_thanks:
|
|
28
|
+
download_contact: 'İletişim Kartını İndir',
|
|
29
|
+
stay_in_touch: 'İle iletişim kurun',
|
|
30
|
+
no_thanks: 'Hayır, teşekkürler',
|
|
29
31
|
connect_join: "Tapni'ye katıl",
|
|
30
32
|
connect_with: 'ile bağlanın',
|
|
31
33
|
connect_required_fields: 'İki iletişim alanından biri sağlanmalıdır',
|
|
@@ -167,7 +169,7 @@ export default {
|
|
|
167
169
|
update_username: 'Kullanıcı adını güncelle',
|
|
168
170
|
new_username: 'Yeni kullanıcı adınızı girin',
|
|
169
171
|
username_check: 'Lütfen uygun bir kullanıcı adı girin',
|
|
170
|
-
username_is_free:
|
|
172
|
+
username_is_free: 'Kullanıcı adınız kullanılabilir',
|
|
171
173
|
anonymous: 'Anonim',
|
|
172
174
|
connected: 'Bağlı',
|
|
173
175
|
exchanged: 'Değiş tokuş',
|
|
@@ -366,9 +368,9 @@ export default {
|
|
|
366
368
|
accept_request: 'İsteği kabul et',
|
|
367
369
|
close: 'Kapat',
|
|
368
370
|
request_accepted: 'İstek başarıyla kabul edildi',
|
|
369
|
-
companyEmail:
|
|
370
|
-
companyPhone:
|
|
371
|
-
addBusinessInformations:
|
|
371
|
+
companyEmail: 'Şirket e-postası',
|
|
372
|
+
companyPhone: 'Şirket telefon numarası',
|
|
373
|
+
addBusinessInformations: 'İş bilgilerini ekle',
|
|
372
374
|
resetFilter: 'Sıfırla',
|
|
373
375
|
selectMarkers: 'İşaretleyicileri Seçin',
|
|
374
376
|
filterConnectionsHeader: 'Filtre Bağlantıları',
|
|
@@ -444,36 +446,36 @@ export default {
|
|
|
444
446
|
choose_other_login_methods: 'Diğer giriş yöntemlerini seçin',
|
|
445
447
|
no_sso_logins: 'Şirketiniz SSO girişini kullanmıyor, lütfen yöneticinizle iletişime geçin',
|
|
446
448
|
|
|
447
|
-
mfa:
|
|
448
|
-
otp_title:
|
|
449
|
-
otp_code:
|
|
450
|
-
otp_subtitle:
|
|
451
|
-
otp_p1:
|
|
452
|
-
change_language:
|
|
453
|
-
welcome_account:
|
|
454
|
-
security:
|
|
455
|
-
security_p:
|
|
456
|
-
general:
|
|
457
|
-
general_p:
|
|
458
|
-
billing:
|
|
459
|
-
billing_p:
|
|
460
|
-
apps:
|
|
461
|
-
apps_p:
|
|
462
|
-
apps_my:
|
|
463
|
-
mfa_auth:
|
|
464
|
-
mfa_auth_enabled:
|
|
465
|
-
mfa_auth_p:
|
|
466
|
-
mfa_auth_qr:
|
|
467
|
-
change_password:
|
|
468
|
-
active_account:
|
|
469
|
-
active_account_p:
|
|
470
|
-
delete_account:
|
|
471
|
-
delete_account_p:
|
|
472
|
-
permanent_delete:
|
|
473
|
-
permanent_delete_p:
|
|
474
|
-
personal_details:
|
|
475
|
-
app_language_p:
|
|
476
|
-
app_region:
|
|
477
|
-
app_region_p:
|
|
449
|
+
mfa: 'Çok Faktörlü Kimlik Doğrulama',
|
|
450
|
+
otp_title: 'Devam etmek için MFA kodunu girin',
|
|
451
|
+
otp_code: 'MFA Kodu',
|
|
452
|
+
otp_subtitle: 'Kimlik doğrulama uygulamasındaki kodu girin',
|
|
453
|
+
otp_p1: 'MFA ile ilgili sorun yaşıyorsanız, <br> bize ulaşın:',
|
|
454
|
+
change_language: 'Dili Değiştir',
|
|
455
|
+
welcome_account: 'Hesap Merkezine Hoş Geldiniz',
|
|
456
|
+
security: 'Güvenlik',
|
|
457
|
+
security_p: 'Kimlik doğrulama seçeneklerinizi & hesap durumunuzu yönetin',
|
|
458
|
+
general: 'Genel',
|
|
459
|
+
general_p: 'Kişisel bilgilerinizi & diğer tercihlerinizi yönetin',
|
|
460
|
+
billing: 'Faturalama',
|
|
461
|
+
billing_p: 'Aboneliklerinizi & ödeme profillerinizi yönetin',
|
|
462
|
+
apps: 'Uygulamalar',
|
|
463
|
+
apps_p: 'Aktif uygulamalarınızı görüntüleyin & diğerlerini keşfedin',
|
|
464
|
+
apps_my: 'Uygulamalarım',
|
|
465
|
+
mfa_auth: '2 Faktörlü Doğrulama',
|
|
466
|
+
mfa_auth_enabled: 'Hesabınız MFA ile korunuyor.',
|
|
467
|
+
mfa_auth_p: 'Hesabınızı çok faktörlü doğrulama (MFA) ile koruyun',
|
|
468
|
+
mfa_auth_qr: 'Yukarıdaki QR kodunu tarayın ya da gizli anahtarı doğrulama uygulamanıza girin.',
|
|
469
|
+
change_password: 'Şifreyi Değiştir',
|
|
470
|
+
active_account: 'Aktif Hesap',
|
|
471
|
+
active_account_p: 'Kapatılırsa hesabınız yeniden açılana dek geçici olarak devre dışı kalır.',
|
|
472
|
+
delete_account: 'Hesabı Sil',
|
|
473
|
+
delete_account_p: 'Hesabı Sil',
|
|
474
|
+
permanent_delete: 'Kalıcı Silme',
|
|
475
|
+
permanent_delete_p: 'Hesabınızı silerseniz tüm verileriniz kalıcı olarak silinir. Geri alınamaz. Emin değilseniz hesabı geçici olarak devre dışı bırakın.',
|
|
476
|
+
personal_details: 'Kişisel Bilgiler',
|
|
477
|
+
app_language_p: 'Uygulamayı tercih ettiğiniz dile çevirin',
|
|
478
|
+
app_region: 'Bölge',
|
|
479
|
+
app_region_p: 'Kişiselleştirilmiş faturalama ve destek için bölgenizi seçin'
|
|
478
480
|
}
|
|
479
481
|
};
|
package/src/views/Account.vue
CHANGED
|
@@ -139,7 +139,19 @@
|
|
|
139
139
|
</div>
|
|
140
140
|
</router-link>
|
|
141
141
|
|
|
142
|
-
<
|
|
142
|
+
<div v-if="isModal" class="settingRow" @click="$emit('update:viewProp', 'AuthBilling')">
|
|
143
|
+
<div class="firstRow">
|
|
144
|
+
<img
|
|
145
|
+
:src="getIcon('billing-card-black.svg')"
|
|
146
|
+
class="withBackground"
|
|
147
|
+
/>
|
|
148
|
+
<h4>{{ssoLang[appLanguage].billing }}</h4>
|
|
149
|
+
|
|
150
|
+
<img :src="getIcon('arrow-gray-right.svg')" />
|
|
151
|
+
</div>
|
|
152
|
+
</div>
|
|
153
|
+
|
|
154
|
+
<router-link v-else to="/billing" class="settingRow">
|
|
143
155
|
<div class="firstRow">
|
|
144
156
|
<img
|
|
145
157
|
:src="getIcon('billing-card-black.svg')"
|
|
@@ -204,7 +216,7 @@ export default {
|
|
|
204
216
|
if (!this.isLoggedIn) {
|
|
205
217
|
return this.$router.push('/');
|
|
206
218
|
}
|
|
207
|
-
this.getAccountSettings();
|
|
219
|
+
await this.getAccountSettings();
|
|
208
220
|
},
|
|
209
221
|
methods: {
|
|
210
222
|
continueTo (realm) {
|
package/src/views/Billing.vue
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="page-login content-boxed content-boxed-padding">
|
|
2
|
+
<div class="page-login content-boxed content-boxed-padding tapni-auth-billing">
|
|
3
3
|
<a v-if="isModal" @click="close" class="color-black pull-right pointer" style="margin-top: 0px; position: absolute; right: -20px; text-align: right;">
|
|
4
4
|
<i class="font-17 color-black">
|
|
5
5
|
<img src="https://cdn.tapni.co/icons/down-arrow.png" class="responsive-image" style="width: 35%;"/>
|
|
@@ -7,7 +7,16 @@
|
|
|
7
7
|
</a>
|
|
8
8
|
<div class="subheaderContainer full-top">
|
|
9
9
|
<!-- Back Button -->
|
|
10
|
-
<
|
|
10
|
+
<div v-if="isModal" class="pointer left-button" @click="$emit('update:viewProp', 'AuthAccount')">
|
|
11
|
+
<img
|
|
12
|
+
:src="getIcon('arrow-gray-right.svg')"
|
|
13
|
+
height="20"
|
|
14
|
+
width="20"
|
|
15
|
+
class="btn-icon"
|
|
16
|
+
style="rotate: 180deg;"
|
|
17
|
+
/>
|
|
18
|
+
</div>
|
|
19
|
+
<router-link v-else to="/account" class="button gray-button pointer left-button">
|
|
11
20
|
<img
|
|
12
21
|
:src="getIcon('arrow-gray-right.svg')"
|
|
13
22
|
height="20"
|
|
@@ -27,23 +36,98 @@
|
|
|
27
36
|
<p class="center-text">{{ssoLang[appLanguage].billing_p }}</p>
|
|
28
37
|
|
|
29
38
|
<div class="full-top">
|
|
30
|
-
|
|
39
|
+
<!-- No subscriptions message -->
|
|
40
|
+
<div v-if="subscriptions.length === 0" class="no-subscriptions center-text full-top">
|
|
41
|
+
<p class="gray-text">There are no active subscriptions at this point.</p>
|
|
42
|
+
</div>
|
|
31
43
|
|
|
32
|
-
|
|
44
|
+
<!-- Subscriptions list -->
|
|
45
|
+
<div v-else>
|
|
46
|
+
<div v-for="sub in subscriptions" :key="sub.subscriptionId" class="subscription-card half-bottom">
|
|
47
|
+
<div class="subscription-header">
|
|
48
|
+
<div class="subscription-info">
|
|
49
|
+
<h3 class="subscription-name">{{ sub.subscriptionName }}</h3>
|
|
50
|
+
<span class="subscription-status" :class="getStatusClass(sub.status)">
|
|
51
|
+
{{ getStatusText(sub.status) }}
|
|
52
|
+
</span>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
33
55
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
56
|
+
<div class="subscription-details">
|
|
57
|
+
<div class="detail-row">
|
|
58
|
+
<span class="detail-label">Amount:</span>
|
|
59
|
+
<span class="detail-value">{{ formatCurrency(sub.amount, sub.currency) }}</span>
|
|
60
|
+
</div>
|
|
61
|
+
<div class="detail-row">
|
|
62
|
+
<span class="detail-label">Billing:</span>
|
|
63
|
+
<span class="detail-value">{{ formatInterval(sub.interval) }}</span>
|
|
64
|
+
</div>
|
|
65
|
+
<div class="detail-row">
|
|
66
|
+
<span class="detail-label">Licenses:</span>
|
|
67
|
+
<span class="detail-value">{{ sub.licenses }}</span>
|
|
68
|
+
</div>
|
|
69
|
+
<div v-if="sub.isTrial" class="detail-row">
|
|
70
|
+
<span class="detail-label">Trial Ends:</span>
|
|
71
|
+
<span class="detail-value">{{ formatDate(sub.trialEnd) }}</span>
|
|
72
|
+
</div>
|
|
73
|
+
<div v-else-if="sub.endDate" class="detail-row">
|
|
74
|
+
<span class="detail-label">Next Billing:</span>
|
|
75
|
+
<span class="detail-value">{{ formatDate(sub.endDate) }}</span>
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
41
78
|
|
|
42
|
-
<
|
|
79
|
+
<div class="subscription-actions" v-if="sub.status !== 'canceled'">
|
|
80
|
+
<button
|
|
81
|
+
@click="openCancelModal(sub)"
|
|
82
|
+
class="cancel-button"
|
|
83
|
+
:disabled="loading"
|
|
84
|
+
>
|
|
85
|
+
{{ loading ? 'Processing...' : 'Cancel Subscription' }}
|
|
86
|
+
</button>
|
|
87
|
+
</div>
|
|
43
88
|
</div>
|
|
44
89
|
</div>
|
|
45
90
|
</div>
|
|
46
91
|
</div>
|
|
92
|
+
|
|
93
|
+
<!-- Cancel Confirmation Modal -->
|
|
94
|
+
<div v-if="showCancelModal" class="modal-overlay" @click.self="closeCancelModal">
|
|
95
|
+
<div class="modal-content">
|
|
96
|
+
<div class="modal-header">
|
|
97
|
+
<h3>Cancel Subscription</h3>
|
|
98
|
+
<button @click="closeCancelModal" class="close-button">×</button>
|
|
99
|
+
</div>
|
|
100
|
+
|
|
101
|
+
<div class="modal-body">
|
|
102
|
+
<p class="modal-text">
|
|
103
|
+
Are you sure you want to cancel your subscription to <b>{{ selectedSubscription?.subscriptionName }}</b>?
|
|
104
|
+
</p>
|
|
105
|
+
|
|
106
|
+
<div class="feedback-section">
|
|
107
|
+
<label class="feedback-label">We'd love to know why you're canceling (optional):</label>
|
|
108
|
+
<textarea
|
|
109
|
+
v-model="cancelFeedback"
|
|
110
|
+
class="feedback-textarea"
|
|
111
|
+
placeholder="Your feedback helps us improve our service..."
|
|
112
|
+
rows="4"
|
|
113
|
+
></textarea>
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
116
|
+
|
|
117
|
+
<div class="modal-footer">
|
|
118
|
+
<button @click="closeCancelModal" class="button-secondary">
|
|
119
|
+
Keep Subscription
|
|
120
|
+
</button>
|
|
121
|
+
<button
|
|
122
|
+
@click="confirmCancel"
|
|
123
|
+
class="button-danger"
|
|
124
|
+
:disabled="loading"
|
|
125
|
+
>
|
|
126
|
+
{{ loading ? 'Canceling...' : 'Confirm Cancellation' }}
|
|
127
|
+
</button>
|
|
128
|
+
</div>
|
|
129
|
+
</div>
|
|
130
|
+
</div>
|
|
47
131
|
</div>
|
|
48
132
|
</template>
|
|
49
133
|
|
|
@@ -51,7 +135,7 @@
|
|
|
51
135
|
<script>
|
|
52
136
|
import AuthMixin from "../mixins/auth.mixin";
|
|
53
137
|
import {EventBus} from "@/store/event-bus.js";
|
|
54
|
-
import
|
|
138
|
+
import api from "@/services/Api.js";
|
|
55
139
|
|
|
56
140
|
export default {
|
|
57
141
|
name: "AuthBilling",
|
|
@@ -65,44 +149,136 @@ export default {
|
|
|
65
149
|
data () {
|
|
66
150
|
return {
|
|
67
151
|
loading: false,
|
|
68
|
-
subscriptions: []
|
|
152
|
+
subscriptions: [],
|
|
153
|
+
showCancelModal: false,
|
|
154
|
+
selectedSubscription: null,
|
|
155
|
+
cancelFeedback: ''
|
|
69
156
|
}
|
|
70
157
|
},
|
|
71
158
|
async mounted() {
|
|
72
159
|
if (!this.isLoggedIn) this.$router.push('/login');
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
const response = await AuthService.getRecords({
|
|
76
|
-
objectId: '6dc545ea-2e2f-4720-b4fe-c5ebdd8af066',
|
|
77
|
-
query: {
|
|
78
|
-
where: {
|
|
79
|
-
account: this.account.id,
|
|
80
|
-
},
|
|
81
|
-
fields: ['t_subscriptions_name', 't_subscriptions_desc', 't_subscriptions_type', 't_subscriptions_active', 't_subscriptions_app'],
|
|
82
|
-
relations: {
|
|
83
|
-
t_subscriptions_app: {
|
|
84
|
-
fields: [
|
|
85
|
-
"t_apps_name",
|
|
86
|
-
"t_apps_icon",
|
|
87
|
-
"t_apps_url"
|
|
88
|
-
],
|
|
89
|
-
relations: {},
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
})
|
|
94
|
-
this.subscriptions = response.data.records;
|
|
160
|
+
await this.getAccountSettings();
|
|
161
|
+
this.loadSubscriptions();
|
|
95
162
|
},
|
|
96
163
|
methods: {
|
|
97
164
|
close () {
|
|
98
165
|
EventBus.$emit('ssoEvent', {name: 'toggleAuthModal', data: true})
|
|
99
166
|
},
|
|
167
|
+
loadSubscriptions() {
|
|
168
|
+
// Extract subscriptions from account.billing
|
|
169
|
+
if (this.account.billing) {
|
|
170
|
+
const billing = this.account.billing;
|
|
171
|
+
const subs = [];
|
|
172
|
+
|
|
173
|
+
// Loop through billing object to find subscription objects
|
|
174
|
+
for (const key in billing) {
|
|
175
|
+
if (key !== 'region' && key !== 'currency' && key !== 'paymentProfiles' && typeof billing[key] === 'object' && billing[key].subscriptionId) {
|
|
176
|
+
subs.push(billing[key]);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
this.subscriptions = subs;
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
formatCurrency(amount, currency) {
|
|
184
|
+
const currencySymbols = {
|
|
185
|
+
'EUR': '€',
|
|
186
|
+
'USD': '$',
|
|
187
|
+
'GBP': '£'
|
|
188
|
+
};
|
|
189
|
+
const symbol = currencySymbols[currency?.toUpperCase()] || currency || '';
|
|
190
|
+
return `${symbol}${amount?.toFixed(2) || '0.00'}`;
|
|
191
|
+
},
|
|
192
|
+
formatInterval(interval) {
|
|
193
|
+
return interval ? `per ${interval}` : '';
|
|
194
|
+
},
|
|
195
|
+
formatDate(timestamp) {
|
|
196
|
+
if (!timestamp) return '';
|
|
197
|
+
const date = new Date(timestamp * 1000);
|
|
198
|
+
return date.toLocaleDateString('en-US', { year: 'numeric', month: 'short', day: 'numeric' });
|
|
199
|
+
},
|
|
200
|
+
getStatusText(status) {
|
|
201
|
+
const statusMap = {
|
|
202
|
+
'trialing': 'Trial',
|
|
203
|
+
'active': 'Active',
|
|
204
|
+
'past_due': 'Past Due',
|
|
205
|
+
'canceled': 'Canceled',
|
|
206
|
+
'unpaid': 'Unpaid'
|
|
207
|
+
};
|
|
208
|
+
return statusMap[status] || status;
|
|
209
|
+
},
|
|
210
|
+
getStatusClass(status) {
|
|
211
|
+
return `status-${status}`;
|
|
212
|
+
},
|
|
213
|
+
openCancelModal(subscription) {
|
|
214
|
+
this.selectedSubscription = subscription;
|
|
215
|
+
this.showCancelModal = true;
|
|
216
|
+
this.cancelFeedback = '';
|
|
217
|
+
},
|
|
218
|
+
closeCancelModal() {
|
|
219
|
+
this.showCancelModal = false;
|
|
220
|
+
this.selectedSubscription = null;
|
|
221
|
+
this.cancelFeedback = '';
|
|
222
|
+
},
|
|
223
|
+
async confirmCancel() {
|
|
224
|
+
if (!this.selectedSubscription) return;
|
|
225
|
+
|
|
226
|
+
// Check if this is a RevenueCat in-app purchase subscription
|
|
227
|
+
if (this.selectedSubscription.paymentGateway === 'revenuecat') {
|
|
228
|
+
// Fire event to redirect user to RevenueCat management URL
|
|
229
|
+
EventBus.$emit('ssoEvent', {
|
|
230
|
+
name: 'subscriptionCancelled',
|
|
231
|
+
data: {
|
|
232
|
+
subscriptionId: this.selectedSubscription.subscriptionId,
|
|
233
|
+
paymentGateway: this.selectedSubscription.paymentGateway,
|
|
234
|
+
feedback: this.cancelFeedback
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
// Close the modal
|
|
239
|
+
this.closeCancelModal();
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
// For other payment gateways (like Stripe), proceed with API cancellation
|
|
244
|
+
this.loading = true;
|
|
245
|
+
|
|
246
|
+
try {
|
|
247
|
+
// Send cancel request to backend
|
|
248
|
+
const response = await api(false, 'v2').post('checkout/cancel/' + this.selectedSubscription.subscriptionId, {
|
|
249
|
+
feedback: this.cancelFeedback
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
if (response.data.success) {
|
|
253
|
+
// Show success message
|
|
254
|
+
EventBus.$emit('showToast', {
|
|
255
|
+
type: 'success',
|
|
256
|
+
message: 'Subscription canceled successfully'
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
// Refresh account settings to get updated billing info
|
|
260
|
+
await this.getAccountSettings();
|
|
261
|
+
this.loadSubscriptions();
|
|
262
|
+
|
|
263
|
+
// Close modal
|
|
264
|
+
this.closeCancelModal();
|
|
265
|
+
} else {
|
|
266
|
+
throw new Error(response.data.message || 'Failed to cancel subscription');
|
|
267
|
+
}
|
|
268
|
+
} catch (error) {
|
|
269
|
+
console.error('Error canceling subscription:', error);
|
|
270
|
+
EventBus.$emit('showToast', {
|
|
271
|
+
type: 'error',
|
|
272
|
+
message: error.response?.data?.message || 'Failed to cancel subscription. Please try again.'
|
|
273
|
+
});
|
|
274
|
+
} finally {
|
|
275
|
+
this.loading = false;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
100
278
|
}
|
|
101
279
|
};
|
|
102
280
|
</script>
|
|
103
281
|
|
|
104
|
-
<style
|
|
105
|
-
|
|
106
|
-
height: 50px;
|
|
107
|
-
}
|
|
282
|
+
<style>
|
|
283
|
+
|
|
108
284
|
</style>
|