Skip to content

Implement Pay per Use Model for Direct Payments#5

Draft
MethasMP wants to merge 1 commit into
mainfrom
feat/pay-per-use-model-12593253480382621305
Draft

Implement Pay per Use Model for Direct Payments#5
MethasMP wants to merge 1 commit into
mainfrom
feat/pay-per-use-model-12593253480382621305

Conversation

@MethasMP
Copy link
Copy Markdown
Owner

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:

  1. Database: Introduced process_direct_payout_transaction RPC to ensure ledger integrity by atomically recording the funding top-up and the external payout.
  2. Backend: Updated payout-executor Edge Function to handle card charging via Omise before invoking the direct payout RPC.
  3. Frontend:
    • Overhauled ConfirmPaymentScreen to provide a premium selection experience for payment methods.
    • Integrated real-time fee calculation for transparency when using cards.
    • Simplified the navigation flow from QR scanning to confirmation.
  4. Resilience: Added missing security middleware to the Go API Gateway to ensure smooth service start and communication.

PR created automatically by Jules for task 12593253480382621305 started by @MethasMP

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>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant