Implement Pay per Use Model for Direct Payments#5
Conversation
Transitioned from a strict Top-up model to a Pay per Use model. Users can now pay directly via saved cards or Apple Pay for QR scan transactions. Changes: - Added process_direct_payout_transaction RPC for atomic funding and payout ledger entries. - Enhanced payout-executor Edge Function to charge Omise cards directly for pay-per-use flows. - Updated Frontend UI to support real-time payment method selection and fee transparency in ConfirmPaymentScreen. - Integrated FeeCalculator into the confirmation flow for card surcharges. - Fixed missing security middleware in Go API. How to test: 1. Environment: Local development (Backend services + Flutter app). 2. Step-by-step: a. Scan a QR code or enter a PromptPay ID. b. On the Review Payment screen, tap on the Payment Method. c. Select a Saved Card instead of 'Paycif Balance'. d. Observe the 'Fee' row appearing with the calculated surcharge. e. Slide to Pay and complete biometric auth. 3. Test Credentials: Use standard test cards (4242...). 4. Expected Result: The transaction is successful. Two ledger entries (Top-up and Payout) are created atomically, and the recipient receives the amount while the card is charged the gross amount. Co-authored-by: MethasMP <89190477+MethasMP@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
This PR implements the "Pay per Use" model, allowing users to pay directly via credit cards or Apple Pay for QR transactions without manual top-ups.
Key technical changes:
process_direct_payout_transactionRPC to ensure ledger integrity by atomically recording the funding top-up and the external payout.payout-executorEdge Function to handle card charging via Omise before invoking the direct payout RPC.ConfirmPaymentScreento provide a premium selection experience for payment methods.PR created automatically by Jules for task 12593253480382621305 started by @MethasMP