Implement multi-step registration process: Add step indicators, error handling, and payment processing for membership registration. Enhance form validation and user feedback with success and error messages. Refactor state management for improved clarity and maintainability.
This commit is contained in:
parent
a88aa62198
commit
2ca290d6e0
22 changed files with 1994 additions and 213 deletions
46
server/api/helcim/test-connection.get.js
Normal file
46
server/api/helcim/test-connection.get.js
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
// Test Helcim API connection
|
||||
const HELCIM_API_BASE = 'https://api.helcim.com/v2'
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
try {
|
||||
const config = useRuntimeConfig(event)
|
||||
|
||||
// Log token info (safely)
|
||||
const tokenInfo = {
|
||||
hasToken: !!config.public.helcimToken,
|
||||
tokenLength: config.public.helcimToken ? config.public.helcimToken.length : 0,
|
||||
tokenPrefix: config.public.helcimToken ? config.public.helcimToken.substring(0, 10) : null
|
||||
}
|
||||
|
||||
console.log('Helcim Token Info:', tokenInfo)
|
||||
|
||||
const helcimToken = config.public.helcimToken || process.env.NUXT_PUBLIC_HELCIM_TOKEN
|
||||
|
||||
// Try connection test endpoint
|
||||
const response = await $fetch(`${HELCIM_API_BASE}/connection-test`, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'accept': 'application/json',
|
||||
'api-token': helcimToken
|
||||
}
|
||||
})
|
||||
|
||||
return {
|
||||
success: true,
|
||||
message: 'Helcim API connection successful',
|
||||
tokenInfo,
|
||||
connectionResponse: response
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Helcim test error:', error)
|
||||
return {
|
||||
success: false,
|
||||
message: error.message || 'Failed to connect to Helcim API',
|
||||
statusCode: error.statusCode,
|
||||
tokenInfo: {
|
||||
hasToken: !!useRuntimeConfig().public.helcimToken,
|
||||
tokenLength: useRuntimeConfig().public.helcimToken ? useRuntimeConfig().public.helcimToken.length : 0
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue