#matiullahpro
1 messages · Page 1 of 1 (latest)
Hello! That's not what that API is for. Detatching is for removing a Payment Method from a Customer. If you want to remove it from a Setup Intent update the Setup Intent and set its payment_method property to a different Payment Method or an empty string.
how?
Ah, okay, I guess you can't unset a Payment Method on a Setup Intent (I've never tried before). You would need to specify a different one.
What's your use case? It's unusual to want to remove a Payment Method from a Setup Intent without replacing it with a different one.
I want empty string on payment method., because these payment_method no more exist,
$paymentMethodId = $setupIntent->payment_method; $paymentMethod = \Stripe\PaymentMethod::retrieve($paymentMethodId); $paymentMethod->detach();
because i delete it using this code.
You can't delete a Payment Method, you can only detach it from a Customer.
Have you considered canceling the Setup Intent instead?
yes it shows, succeed statused setup intent cannot be canceled
Oh, it already succeeded? Then the Setup Intent can no longer be modified. It stays there as a historial record of what happened.