@@ -57,12 +57,13 @@ use crate::{
57
57
58
58
#[ async_trait:: async_trait]
59
59
pub trait PaymentAttemptInterface {
60
+ type Error ;
60
61
#[ cfg( feature = "v1" ) ]
61
62
async fn insert_payment_attempt (
62
63
& self ,
63
64
payment_attempt : PaymentAttemptNew ,
64
65
storage_scheme : storage_enums:: MerchantStorageScheme ,
65
- ) -> error_stack:: Result < PaymentAttempt , errors :: StorageError > ;
66
+ ) -> error_stack:: Result < PaymentAttempt , Self :: Error > ;
66
67
67
68
#[ cfg( feature = "v2" ) ]
68
69
async fn insert_payment_attempt (
@@ -71,15 +72,15 @@ pub trait PaymentAttemptInterface {
71
72
merchant_key_store : & MerchantKeyStore ,
72
73
payment_attempt : PaymentAttempt ,
73
74
storage_scheme : storage_enums:: MerchantStorageScheme ,
74
- ) -> error_stack:: Result < PaymentAttempt , errors :: StorageError > ;
75
+ ) -> error_stack:: Result < PaymentAttempt , Self :: Error > ;
75
76
76
77
#[ cfg( feature = "v1" ) ]
77
78
async fn update_payment_attempt_with_attempt_id (
78
79
& self ,
79
80
this : PaymentAttempt ,
80
81
payment_attempt : PaymentAttemptUpdate ,
81
82
storage_scheme : storage_enums:: MerchantStorageScheme ,
82
- ) -> error_stack:: Result < PaymentAttempt , errors :: StorageError > ;
83
+ ) -> error_stack:: Result < PaymentAttempt , Self :: Error > ;
83
84
84
85
#[ cfg( feature = "v2" ) ]
85
86
async fn update_payment_attempt (
@@ -89,7 +90,7 @@ pub trait PaymentAttemptInterface {
89
90
this : PaymentAttempt ,
90
91
payment_attempt : PaymentAttemptUpdate ,
91
92
storage_scheme : storage_enums:: MerchantStorageScheme ,
92
- ) -> error_stack:: Result < PaymentAttempt , errors :: StorageError > ;
93
+ ) -> error_stack:: Result < PaymentAttempt , Self :: Error > ;
93
94
94
95
#[ cfg( feature = "v1" ) ]
95
96
async fn find_payment_attempt_by_connector_transaction_id_payment_id_merchant_id (
@@ -98,31 +99,31 @@ pub trait PaymentAttemptInterface {
98
99
payment_id : & id_type:: PaymentId ,
99
100
merchant_id : & id_type:: MerchantId ,
100
101
storage_scheme : storage_enums:: MerchantStorageScheme ,
101
- ) -> error_stack:: Result < PaymentAttempt , errors :: StorageError > ;
102
+ ) -> error_stack:: Result < PaymentAttempt , Self :: Error > ;
102
103
103
104
#[ cfg( feature = "v1" ) ]
104
105
async fn find_payment_attempt_last_successful_attempt_by_payment_id_merchant_id (
105
106
& self ,
106
107
payment_id : & id_type:: PaymentId ,
107
108
merchant_id : & id_type:: MerchantId ,
108
109
storage_scheme : storage_enums:: MerchantStorageScheme ,
109
- ) -> error_stack:: Result < PaymentAttempt , errors :: StorageError > ;
110
+ ) -> error_stack:: Result < PaymentAttempt , Self :: Error > ;
110
111
111
112
#[ cfg( feature = "v1" ) ]
112
113
async fn find_payment_attempt_last_successful_or_partially_captured_attempt_by_payment_id_merchant_id (
113
114
& self ,
114
115
payment_id : & id_type:: PaymentId ,
115
116
merchant_id : & id_type:: MerchantId ,
116
117
storage_scheme : storage_enums:: MerchantStorageScheme ,
117
- ) -> error_stack:: Result < PaymentAttempt , errors :: StorageError > ;
118
+ ) -> error_stack:: Result < PaymentAttempt , Self :: Error > ;
118
119
119
120
#[ cfg( feature = "v1" ) ]
120
121
async fn find_payment_attempt_by_merchant_id_connector_txn_id (
121
122
& self ,
122
123
merchant_id : & id_type:: MerchantId ,
123
124
connector_txn_id : & str ,
124
125
storage_scheme : storage_enums:: MerchantStorageScheme ,
125
- ) -> error_stack:: Result < PaymentAttempt , errors :: StorageError > ;
126
+ ) -> error_stack:: Result < PaymentAttempt , Self :: Error > ;
126
127
127
128
#[ cfg( feature = "v2" ) ]
128
129
async fn find_payment_attempt_by_profile_id_connector_transaction_id (
@@ -132,7 +133,7 @@ pub trait PaymentAttemptInterface {
132
133
profile_id : & id_type:: ProfileId ,
133
134
connector_transaction_id : & str ,
134
135
_storage_scheme : storage_enums:: MerchantStorageScheme ,
135
- ) -> CustomResult < PaymentAttempt , errors :: StorageError > ;
136
+ ) -> CustomResult < PaymentAttempt , Self :: Error > ;
136
137
137
138
#[ cfg( feature = "v1" ) ]
138
139
async fn find_payment_attempt_by_payment_id_merchant_id_attempt_id (
@@ -141,15 +142,15 @@ pub trait PaymentAttemptInterface {
141
142
merchant_id : & id_type:: MerchantId ,
142
143
attempt_id : & str ,
143
144
storage_scheme : storage_enums:: MerchantStorageScheme ,
144
- ) -> error_stack:: Result < PaymentAttempt , errors :: StorageError > ;
145
+ ) -> error_stack:: Result < PaymentAttempt , Self :: Error > ;
145
146
146
147
#[ cfg( feature = "v1" ) ]
147
148
async fn find_payment_attempt_by_attempt_id_merchant_id (
148
149
& self ,
149
150
attempt_id : & str ,
150
151
merchant_id : & id_type:: MerchantId ,
151
152
storage_scheme : storage_enums:: MerchantStorageScheme ,
152
- ) -> error_stack:: Result < PaymentAttempt , errors :: StorageError > ;
153
+ ) -> error_stack:: Result < PaymentAttempt , Self :: Error > ;
153
154
154
155
#[ cfg( feature = "v2" ) ]
155
156
async fn find_payment_attempt_by_id (
@@ -158,7 +159,7 @@ pub trait PaymentAttemptInterface {
158
159
merchant_key_store : & MerchantKeyStore ,
159
160
attempt_id : & id_type:: GlobalAttemptId ,
160
161
storage_scheme : storage_enums:: MerchantStorageScheme ,
161
- ) -> error_stack:: Result < PaymentAttempt , errors :: StorageError > ;
162
+ ) -> error_stack:: Result < PaymentAttempt , Self :: Error > ;
162
163
163
164
#[ cfg( feature = "v2" ) ]
164
165
async fn find_payment_attempts_by_payment_intent_id (
@@ -167,31 +168,31 @@ pub trait PaymentAttemptInterface {
167
168
payment_id : & id_type:: GlobalPaymentId ,
168
169
merchant_key_store : & MerchantKeyStore ,
169
170
storage_scheme : common_enums:: MerchantStorageScheme ,
170
- ) -> error_stack:: Result < Vec < PaymentAttempt > , errors :: StorageError > ;
171
+ ) -> error_stack:: Result < Vec < PaymentAttempt > , Self :: Error > ;
171
172
172
173
#[ cfg( feature = "v1" ) ]
173
174
async fn find_payment_attempt_by_preprocessing_id_merchant_id (
174
175
& self ,
175
176
preprocessing_id : & str ,
176
177
merchant_id : & id_type:: MerchantId ,
177
178
storage_scheme : storage_enums:: MerchantStorageScheme ,
178
- ) -> error_stack:: Result < PaymentAttempt , errors :: StorageError > ;
179
+ ) -> error_stack:: Result < PaymentAttempt , Self :: Error > ;
179
180
180
181
#[ cfg( feature = "v1" ) ]
181
182
async fn find_attempts_by_merchant_id_payment_id (
182
183
& self ,
183
184
merchant_id : & id_type:: MerchantId ,
184
185
payment_id : & id_type:: PaymentId ,
185
186
storage_scheme : storage_enums:: MerchantStorageScheme ,
186
- ) -> error_stack:: Result < Vec < PaymentAttempt > , errors :: StorageError > ;
187
+ ) -> error_stack:: Result < Vec < PaymentAttempt > , Self :: Error > ;
187
188
188
189
#[ cfg( all( feature = "v1" , feature = "olap" ) ) ]
189
190
async fn get_filters_for_payments (
190
191
& self ,
191
192
pi : & [ PaymentIntent ] ,
192
193
merchant_id : & id_type:: MerchantId ,
193
194
storage_scheme : storage_enums:: MerchantStorageScheme ,
194
- ) -> error_stack:: Result < PaymentListFilters , errors :: StorageError > ;
195
+ ) -> error_stack:: Result < PaymentListFilters , Self :: Error > ;
195
196
196
197
#[ cfg( all( feature = "v1" , feature = "olap" ) ) ]
197
198
#[ allow( clippy:: too_many_arguments) ]
@@ -207,7 +208,7 @@ pub trait PaymentAttemptInterface {
207
208
card_network : Option < Vec < storage_enums:: CardNetwork > > ,
208
209
card_discovery : Option < Vec < storage_enums:: CardDiscovery > > ,
209
210
storage_scheme : storage_enums:: MerchantStorageScheme ,
210
- ) -> error_stack:: Result < i64 , errors :: StorageError > ;
211
+ ) -> error_stack:: Result < i64 , Self :: Error > ;
211
212
212
213
#[ cfg( all( feature = "v2" , feature = "olap" ) ) ]
213
214
#[ allow( clippy:: too_many_arguments) ]
@@ -222,7 +223,7 @@ pub trait PaymentAttemptInterface {
222
223
merchant_connector_id : Option < id_type:: MerchantConnectorAccountId > ,
223
224
card_network : Option < storage_enums:: CardNetwork > ,
224
225
storage_scheme : storage_enums:: MerchantStorageScheme ,
225
- ) -> error_stack:: Result < i64 , errors :: StorageError > ;
226
+ ) -> error_stack:: Result < i64 , Self :: Error > ;
226
227
}
227
228
228
229
#[ derive( Clone , Debug , Eq , PartialEq , serde:: Serialize ) ]
0 commit comments