File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
src/features/wallet/routers Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -17,10 +17,12 @@ import {
17
17
getNewTransactionResponsePayload ,
18
18
getTransactionInfoPayload
19
19
} from "../payloads/transactions" ;
20
+ import WalletDB from "../persistence/userWallet" ;
20
21
import {
21
22
WalletPaymentFailure ,
22
23
getStatusCodeForWalletFailure
23
24
} from "../types/failure" ;
25
+ import { generateOnboardablePaymentMethods } from "../utils/onboarding" ;
24
26
import { WALLET_PAYMENT_PATH } from "../utils/payment" ;
25
27
import { addPaymentHandler } from "./router" ;
26
28
@@ -181,3 +183,14 @@ addPaymentHandler(
181
183
)
182
184
)
183
185
) ;
186
+
187
+ addPaymentHandler ( "get" , "/wallets" , ( req , res ) => {
188
+ res . json ( { wallets : WalletDB . getUserWallets ( ) } ) ;
189
+ } ) ;
190
+
191
+ /**
192
+ * This API is used to retrieve a list of payment methods available
193
+ */
194
+ addPaymentHandler ( "get" , "/payment-methods" , ( req , res ) => {
195
+ res . json ( generateOnboardablePaymentMethods ( ) ) ;
196
+ } ) ;
You can’t perform that action at this time.
0 commit comments