@@ -3,7 +3,10 @@ use std::collections::HashSet;
33use std:: sync:: { Arc , RwLock as StdRwLock } ;
44
55use async_trait:: async_trait;
6- use cdk_common:: { nut19, MeltQuoteBolt12Request , MintQuoteBolt12Request , MintQuoteBolt12Response } ;
6+ use cdk_common:: {
7+ nut19, MeltQuoteBolt12Request , MeltQuoteCustomResponse , MintQuoteBolt12Request ,
8+ MintQuoteBolt12Response ,
9+ } ;
710#[ cfg( feature = "auth" ) ]
811use cdk_common:: { Method , ProtectedEndpoint , RoutePath } ;
912use serde:: de:: DeserializeOwned ;
@@ -622,12 +625,34 @@ where
622625 self . transport . http_post ( url, auth_token, & request) . await
623626 }
624627
628+ /// Mint Quote Status for Custom Payment Method
629+ #[ instrument( skip( self ) , fields( mint_url = %self . mint_url) ) ]
630+ async fn get_mint_quote_custom_status (
631+ & self ,
632+ method : & str ,
633+ quote_id : & str ,
634+ ) -> Result < MintQuoteCustomResponse < String > , Error > {
635+ let url = self
636+ . mint_url
637+ . join_paths ( & [ "v1" , "mint" , "quote" , method, quote_id] ) ?;
638+
639+ #[ cfg( feature = "auth" ) ]
640+ let auth_token = self
641+ . get_auth_token ( Method :: Get , RoutePath :: MintQuote ( method. to_string ( ) ) )
642+ . await ?;
643+
644+ #[ cfg( not( feature = "auth" ) ) ]
645+ let auth_token = None ;
646+
647+ self . transport . http_get ( url, auth_token) . await
648+ }
649+
625650 /// Melt Quote for Custom Payment Method
626651 #[ instrument( skip( self , request) , fields( mint_url = %self . mint_url) ) ]
627652 async fn post_melt_custom_quote (
628653 & self ,
629654 request : MeltQuoteCustomRequest ,
630- ) -> Result < MeltQuoteBolt11Response < String > , Error > {
655+ ) -> Result < MeltQuoteCustomResponse < String > , Error > {
631656 let url = self
632657 . mint_url
633658 . join_paths ( & [ "v1" , "melt" , "quote" , & request. method ] ) ?;
@@ -642,6 +667,28 @@ where
642667
643668 self . transport . http_post ( url, auth_token, & request) . await
644669 }
670+
671+ /// Melt Quote Status for Custom Payment Method
672+ #[ instrument( skip( self ) , fields( mint_url = %self . mint_url) ) ]
673+ async fn get_melt_quote_custom_status (
674+ & self ,
675+ method : & str ,
676+ quote_id : & str ,
677+ ) -> Result < MeltQuoteCustomResponse < String > , Error > {
678+ let url = self
679+ . mint_url
680+ . join_paths ( & [ "v1" , "melt" , "quote" , method, quote_id] ) ?;
681+
682+ #[ cfg( feature = "auth" ) ]
683+ let auth_token = self
684+ . get_auth_token ( Method :: Get , RoutePath :: MeltQuote ( method. to_string ( ) ) )
685+ . await ?;
686+
687+ #[ cfg( not( feature = "auth" ) ) ]
688+ let auth_token = None ;
689+
690+ self . transport . http_get ( url, auth_token) . await
691+ }
645692}
646693
647694/// Http Client
0 commit comments