@@ -49,7 +49,7 @@ def get_balance(self):
49
49
50
50
def get_payment (self , payment_id ):
51
51
url = self .base_url + "/v2/payments/" + payment_id
52
- re = requests .get (url , headers = self .get_http_headers ())
52
+ re = requests .get (url , headers = self .get_http_headers (), timeout = 10000 )
53
53
self .handle_http_response (re )
54
54
55
55
def create_payment (self , payment_data ):
@@ -82,7 +82,7 @@ def create_payment(self, payment_data):
82
82
83
83
obj = json .dumps (obj )
84
84
url = self .base_url + "/v2/payments"
85
- re = requests .post (url , data = obj , json = obj , headers = self .get_http_headers ())
85
+ re = requests .post (url , data = obj , json = obj , headers = self .get_http_headers (), timeout = 10000 )
86
86
parsed_response = self .handle_http_response (re )
87
87
88
88
identifier = parsed_response ["identifier" ]
@@ -138,7 +138,7 @@ def submit_payment(self, payment_id, pending_payment):
138
138
139
139
def approved_payment (self , identifier ):
140
140
url = self .base_url + "/v2/payments/" + identifier + "/approve"
141
- re = requests .post (url , headers = self .get_http_headers ())
141
+ re = requests .post (url , headers = self .get_http_headers (), timeout = 10000 )
142
142
self .handle_http_response (re )
143
143
144
144
def complete_payment (self , identifier , txid ):
@@ -149,24 +149,24 @@ def complete_payment(self, identifier, txid):
149
149
150
150
obj = json .dumps (obj )
151
151
url = self .base_url + "/v2/payments/" + identifier + "/complete"
152
- re = requests .post (url , data = obj , json = obj , headers = self .get_http_headers ())
152
+ re = requests .post (url , data = obj , json = obj , headers = self .get_http_headers (), timeout = 10000 )
153
153
self .handle_http_response (re )
154
154
155
155
def cancel_payment (self , identifier ):
156
156
obj = {}
157
157
obj = json .dumps (obj )
158
158
url = self .base_url + "/v2/payments/" + identifier + "/cancel"
159
- re = requests .post (url , data = obj , json = obj , headers = self .get_http_headers ())
159
+ re = requests .post (url , data = obj , json = obj , headers = self .get_http_headers (), timeout = 10000 )
160
160
self .handle_http_response (re )
161
161
162
162
def cancel_payment_user (self , identifier ):
163
163
url = self .base_url + "/v2/payments/" + identifier + "/cancel"
164
- re = requests .post (url , headers = self .get_http_headers ())
164
+ re = requests .post (url , headers = self .get_http_headers (), timeout = 10000 )
165
165
self .handle_http_response (re )
166
166
167
167
def get_incomplete_server_payments (self ):
168
168
url = self .base_url + "/v2/payments/incomplete_server_payments"
169
- re = requests .get (url , headers = self .get_http_headers ())
169
+ re = requests .get (url , headers = self .get_http_headers (), timeout = 10000 )
170
170
res = self .handle_http_response (re )
171
171
return res ["incomplete_server_payments" ]
172
172
0 commit comments