This feature enables Exonomists to use vouchers for payments, handle optional cash redemptions, and persist transaction and voucher data using IPFS/OrbitDB for replication and offline functionality. The app will integrate with Stripe for payments, webhook handling, and custom receipts, while leveraging Nuxt3, TypeScript, Ionic for UI, and Capacitor for cross-platform deployment.
-
Voucher Metadata
- Unique Identifier: UUID for each voucher.
- Value: Monetary value of the voucher in the specified currency.
- Expiration Date: Expiry timestamp.
- Redeemable: Boolean to indicate if the voucher is available for cash redemption.
- Owner History: Array of transaction hashes, showing the chain of ownership.
-
Voucher Generation
- Vouchers are generated in the app by the issuing Exonomist and stored in OrbitDB.
- Persisted vouchers will include metadata and be synchronized across the network for availability to relevant Exonomists.
- Email Notifications: Send through a transactional email service (e.g., SendGrid or AWS SES).
- App Notifications: Implement using Capacitor Push Notifications plugin for mobile platforms.
- Enable offline access to vouchers and transactions by replicating data via OrbitDB.
- Any updates made offline (e.g., new vouchers or redeemed vouchers) will be synchronized when the app reconnects to the internet.
-
Stripe Features
- Account Linking: Enable Exonomists to link their Stripe accounts via OAuth flow.
- Payments: Process voucher-based transactions and initiate cash redemption payments.
- Webhook Handling: Use Stripe webhooks to monitor transaction statuses.
- Custom Receipts: Generate custom receipts for all transactions and store them in OrbitDB.
-
Stripe API Workflow
- Voucher payment uses the
PaymentIntent
API. - Cash redemption initiates a
Transfer
API call with the redeemer as the recipient. - Webhook events (e.g., payment success, transfer completed) update voucher statuses in the app.
- Voucher payment uses the
- Basic voucher and transaction management screens using Ionic components.
- Multilingual support for localization (e.g., i18n plugin in Nuxt3).
- Camera Access: Use Capacitor Camera or Barcode Scanner plugin for scanning QR codes to redeem vouchers.
- No other customizations specific to Android or iOS are currently required.
- Frontend: Nuxt3, TypeScript, and Ionic components.
- Data Persistence: IPFS/OrbitDB for decentralized, replicable storage.
- Backend: Stripe APIs for payment and webhook handling.
- Mobile Features: Capacitor for cross-platform compatibility and access to native device capabilities.
-
Voucher Functions
createVoucher(metadata: object): Promise<string>
: Generate a new voucher with metadata.redeemVoucher(voucherId: string): Promise<void>
: Trigger redemption process for a specific voucher.getVoucherById(voucherId: string): Promise<Voucher>
: Retrieve voucher details.
-
Stripe Functions
linkStripeAccount(): Promise<void>
: Initiate OAuth flow for Stripe account linking.processVoucherPayment(voucherId: string): Promise<void>
: Deduct the voucher’s value and complete the payment.initiateCashRedemption(voucherId: string): Promise<void>
: Transfer funds for cash redemption.
-
Notification Functions
sendEmailNotification(event: string, data: object): Promise<void>
: Send real-time email updates.pushAppNotification(event: string, data: object): Promise<void>
: Trigger app notifications.
- Nuxt3 Plugins: i18n for localization.
- Stripe SDK: For all payment and webhook integrations.
- OrbitDB: For decentralized data storage and synchronization.
- Capacitor Plugins: Push Notifications, Camera, and QR Scanner.
The development team should:
- Set up the base Nuxt3 application with Capacitor integration for Android and iOS.
- Implement Stripe OAuth and payment workflows.
- Create OrbitDB schemas for voucher and transaction data.
- Build UI components for voucher management and redemption.
- Configure localization and implement multilingual support.
- Add QR code scanning functionality for voucher redemption.