@@ -18,22 +18,26 @@ def __init__(self, profile, api_client: ApiClient):
1818 "no_pending_payment_error2" : 2905
1919 }
2020
21- def get_charge_payments (self , callback = None ):
21+ def get_charge_payments (self , limit = 100000 , callback = None ):
2222 """
2323 Get a list of charge ongoing payments (pending request money)
24+ :param limit:
2425 :param callback:
2526 :return:
2627 """
2728 return self .__get_payments (action = "charge" ,
29+ limit = limit ,
2830 callback = callback )
2931
30- def get_pay_payments (self , callback = None ):
32+ def get_pay_payments (self , limit = 100000 , callback = None ):
3133 """
3234 Get a list of pay ongoing payments (pending requested money from your profile)
35+ :param limit:
3336 :param callback:
3437 :return:
3538 """
3639 return self .__get_payments (action = "pay" ,
40+ limit = limit ,
3741 callback = callback )
3842
3943 def remind_payment (self , payment : Payment = None , payment_id : int = None ) -> bool :
@@ -166,7 +170,7 @@ def __update_payment(self, action, payment_id):
166170 method = 'PUT' ,
167171 ok_error_codes = list (self .__payment_update_error_codes .values ()))
168172
169- def __get_payments (self , action , callback = None ):
173+ def __get_payments (self , action , limit , callback = None ):
170174 """
171175 Get a list of ongoing payments with the given action
172176 :return:
@@ -178,7 +182,7 @@ def __get_payments(self, action, callback=None):
178182 parameters = {
179183 "action" : action ,
180184 "actor" : self .__profile .id ,
181- "limit" : 100000
185+ "limit" : limit
182186 }
183187 response = self .__api_client .call_api (resource_path = resource_path ,
184188 params = parameters ,
@@ -248,6 +252,9 @@ def get_default_payment_method(self) -> PaymentMethod:
248252 payment_methods = self .get_payment_methods ()
249253
250254 for p_method in payment_methods :
255+ if not p_method :
256+ continue
257+
251258 if p_method .role == PaymentRole .DEFAULT :
252259 return p_method
253260
0 commit comments