@@ -182,36 +182,36 @@ impl MandateUpdateInternal {
182
182
}
183
183
}
184
184
185
- impl MandateNew {
186
- pub fn from_new ( & self ) -> Mandate {
185
+ impl From < & MandateNew > for Mandate {
186
+ fn from ( mandate_new : & MandateNew ) -> Mandate {
187
187
Mandate {
188
188
id : 0i32 ,
189
- mandate_id : self . mandate_id . clone ( ) ,
190
- customer_id : self . customer_id . clone ( ) ,
191
- merchant_id : self . merchant_id . clone ( ) ,
192
- payment_method_id : self . payment_method_id . clone ( ) ,
193
- mandate_status : self . mandate_status . clone ( ) ,
194
- mandate_type : self . mandate_type . clone ( ) ,
195
- customer_accepted_at : self . customer_accepted_at . clone ( ) ,
196
- customer_ip_address : self . customer_ip_address . clone ( ) ,
197
- customer_user_agent : self . customer_user_agent . clone ( ) ,
198
- network_transaction_id : self . network_transaction_id . clone ( ) ,
199
- previous_attempt_id : self . previous_attempt_id . clone ( ) ,
200
- created_at : self
189
+ mandate_id : mandate_new . mandate_id . clone ( ) ,
190
+ customer_id : mandate_new . customer_id . clone ( ) ,
191
+ merchant_id : mandate_new . merchant_id . clone ( ) ,
192
+ payment_method_id : mandate_new . payment_method_id . clone ( ) ,
193
+ mandate_status : mandate_new . mandate_status . clone ( ) ,
194
+ mandate_type : mandate_new . mandate_type . clone ( ) ,
195
+ customer_accepted_at : mandate_new . customer_accepted_at . clone ( ) ,
196
+ customer_ip_address : mandate_new . customer_ip_address . clone ( ) ,
197
+ customer_user_agent : mandate_new . customer_user_agent . clone ( ) ,
198
+ network_transaction_id : mandate_new . network_transaction_id . clone ( ) ,
199
+ previous_attempt_id : mandate_new . previous_attempt_id . clone ( ) ,
200
+ created_at : mandate_new
201
201
. created_at
202
202
. clone ( )
203
203
. unwrap_or_else ( common_utils:: date_time:: now) ,
204
- mandate_amount : self . mandate_amount . clone ( ) ,
205
- mandate_currency : self . mandate_currency . clone ( ) ,
206
- amount_captured : self . amount_captured . clone ( ) ,
207
- connector : self . connector . clone ( ) ,
208
- connector_mandate_id : self . connector_mandate_id . clone ( ) ,
209
- start_date : self . start_date . clone ( ) ,
210
- end_date : self . end_date . clone ( ) ,
211
- metadata : self . metadata . clone ( ) ,
212
- connector_mandate_ids : self . connector_mandate_ids . clone ( ) ,
213
- original_payment_id : self . original_payment_id . clone ( ) ,
214
- merchant_connector_id : self . merchant_connector_id . clone ( ) ,
204
+ mandate_amount : mandate_new . mandate_amount . clone ( ) ,
205
+ mandate_currency : mandate_new . mandate_currency . clone ( ) ,
206
+ amount_captured : mandate_new . amount_captured . clone ( ) ,
207
+ connector : mandate_new . connector . clone ( ) ,
208
+ connector_mandate_id : mandate_new . connector_mandate_id . clone ( ) ,
209
+ start_date : mandate_new . start_date . clone ( ) ,
210
+ end_date : mandate_new . end_date . clone ( ) ,
211
+ metadata : mandate_new . metadata . clone ( ) ,
212
+ connector_mandate_ids : mandate_new . connector_mandate_ids . clone ( ) ,
213
+ original_payment_id : mandate_new . original_payment_id . clone ( ) ,
214
+ merchant_connector_id : mandate_new . merchant_connector_id . clone ( ) ,
215
215
}
216
216
}
217
217
}
0 commit comments