File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -766,3 +766,30 @@ def process_transaction(order_identifier, txn_token):
766766
767767    response  =  PaytmPaymentsManager .hit_paytm_endpoint (url = url , head = head , body = body )
768768    return  response 
769+ 
770+ 
771+ @order_misc_routes .route ('/orders/<string:order_identifier>/paytm/transaction-status' , methods = ['GET' ]) 
772+ def  get_transaction_status (order_identifier ):
773+     paytm_params  =  dict ()
774+     paytm_checksum_params  =  dict ()
775+     url  =  "" 
776+     paytm_mode  =  get_settings ()['paytm_mode' ]
777+     merchant_id  =  (get_settings ()['paytm_sandbox_merchant' ] if  paytm_mode  ==  'test' 
778+                    else  get_settings ()['paytm_live_merchant' ])
779+     paytm_checksum_params ["body" ] =  {
780+         "mid" : merchant_id ,
781+         "orderId" : order_identifier 
782+     }
783+     checksum  =  PaytmPaymentsManager .generate_checksum (paytm_checksum_params )
784+ 
785+     paytmParams ["MID" ] =  merchant_id 
786+     paytmParams ["ORDERID" ] =  order_identifier 
787+     paytmParams ["CHECKSUMHASH" ] =  checksum 
788+     post_data  =  json .dumps (paytm_params )
789+ 
790+     if  paytm_mode  ==  'test' :
791+         url  =  "https://securegw-stage.paytm.in/order/status" 
792+     else :
793+         url  =  "https://securegw.paytm.in/order/status" 
794+     response  =  requests .post (url , data  =  post_data , headers  =  {"Content-type" : "application/json" }).json ()
795+     return  response 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments