cover/Elixir.DaProductApp.Adapters.InternationalPartnerBehaviour.html

1 defmodule DaProductApp.Adapters.InternationalPartnerBehaviour do
2 @moduledoc """
3 Behaviour for UPI International partner interactions.
4
5 International Partners are entities in specific corridors (Singapore, UAE, USA) who:
6 - Enroll international merchants under them
7 - Generate QR codes with FX rates for merchants
8 - Receive foreign currency settlement from PSP (after PSP receives INR from NPCI)
9 - Handle merchant payouts in local currency
10
11 Flow: NPCI debits INR from customer → Credits PSP → PSP converts to foreign currency → Credits international partner → Partner credits merchant
12 """
13
14 @type partner_resp :: {:ok, %{code: String.t(), payload: map()}} | {:error, term()}
15
16 # Core UPI International flow methods
17 @callback credit_merchant(map()) :: partner_resp
18 @callback check_transaction_status(map()) :: partner_resp
19 @callback reverse_payment(map()) :: partner_resp
20
21 # International-specific methods
22 @callback generate_dynamic_qr_with_fx(map()) :: partner_resp
23 @callback validate_fx_rates(map()) :: partner_resp
24 @callback get_corridor_info() :: %{currency: String.t(), country: String.t()}
25 end
Line Hits Source