[WIP] UX changes for multi-wallet support#132
Open
shubham3121 wants to merge 8 commits intofeat/xendit-integration-v2from
Open
[WIP] UX changes for multi-wallet support#132shubham3121 wants to merge 8 commits intofeat/xendit-integration-v2from
shubham3121 wants to merge 8 commits intofeat/xendit-integration-v2from
Conversation
- Add paymentsApi with getInvoicesByEndpoint and getBundleUsages - Add policyTypesApi with list and get for fetching policy type schemas - Add walletsApi.updateXendit for updating Xendit wallet credentials
- Payment type selection: Bundle Payments (Xendit) or Micro-payments (MPP) - Micro-payments wizard: Wallet setup → Set price (with unit type from API) → Apply - Bundle payments wizard: Connect Xendit (creates wallet via API) → Define bundles → Apply - Auto-detects existing wallets and skips to next step - Locked type support: once a payment type is chosen, subsequent rules use same type - Copy buttons for wallet address and webhook URL - Fetches unit type options from policy type schema API
- Replace PolicyFormDialog with AddPricingRuleDialog for pricing rules - Handle both micro (mpp_accounting) and bundle (xendit) policy types - Store bundle_tiers, currency, country in pricing rule config - Update transformPolicyRules to map bundle → xendit policy type - Fix wallet_id lookup: fetch by wallet type instead of userStore.walletId - Widen PolicyConfig type to support complex values (arrays/objects)
- Show all wallets (MPP + Xendit) in a unified list with type icons - Add generic "Add Wallet" dialog with type selection (MPP or Xendit) - MPP: create new or import existing wallet - Xendit: connect with API key + callback token, shows webhook URL - Manage button for both types (MPP address update, Xendit credential update) - Delete wallet with confirmation - Copy button for Xendit webhook URL
- Add Transactions tab with MPP transactions and Gateway invoices - Email filter for both transaction types - Lazy fetch on tab selection with refresh button - Fix pricing policy display for Xendit (bundle tiers summary) - Hide free access banner when pricing rules exist - Remove Wallet Settings button from endpoint detail - Remove balance dropdown from navbar (moved to Settings page)
Fetch wallet list once and reuse via cached closure instead of calling walletsApi.list() inside the loop for each payment policy.
…blish payload - Update payment API types: bundle_name, remaining_balance, total_deposited - Redesign bundle wizard: price-per-request + currency/country grid layout instead of defining bundle tiers with units - Update transformPolicyRules to emit price_per_request for xendit config - Update endpoint pages to display new field names - Move payment_url and credits_url into policy config during publish
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several enhancements and refactors to the frontend codebase, primarily focusing on policy creation logic, wallet handling, and API integrations. The most significant changes include improved handling of wallet selection for payment policies, support for multiple pricing policy types, and the addition of new API endpoints for payments and policy types. Additionally, the AppNavbar component has been simplified by removing the balance dropdown and related UI logic.
Policy Creation & Wallet Handling Improvements:
usePolicyCreationcomposable to dynamically select the correct active wallet (eithermpporxendit) when creating payment-related policies, instead of relying on a user store property. This ensures the appropriate wallet is attached based on the policy type. (Fd7215b3L70R70, [1] [2] [3]transformPolicyRulesfunction to support asynchronous wallet lookups and to handle both "bundle" and "micro-payment" pricing types, mapping them to the correct backend policy types (xenditfor bundles,mpp_accountingfor micro-payments). [1] [2] [3]API Enhancements:
paymentsApi), as well as for listing and retrieving policy types (policyTypesApi). [1] [2]walletsApi.UI & Component Simplification:
AppNavbar.vue, significantly simplifying the component and its dependencies. [1] [2] [3]Policy Creation Flow Adjustments:
transformPolicyRulesfunction, ensuring policy creation flows work with the new async logic. [1] [2]Policy and Wallet Handling:
mpporxendit), and updated the transformation logic to support both bundle and micro-payment pricing types, mapping them to the appropriate backend policy types. (Fd7215b3L70R70, [1] [2] [3] [4] [5] [6]API Integrations:
paymentsApifor invoices and bundle usage,policyTypesApifor policy type metadata, and an Xendit wallet update endpoint inwalletsApi. [1] [2] [3]UI Simplification:
AppNavbar.vue, streamlining the navigation bar and related logic. [1] [2] [3]