title: How to get response after integrating UPI using hyperlink
body: <p>In my iOS application, I need to accept payments from the user. I am using UPI for the same. I have followed the following document provided by UPI</p>
  
  <p><a href="http://www.npci.org.in/documents/UPI-Linking-Specs-ver-1.1_draft.pdf" rel="noreferrer">http://www.npci.org.in/documents/UPI-Linking-Specs-ver-1.1_draft.pdf</a></p>
  
  <p>I have created a deeplink as stated in the document. <code>UIApplication.shared.open</code> is used to open the deeplink url so that it opens any installed PSP(Payment Service Provider) application in my phone(like PhonePe, BHIM etc)</p>
  
  <pre><code>func payButtonClicked() {
  
          guard let urlString = "upi://pay?pa=samplevpa@ybl&amp;pn=Sample Name&amp;am=1&amp;cu=INR".addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)
              else {
                  return
              }
  
          guard let url = URL(string: urlString) else {
              return
          }
  
          if !UIApplication.shared.canOpenURL(url) {
              print("url cannot be opened")
              return
          }
  
          UIApplication.shared.open(url, options: [:], completionHandler: { (success) in
  
              print(success)
  
          })
  
      }
  </code></pre>
  
  <p>I have registered my application with custom URL schemes and have added the scheme upi for ApplicationQueriesScheme in plist file</p>
  
  <pre><code>&lt;array&gt;
          &lt;dict&gt;
              &lt;key&gt;CFBundleTypeRole&lt;/key&gt;
              &lt;string&gt;Editor&lt;/string&gt;
              &lt;key&gt;CFBundleURLSchemes&lt;/key&gt;
              &lt;array&gt;
                  &lt;string&gt;SampleApp&lt;/string&gt;
              &lt;/array&gt;
              &lt;key&gt;CFBundleURLName&lt;/key&gt;
              &lt;string&gt;com.company.SampleApp&lt;/string&gt;
          &lt;/dict&gt;
      &lt;/array&gt;
      &lt;key&gt;LSApplicationQueriesSchemes&lt;/key&gt;
      &lt;array&gt;
          &lt;string&gt;upi&lt;/string&gt;
      &lt;/array&gt;
  </code></pre>
  
  <p>It is opening the PSP application and I'm able to make the transaction. The problem is I'm not able to get the response back from the PSP application. There is no callback method to <code>UIApplication.shared.open</code> method. I need to get the status of the transaction back from the PSP application and show the status to the user. Any help appreciated</p>