title: How to cancel setupIntent?
body: <p>Upon a user's registration, I have successfully created a setupIntent and attached a payment method to a customer. However, I give the option for the user to add the payment method later in settings by pressing the &quot;Later” button. When this button is pressed I'd like to cancel the setupIntent.</p>
  <p>I have the following on my server:</p>
  <pre><code>exports.cancelSetupIntent = functions.https.onCall(async (data, context) =&gt; {
    const clientSecret = data.clientSecret;
    const setupIntent = await stripe.setupIntents.cancel(
        clientSecret
    );
  });
  </code></pre>
  <p>and I call this from the client when the &quot;Later&quot; button is pressed using the following:</p>
  <pre><code>func cancelSetupIntent() {
      
      FirebaseReferenceManager.functions.httpsCallable(&quot;cancelSetupIntent&quot;).call([&quot;clientSecret&quot;: self.setupIntentParams?.clientSecret]) { (response, error) in
          if let error = error {
              print(&quot;failed to cancel setup intent: \(error.localizedDescription)&quot;)
          } else {
              print(&quot;setupIntent cancelled&quot;)
          }
      }
  }
  </code></pre>
  <p>However, I am getting an error saying: &quot;No such setupIntent: &quot;seti_...&quot;</p>
  <p>The error displays the same client secret that was created when the page opened.</p>
  <p>Any help would be very much appreciated! :)</p>