@@ -138,7 +138,7 @@ def before_get_object(self, view_kwargs):
138138 }}
139139
140140
141- @order_misc_routes .route ('/event-invoices/<string:invoice_identifier>/create-paypal-payment' , methods = ['POST' ,'GET' ])
141+ @order_misc_routes .route ('/event-invoices/<string:invoice_identifier>/create-paypal-payment' , methods = ['POST' , 'GET' ])
142142@jwt_required
143143def create_paypal_payment_invoice (invoice_identifier ):
144144 """
@@ -160,7 +160,7 @@ def create_paypal_payment_invoice(invoice_identifier):
160160 return jsonify (status = False , error = response )
161161
162162
163- @order_misc_routes .route ('/event-invoices/<string:invoice_identifier>/charge' , methods = ['POST' ,'GET' ])
163+ @order_misc_routes .route ('/event-invoices/<string:invoice_identifier>/charge' , methods = ['POST' , 'GET' ])
164164@jwt_required
165165def charge_paypal_payment_invoice (invoice_identifier ):
166166 """
@@ -170,8 +170,8 @@ def charge_paypal_payment_invoice(invoice_identifier):
170170 try :
171171 paypal_payment_id = request .json ['data' ]['attributes' ]['paypal_payment_id' ]
172172 paypal_payer_id = request .json ['data' ]['attributes' ]['paypal_payer_id' ]
173- except :
174- return BadRequestError ({'source' : '' }, 'Bad Request Error' ).respond ()
173+ except Exception as e :
174+ return BadRequestError ({'source' : e }, 'Bad Request Error' ).respond ()
175175 event_invoice = safe_query (db , EventInvoice , 'identifier' , invoice_identifier , 'identifier' )
176176 # save the paypal payment_id with the order
177177 event_invoice .paypal_token = paypal_payment_id
0 commit comments