parameters: ()
docstring: Asynchronised POST of result from paypal
docstring_summary: Asynchronised POST of result from paypal
docstring_tokens: Asynchronised POST of result from paypal
function: def paypal_success():
      '''
      Asynchronised POST of result from paypal
      '''
      payer_id = request.args.get('PayerID')
      payment_id= request.args.get('paymentId')
  
      pending_payment = Models.Payment.objects(ref_number=payment_id).first()
      if paypal_update_payment(pending_payment, payer_id):
          order = pending_payment.order
          #return redirect('http://127.0.0.1:8888/#/payment/success?order_type=%s&order_id=%s' %
          return redirect('http://m.maybi.cn/#/payment/success?order_type=%s&order_id=%s' %
                  (order.order_type, str(order.id)))
      else:
          return redirect('http://m.maybi.cn/#/payment/cancel')
function_tokens: def paypal_success ( ) : payer_id = request . args . get ( 'PayerID' ) payment_id = request . args . get ( 'paymentId' ) pending_payment = Models . Payment . objects ( ref_number = payment_id ) . first ( ) if paypal_update_payment ( pending_payment , payer_id ) : order = pending_payment . order #return redirect('http://127.0.0.1:8888/#/payment/success?order_type=%s&order_id=%s' % return redirect ( 'http://m.maybi.cn/#/payment/success?order_type=%s&order_id=%s' % ( order . order_type , str ( order . id ) ) ) else : return redirect ( 'http://m.maybi.cn/#/payment/cancel' )