@@ -29,7 +29,7 @@ impl<T: HttpClient + Default> DedicatedVirtualAccountEndpoints<T> {
2929 /// # Returns
3030 /// A new DedicatedVirtualAccountEndpoints instance
3131 pub fn new ( key : Arc < String > , http : Arc < T > ) -> DedicatedVirtualAccountEndpoints < T > {
32- let base_url = format ! ( "{PAYSTACK_BASE_URL }/dedicated_account" ) ;
32+ let base_url = format ! ( "{}/dedicated_account" , PAYSTACK_BASE_URL ) ;
3333 DedicatedVirtualAccountEndpoints {
3434 key : key. to_string ( ) ,
3535 base_url,
@@ -55,7 +55,7 @@ impl<T: HttpClient + Default> DedicatedVirtualAccountEndpoints<T> {
5555
5656 let response = self
5757 . http
58- . post ( url, & self . key , & body)
58+ . post ( & url, & self . key , & body)
5959 . await
6060 . map_err ( |e| PaystackAPIError :: DedicatedVirtualAccount ( e. to_string ( ) ) ) ?;
6161
@@ -84,7 +84,7 @@ impl<T: HttpClient + Default> DedicatedVirtualAccountEndpoints<T> {
8484
8585 let response = self
8686 . http
87- . post ( url, & self . key , & body)
87+ . post ( & url, & self . key , & body)
8888 . await
8989 . map_err ( |e| PaystackAPIError :: DedicatedVirtualAccount ( e. to_string ( ) ) ) ?;
9090
@@ -131,7 +131,7 @@ impl<T: HttpClient + Default> DedicatedVirtualAccountEndpoints<T> {
131131 let query: Vec < ( & str , & str ) > = query. iter ( ) . map ( |( k, v) | ( * k, v. as_str ( ) ) ) . collect ( ) ;
132132 let response = self
133133 . http
134- . get ( url, & self . key , Some ( & query) )
134+ . get ( & url, & self . key , Some ( & query) )
135135 . await
136136 . map_err ( |e| PaystackAPIError :: DedicatedVirtualAccount ( e. to_string ( ) ) ) ?;
137137
@@ -188,8 +188,8 @@ impl<T: HttpClient + Default> DedicatedVirtualAccountEndpoints<T> {
188188 ( "account_number" , account_number) ,
189189 ( "provider_slug" , provider_slug) ,
190190 ] ;
191- if let Some ( value ) = date {
192- query. push ( ( "date" , value ) ) ;
191+ if date . is_some ( ) {
192+ query. push ( ( "date" , date . unwrap ( ) ) ) ;
193193 }
194194
195195 // convert Vec<(&str, String)> to Vec<(&str, &str)>
@@ -242,6 +242,7 @@ impl<T: HttpClient + Default> DedicatedVirtualAccountEndpoints<T> {
242242 ///
243243 /// # Returns
244244 /// A Result containing the dedicated virtual account response data or an error
245+
245246 pub async fn split_dedicated_account_transaction (
246247 & self ,
247248 split_dedocated_account_transaction_request : SplitDedicatedAccountTransactionRequest ,
@@ -252,7 +253,7 @@ impl<T: HttpClient + Default> DedicatedVirtualAccountEndpoints<T> {
252253
253254 let response = self
254255 . http
255- . post ( url, & self . key , & body)
256+ . post ( & url, & self . key , & body)
256257 . await
257258 . map_err ( |e| PaystackAPIError :: DedicatedVirtualAccount ( e. to_string ( ) ) ) ?;
258259
@@ -281,7 +282,7 @@ impl<T: HttpClient + Default> DedicatedVirtualAccountEndpoints<T> {
281282
282283 let response = self
283284 . http
284- . delete ( url, & self . key , & body)
285+ . delete ( & url, & self . key , & body)
285286 . await
286287 . map_err ( |e| PaystackAPIError :: DedicatedVirtualAccount ( e. to_string ( ) ) ) ?;
287288
0 commit comments