File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -351,7 +351,13 @@ pub async fn add_payment_method(
351
351
None => {
352
352
let pm_metadata = resp. metadata . as_ref ( ) . map ( |data| data. peek ( ) ) ;
353
353
354
- let locker_id = Some ( resp. payment_method_id ) ;
354
+ let locker_id = if resp. payment_method == api_enums:: PaymentMethod :: Card
355
+ || resp. payment_method == api_enums:: PaymentMethod :: BankTransfer
356
+ {
357
+ Some ( resp. payment_method_id )
358
+ } else {
359
+ None
360
+ } ;
355
361
resp. payment_method_id = generate_id ( consts:: ID_LENGTH , "pm" ) ;
356
362
insert_payment_method (
357
363
db,
Original file line number Diff line number Diff line change 1
1
use api_models:: payment_methods:: PaymentMethodsData ;
2
+ use common_enums:: PaymentMethod ;
2
3
use common_utils:: { ext_traits:: ValueExt , pii} ;
3
4
use error_stack:: { report, ResultExt } ;
4
5
use masking:: ExposeInterface ;
@@ -342,7 +343,11 @@ where
342
343
None => {
343
344
let pm_metadata = create_payment_method_metadata ( None , connector_token) ?;
344
345
345
- locker_id = Some ( resp. payment_method_id ) ;
346
+ locker_id = if resp. payment_method == PaymentMethod :: Card {
347
+ Some ( resp. payment_method_id )
348
+ } else {
349
+ None
350
+ } ;
346
351
resp. payment_method_id = generate_id ( consts:: ID_LENGTH , "pm" ) ;
347
352
payment_methods:: cards:: create_payment_method (
348
353
db,
You can’t perform that action at this time.
0 commit comments