pub fn delete_payment_method(&mut self, id: i128) {
        self.users.iter().find(|x| x.user_id == env::signer_account_id().to_string() && x.admin == true).expect("User not admin");
        for i in 0..self.payment_method.len() {
            if self.payment_method.get(i).unwrap().id == id {
                self.payment_method.remove(i);
            }
        }
        for i in 0..self.payment_method_user.len() {
            if self.payment_method_user.get(i).unwrap().payment_method_id == id {
                self.payment_method_user.remove(i);
                break;
            }
        }
        env::log(b"Payment Method Delete");
        //self.merchant.get(0).unwrap().user_id.clone()
        //self.payment_method
    }
/// delete the Payment Method object into the contract
/// Params: id: i128
delete the Payment Method object into the contract
Params: id: i128
delete the Payment Method object into the contract Params : id : i128
pub fn delete_payment_method(&mut self, id: i128) {
        self.users.iter().find(|x| x.user_id == env::signer_account_id().to_string() && x.admin == true).expect("User not admin");
        for i in 0..self.payment_method.len() {
            if self.payment_method.get(i).unwrap().id == id {
                self.payment_method.remove(i);
            }
        }
        for i in 0..self.payment_method_user.len() {
            if self.payment_method_user.get(i).unwrap().payment_method_id == id {
                self.payment_method_user.remove(i);
                break;
            }
        }
        env::log(b"Payment Method Delete");
        //self.merchant.get(0).unwrap().user_id.clone()
        //self.payment_method
    }
pub fn delete_payment_method ( & mut self , id : i128 ) { self . users . iter ( ) . find ( | x | x . user_id == env :: signer_account_id ( ) . to_string ( ) && x . admin == true ) . expect ( " " ) ; for i in 0 .. self . payment_method . len ( ) { if self . payment_method . get ( i ) . unwrap ( ) . id == id { self . payment_method . remove ( i ) ; } } for i in 0 .. self . payment_method_user . len ( ) { if self . payment_method_user . get ( i ) . unwrap ( ) . payment_method_id == id { self . payment_method_user . remove ( i ) ; break ; } } env :: log ( b" " ) ; //self.merchant.get(0).unwrap().user_id.clone() //self.payment_method }
delete the Payment Method object into the contract
Params: id: i128
delete the Payment Method object into the contract Params : id : i128
&mut self
id
i128